<% if @organization.switch_type %> <%= render :partial => 'sub_document_comments/show_newstyle', :locals => {:document => @document} %> <% else %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %>
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
<%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %> TO  <%= link_to @organization.name, organization_path(@organization), :class => "newsBlue" %> | <%=link_to @org_subfield.name, organization_path(@organization, :org_subfield_id => @org_subfield.id), :class => "newsBlue" %> | <%=link_to @subdomain.name, org_subfield_sub_domain_sub_document_comments_path(:sub_domain_id => @subdomain.id, :org_subfield_id => @org_subfield.id), :class => "newsBlue" %> <%# if @organization.home_id == @document.id %> <%# else %> <%# end %>
<%= link_to @document.title %>
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %>
<% unless @document.content.blank? %>
<%= @document.content.html_safe %>
<% end %>
<%#= render :partial=>"attachments/activity_attach", :locals=>{:activity => @document} %> <%#= link_to_attachments_course @document, :author => false %>
<% if User.current.admin? || User.current.admin_of_org?(@organization) || User.current.id == @document.creator_id %>
    • <%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 1), :class => "postOptionLink" %>
    • <%= link_to "删除文章", org_subfield_sub_domain_sub_document_comment_path(@document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => @document.sub_domain.id, :flag => 0, :detail_page=>1), :method => 'delete', :data => {:confirm => l(:text_are_you_sure)}, :remote => true, :class => 'postOptionLink' %>
<% end %>
<% comments_for_doc = @document.children.reorder("created_at desc") %> <% count = @document.children.count() %>
<%# if count > 0 %>
回复 <%= count>0 ? "(#{count})" : "" %> <%# if @document.creator_id.to_i == User.current.id.to_i %> <%# else %> <%#=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%> <%# end %>
<% if count > 3 %> <% end %>
<% comments_for_doc.each_with_index do |reply,i| %> <% user = User.find(reply.creator_id) %>
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %>
<%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %>
<%= reply.content.html_safe unless reply.content.nil? %>
<%= format_time(reply.created_at) %>

<% end %>
<%# end %> <%# if User.current.logged?%>
<%= form_for :org_comment, :url => {:action => 'add_reply_in_doc', :controller => 'sub_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= f.kindeditor :sub_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %> <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> <%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %> <% end %>
<%# end %>
<% end %>