From b79a50ce2fc367a3fc3109d2e35d3124cf4a252d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 4 Jan 2016 12:33:43 +0800 Subject: [PATCH] =?UTF-8?q?issue=E5=9B=9E=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_issue_reply.html.erb | 19 +++-- app/views/issues/_detail.html.erb | 89 +++++++++----------- app/views/issues/_issue_attachments.html.erb | 10 +++ app/views/issues/_issue_replies.html.erb | 8 +- app/views/issues/add_journal.js.erb | 1 + 5 files changed, 68 insertions(+), 59 deletions(-) create mode 100644 app/views/issues/_issue_attachments.html.erb diff --git a/app/views/attachments/_issue_reply.html.erb b/app/views/attachments/_issue_reply.html.erb index d3232ecf2..5526b0d17 100644 --- a/app/views/attachments/_issue_reply.html.erb +++ b/app/views/attachments/_issue_reply.html.erb @@ -1,9 +1,17 @@ - + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + - - "$('#_file').click();">上传附件 + <% id ="file#{container.id}"%> + 上传附件 <%= file_field_tag 'attachments[dummy][file]', - :id => "_file", + :id => "file#{container.id}", :class => 'file_selector', :multiple => true, :onchange => "addInputFiles_board(this, '#{container.id}');", @@ -20,10 +28,9 @@ :delete_all_files => l(:text_are_you_sure_all), :lebel_file_uploding => l(:lebel_file_uploding)} %> <% if container.nil? %> - <%= l(:label_no_file_uploaded) %> + <%= l(:label_no_file_uploaded)%> <% end %> - <% content_for :header_tags do %> <%= javascript_include_tag 'attachments' %> <% end %> diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb index 664dcfa75..00aa341fe 100644 --- a/app/views/issues/_detail.html.erb +++ b/app/views/issues/_detail.html.erb @@ -1,51 +1,46 @@
-
- <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %> -
-
-

- <% case @issue.tracker_id %> - <% when 1%> - - <% when 2%> - - <% when 3%> - - <% when 4%> - - <% when 5%> - - <% end %> - <%= @issue.subject %> - <%= get_issue_priority(@issue.priority_id)[1] %>

-
-
- 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> -
- - - -<%= render :partial => 'action_menu' %> -
-<% if @issue.description? || @issue.attachments.any? -%> -
- <% if @issue.description? %> - <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> - <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> +
+ <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %> +
+
+

+ <% case @issue.tracker_id %> + <% when 1%> + + <% when 2%> + + <% when 3%> + + <% when 4%> + + <% when 5%> + <% end %> -

-<% end -%> -<% if @issue.attachments.any? %> -
- - - <%= link_to_attachment_project @issue, :thumbnails => true %>
- <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> -
+ <%= @issue.subject %> + <%= get_issue_priority(@issue.priority_id)[1] %>

+
-<% end %> + 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> +
- -<%= render :partial => 'issues/attributes_show' %> -
-
\ No newline at end of file + + + <%= render :partial => 'action_menu' %> +
+ <% if @issue.description? || @issue.attachments.any? -%> +
+ <% if @issue.description? %> + <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> + <% end %> +
+ <% end -%> + + <%# 附件局部刷新 %> +
+ <%= render :partial => 'issue_attachments',:locals => {:issue => @issue} %> +
+ + <%= render :partial => 'issues/attributes_show' %> +
+ \ No newline at end of file diff --git a/app/views/issues/_issue_attachments.html.erb b/app/views/issues/_issue_attachments.html.erb new file mode 100644 index 000000000..4fad18877 --- /dev/null +++ b/app/views/issues/_issue_attachments.html.erb @@ -0,0 +1,10 @@ +<% if issue.attachments.any? %> +
+ + + <%= link_to_attachment_project issue, :thumbnails => true %> +
+ <%= call_hook(:view_issues_show_description_bottom, :issue => issue) %> +
+
+<% end %> \ No newline at end of file diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index e6181d72c..af498b83a 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -27,16 +27,12 @@ <% end %>

<%= reply.notes.html_safe %>

- <% if reply.attachments.any? %> - <%= link_to_attachment_project reply, :thumbnails => true %>
-
- <% end %>
<%= format_time(reply.created_on) %>