<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> TO <%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue ml15" %>
<% if activity.sticky == 1%> 置顶 <% end%>
发布时间:<%= format_time(activity.created_on) %>
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
<% if User.current.logged? %>
  • <% if User.current.logged? %>
    • <%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %>
    • <%= link_to( l(:button_edit), {controller:'news', :action => 'edit', :id => activity.id}, :class => 'postOptionLink' ) if User.current.allowed_to?(:manage_news, activity.course) %>
    • <%= delete_link( news_path(activity), :data => {:confirm => l(:text_are_you_sure)}, :class => 'postOptionLink' ) if User.current.allowed_to?(:manage_news, activity.course) %>
    <% end %>
<% end %>
<% count=activity.comments.count %>
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> <% comments = activity.comments.reorder("created_on desc").limit(3) %> <% if count > 0 %>
<%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
<% end %> <% if activity.commentable? %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
<% if User.current.logged? %>
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>

<% end%>
<% else %> <%= render :partial => "users/show_unlogged" %> <% end %>
<% end %>