<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? || comment.class == Journal %>
<% if type == 'HomeworkCommon' %>
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
<% end %>
<% elsif type == 'News' %>
<%= link_to(
l(:button_reply),
{:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id => activity_id, :comment_id => comment, :user_activity_id => user_activity_id},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) if News.find(activity_id).author == User.current %>
<% elsif type == 'Issue' %>
<%= link_to(
l(:button_reply),
{:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<%= link_to(
l(:button_delete),
{:controller => 'issues',:action => 'delete_journal', :id => activity_id,:journal_id=>comment.id, :user_activity_id => user_activity_id},
:method => 'get',
:remote=>true,
:class => 'fr mr20',
:title => l(:button_delete)
) if comment.user_id == User.current.id %>
<% elsif type == 'Syllabus' %>
<%= link_to(
l(:button_reply),
{:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => type},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<% if User.current.admin? || User.current == Syllabus.find(activity_id).user || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
<% end %>
<% end %>
<% end %>