限制文件列表中昵称的长度

course_group v20140918_1
sw 11 years ago
parent 7e6546d828
commit 8688c03aee

@ -12,7 +12,7 @@
:filename => attachment.filename%>
<% end %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
<%= h(truncate(" - #{attachment.description}", length: 15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
@ -34,7 +34,10 @@
<% end %>
<% if options[:author] %>
<!-- modified by zjc author添加超链接 -->
<span class="author"><%= link_to h(attachment.author),user_path(attachment.author) %>, <%= format_time(attachment.created_on) %></span>
<span class="author" title="attachment.author">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %>
</span>
<% end %>
</p>
<% end %>

Loading…
Cancel
Save