#1839上传附件名延后省略号显示

This commit is contained in:
sw 2015-02-03 10:42:36 +08:00
parent 320ee9289a
commit 7ab5eeab65
1 changed files with 14 additions and 12 deletions

View File

@ -1,14 +1,15 @@
<div class="attachments" style="font-weight:normal;">
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<div style="width:65%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
<span title="<%= attachment.filename%>" id = "attachment_">
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% end %>
</span>
</div>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
@ -19,8 +20,9 @@
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<span class="size">(
<%= number_to_human_size attachment.filesize %>)
</span>
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},