<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), 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.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course), :class => "newsBlue ml15 mr5"%>
<% if activity.parent_id.nil? %> <%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" %> <% else %> <%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey"%> <% end %>
发帖时间:<%= format_time(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 %> <% count=activity.parent.children.count%> <% else %> <% count=activity.children.count%> <% end %> <%= count %> )
<%#=format_date(activity.updated_on)%>
<%if count > 2 %> <% end %>
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>

取消 发送 <% end%>
<% activity= activity.parent ? activity.parent : activity%> <% replies_all_i = 0 %> <% if count > 0 %>
    <% 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_time(reply.created_on) %>
    <%= reply.content.html_safe %>
  • <% end %>
<% end %>