<% if @organization.switch_type && @document && !@document.org_subfield_id.blank? %> <%= render :partial => 'show_custom_org_document_comment' %> <% 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 @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %> | <% if @document.organization.home_id == @document.id %> 首页 <% else %> 组织文章 <% end %> <% if @document.organization.home_id == @document.id %> 已设为首页 <% end %>
<%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %>
发布时间:<%= 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.find(@document.organization_id) || User.current.id == @document.creator_id) %>
    • <% if @document.organization.home_id == @document.id %> <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> 取消首页 <% end %> <% else %> <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> 设为首页 <% end %> <% end %>
    • <%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
    • <%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete', :data => {:confirm => l(:text_are_you_sure)}, :remote => true, :class => 'postOptionLink' %>
<% end %>
<% all_comments = []%> <% count=get_all_children(all_comments, @document).count %>
<%# if count > 0 %>
回复 <%= count>0 ? "(#{count})" : "" %> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>@document, :user_activity_id=>@document.id,:type=>"activity"}%>
<% all_comments = []%> <% comments = get_all_children(all_comments, @document) %>
<% comments.each do |comment| %>
  • <%= 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? %>
    <%= comment.content_detail.html_safe %>
    <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%= link_to( l(:button_reply), {:controller => 'org_document_comments',:action => 'quote',:user_id=>comment.creator_id, :id => comment.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 => 'delete_reply', :id => comment.id}, :method => :delete, :id => "delete_reply_#{comment.id}", :class => 'fr mr20 undis', :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete)) %> <% end %>

    <% end %>
  • <% end %>
    <%# end %> <%# if User.current.logged?%>
    <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= f.kindeditor :org_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 %>