<%= 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/message_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %>
<% if type == 'Message' %>
<%= 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, :is_course => is_course, :is_board => is_board},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %>
<%= link_to(
l(:button_delete),
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
:method => :post,
:remote => true,
:id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) %>
<% end %>
<% elsif type == 'JournalsForMessage' %>
<%= 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)) %>
<% if comment.creator_user == User.current || User.current.admin? %>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id},
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
<% end %>
<% elsif type == 'OrgDocumentComment' %>
<%= 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)) %>
<% if comment.creator_user == User.current %>
<%= link_to(
l(:button_delete),
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
:method => :delete,
:remote => true,
:id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)) %>
<% end %>
<% elsif type == 'BlogComment' %>
<%= 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, :homepage => homepage, :user_id => user_id},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !comment.root.locked? %>
<% if comment.author == User.current %>
<%= link_to(
l(:button_delete),
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id},
:method => :delete,
:remote => true,
:id => "delete_reply_#{activity_id}_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)) %>
<% end %>
<% end %>
<% end %>