<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
<%=activity.project.name %>(项目名称)
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
:action => 'show',
:id => attachment,
:filename => attachment.filename %>
<% end %>
<%= number_to_human_size attachment.filesize %>
<% end %>
<% end %>