From 7359081fd23df5e21e57c9c52ca6909661e17b77 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 19 Oct 2015 13:58:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=8C=BF=E8=AF=84=E5=90=8E?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=B8=8D=E5=8F=AF=E5=88=A0=E9=99=A4=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_show.html.erb | 2 +- app/views/student_work/_work_attachments_status.html.erb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 app/views/student_work/_work_attachments_status.html.erb diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 2aa14be71..cfc4129a8 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -45,7 +45,7 @@ 尚未提交附件 <% else%>
- <%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %> + <%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
<% end%>
diff --git a/app/views/student_work/_work_attachments_status.html.erb b/app/views/student_work/_work_attachments_status.html.erb new file mode 100644 index 000000000..e8d4f144b --- /dev/null +++ b/app/views/student_work/_work_attachments_status.html.erb @@ -0,0 +1,8 @@ +<% attachments.each_with_index do |attachment,i| %> +
+ <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %> + (<%= number_to_human_size attachment.filesize %>) +
+
+<% end -%> \ No newline at end of file