<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
<% 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 <%= link_to activity.project.name.to_s+" | 项目讨论区",project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
<% if activity.parent_id.nil? %> <%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> <% else %> <%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> <% end %>
时间:<%= format_date(activity.created_on) %>
帖子描述: <% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> <%= activity.parent.content.to_s.html_safe%> <% end %>
<% count=0 %>
回复( <% if activity.parent_id.nil? %> <% count=activity.replies_count%> <%=count %> <% else %> <% count=activity.parent.replies_count%> <%=count %> <% end %> )
<%#=format_date(activity.updated_on)%>
<%if count>2 %> <% end %>
<% activity= activity.parent_id.nil? ? activity : activity.parent %> <% replies_all_i = 0 %> <% unless activity.children.empty? %>
    <% activity.children.reorder("created_on desc").each do |reply| %> <% replies_all_i=replies_all_i+1 %>
  • <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %>
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <% else %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_date(reply.created_on) %> <%#= link_to( l(:button_delete), {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, :method => :post, :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete), :class => 'replyGrey fr ml10' ) if reply.course_destroyable_by?(User.current) %>
    <%= reply.content.html_safe %>
  • <% end %>
<% end %>