<%=l(:label_attachment_new)%>

<% versions = project.versions.sort %> <% attachmenttypes = project.attachmenttypes %> <%= error_messages_for 'attachment' %> <%= form_tag(project_files_path(project), :multipart => true,:remote => true,:method => :post,:name=>"upload_form", :class => "tabular") do %>

<% if versions.any? %> <% if attachmenttypes.any? %> <% end %> <% else %>

<% if attachmenttypes.any? %> <%= l(:attachment_type) %> <%= select_tag "attachment_type", options_from_collection_for_select(attachmenttypes, "id", "typeName", 2), {style: 'width:100px'} %> <% end %>

<% end %>

<%= l(:field_version) %>

<%= select_tag "version_id", content_tag('option', '') + options_from_collection_for_select(versions, "id", "name"), {style: 'width:230px'} %> <%= l(:attachment_type) %> <%= select_tag "attachment_type", options_from_collection_for_select(attachmenttypes, "id", "typeName", 2), {style: 'width:100px'} %>

<%=l(:label_attachment_plural)%><%= render :partial => 'attachments/form', locals: {project: project} %>

<%= submit_tag l(:button_add) %> <% end %>