<%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> <% end %>
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
<% if User.current.logged? %> <%end%>
<% if @topic.try(:author).try(:realname) == ' ' %> <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <% else %> <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %> <% end %>
<%= format_time( @topic.created_on)%>
<%= @topic.content.html_safe%>
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
回复 <%= @reply_count>0 ? "(#{@reply_count})" : "" %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@topic, :user_activity_id=>@topic.id,:type=>"activity"}%>
<%# all_comments = []%> <%# comments = get_all_children(all_comments, @topic) %>
<% @replies.each_with_index do |reply,i| %>
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<%= reply.content.html_safe%>
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> <%= link_to( l(:button_reply), {:action => 'quote', :id => reply}, :remote => true, :method => 'get', :title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %> <%= link_to( l(:button_delete), {:action => 'destroy', :id => reply}, :method => :post, :id => "delete_reply_#{reply.id}", :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if reply.destroyable_by?(User.current) %>

<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'project_board_cancel_message_replay();', :class => "grey_btn fr c_white mt10 mr5 ml10" %> <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'project_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %> <% end %>
<% end %>