开启匿评后学生不可删除作品附件

dev_xiangzheng
cxt 10 years ago
parent bfdfde8028
commit 7359081fd2

@ -45,7 +45,7 @@
<span style="color: #999999">尚未提交附件</span>
<% else%>
<div class="fl" style="width: 90%;">
<%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %>
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
</div>
<% end%>
<div class="cl"></div>

@ -0,0 +1,8 @@
<% attachments.each_with_index do |attachment,i| %>
<div id="attachment_<%= attachment.id%>">
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
<%= link_to('&nbsp;'.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 %>
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
<div class="cl"></div>
</div>
<% end -%>
Loading…
Cancel
Save