<% if activity.status == 1 %> <%= image_tag("/images/trustie_logo1.png", width: "50px", height: "50px") %> <% else %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <% end %>
<% if activity.status == 1 %> 确实团队 <% else %> <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <% else %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <% end %> <% end %> TO <%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
<% if activity.sticky == 1%> 置顶 <% end%> <% if activity.locked%>        <% end%>
发帖时间:<%= format_time(activity.created_on) %>
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
<% if activity.parent_id.nil? %> <% content = activity.content%> <% else %> <% content = activity.parent.content%> <% end %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <% if activity.status == 1 %> <%= activity.created_on.year %> <%= activity.created_on.month %> <%= activity.created_on.day %> <% end %>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
<% count=0 %> <% if activity.parent %> <% count=activity.parent.children.count%> <% else %> <% count=activity.children.count%> <% end %>
回复 <%= count>0 ? "(#{count})" : "" %> <% if activity.author == User.current %> <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> <% end %>
<%#=format_date(activity.updated_on)%>
<%if count > 3 %> <% 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 => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
    <% if reply.try(:author).try(:realname) == ' ' %> <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <% else %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(reply.created_on) %> <% if reply.author == User.current %> <% else %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <% end %>
    <%= reply.content.html_safe %>
  • <% end %>
<% end %> <% if !activity.locked? && authorize_for_course('messages', 'reply') %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%>

<% end%>
<% end %>