From 62ea2b384999f9a749158d157f2b9fee3d6862f4 Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 11 Mar 2014 10:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=96=87=E4=BB=B6=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_new.html.erb | 17 +++++++++++++ app/views/files/index.html.erb | 13 ++++++---- app/views/files/new.html.erb | 32 ++++++++++++------------- app/views/layouts/_base_header.html.erb | 4 ++++ 4 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 app/views/files/_new.html.erb diff --git a/app/views/files/_new.html.erb b/app/views/files/_new.html.erb new file mode 100644 index 000000000..ac5dce466 --- /dev/null +++ b/app/views/files/_new.html.erb @@ -0,0 +1,17 @@ +

<%=l(:label_attachment_new)%>

+<% versions = project.versions.sort %> +<%= error_messages_for 'attachment' %> +<%= form_tag(project_files_path(project), :multipart => true, :class => "tabular") do %> +
+ +<% if versions.any? %> +

+<%= select_tag "version_id", content_tag('option', '') + + options_from_collection_for_select(versions, "id", "name") %>

+<% end %> + +

<%= render :partial => 'attachments/form' %>

+
+<%= submit_tag l(:button_add) %> +<% end %> +
\ No newline at end of file diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 3012c0a21..769f85ce8 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -102,10 +102,10 @@ div.pagination{ border: 1px solid #15bccf; box-shadow: 3px 3px 3px #666666; } -#relation_file_div{ +.relation_file_div{ margin: 0px 25px; } -#relation_file_div fieldset{ +.relation_file_div fieldset{ margin: 0px 25px; border-radius: 5px; } @@ -118,10 +118,13 @@ div.pagination{ <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
- <%= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> + <%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> + <%= link_to('上传文件', 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> <%= link_to('关联已有文件', 'javascript:void(0);', :onclick => "$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> - -