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