|
|
@ -1,152 +1,152 @@
|
|
|
|
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
|
|
|
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
|
|
|
<div class="homepagePostBrief">
|
|
|
|
<div class="homepagePostBrief">
|
|
|
|
<div class="homepagePostPortrait">
|
|
|
|
<div class="homepagePostPortrait">
|
|
|
|
<%= 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 image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
|
|
|
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
|
|
|
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostDes">
|
|
|
|
<div class="homepagePostDes">
|
|
|
|
<div class="homepagePostTo">
|
|
|
|
<div class="homepagePostTo">
|
|
|
|
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
|
|
|
|
<%= 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" %>
|
|
|
|
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
|
|
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
|
|
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
|
|
|
<div class="homepagePostDate fl">
|
|
|
|
<div class="homepagePostDate fl">
|
|
|
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
|
|
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostDate fl ml15">
|
|
|
|
<div class="homepagePostDate fl ml15">
|
|
|
|
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
|
|
|
|
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<% unless document.content.blank? %>
|
|
|
|
<% unless document.content.blank? %>
|
|
|
|
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
|
|
|
|
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
|
|
|
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
|
|
|
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
|
|
|
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
<div class="mt10" style="font-weight:normal;">
|
|
|
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
|
|
|
|
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <%# if defined?(home_id) %>
|
|
|
|
<!-- <%# if defined?(home_id) %>
|
|
|
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
|
|
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
|
|
|
<%# end %>-->
|
|
|
|
<%# end %>-->
|
|
|
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
|
|
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
|
|
|
<div class="homepagePostSetting">
|
|
|
|
<div class="homepagePostSetting">
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
|
|
|
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
|
|
|
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
|
|
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
|
|
|
|
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :class => "postOptionLink" %>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
|
|
|
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:remote => true, :class => 'postOptionLink' %>
|
|
|
|
:remote => true, :class => 'postOptionLink' %>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
|
|
|
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
|
|
|
<% count = document.children.count() %>
|
|
|
|
<% count = document.children.count() %>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
|
|
|
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
<div class="homepagePostReplyBanner">
|
|
|
|
<div class="homepagePostReplyBannerCount">回复
|
|
|
|
<div class="homepagePostReplyBannerCount">回复
|
|
|
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
|
|
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
|
|
|
<span id="praise_count_<%=document.id %>">
|
|
|
|
<span id="praise_count_<%=document.id %>">
|
|
|
|
<% if document.creator_id.to_i == User.current.id.to_i %>
|
|
|
|
<% if document.creator_id.to_i == User.current.id.to_i %>
|
|
|
|
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
|
|
|
<span class="ml15 likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(document) > 0 ? "(#{get_praise_num(document)})" : "" %></span></span>
|
|
|
|
<% else %>
|
|
|
|
<% else %>
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% if count > 3 %>
|
|
|
|
<% if count > 3 %>
|
|
|
|
<div class="homepagePostReplyBannerMore">
|
|
|
|
<div class="homepagePostReplyBannerMore">
|
|
|
|
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
|
|
|
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
|
|
|
展开更多
|
|
|
|
展开更多
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
|
|
|
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<% reply_id = 0 %>
|
|
|
|
<% reply_id = 0 %>
|
|
|
|
<% comments_for_doc.each do |comment| %>
|
|
|
|
<% comments_for_doc.each do |comment| %>
|
|
|
|
<% reply_id += 1 %>
|
|
|
|
<% reply_id += 1 %>
|
|
|
|
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
|
|
|
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
|
|
|
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
|
|
|
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
|
|
|
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
|
|
|
|
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
|
|
|
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
|
|
|
|
<span id="reply_praise_count_<%=comment.id %>">
|
|
|
|
<span id="reply_praise_count_<%=comment.id %>">
|
|
|
|
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
|
|
|
<% if comment.creator_id.to_i == User.current.id.to_i %>
|
|
|
|
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
|
|
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(comment) > 0 ? "(#{get_praise_num(comment)})" : "" %></span></span>
|
|
|
|
<% else %>
|
|
|
|
<% else %>
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% unless comment.content.blank? %>
|
|
|
|
<% unless comment.content.blank? %>
|
|
|
|
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
|
|
|
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
|
|
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
|
|
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
|
|
|
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
|
|
|
|
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current) %>
|
|
|
|
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="homepagePostReplyInputContainer">
|
|
|
|
<div class="homepagePostReplyInputContainer">
|
|
|
|
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
|
|
|
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
|
|
|
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
|
|
|
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
|
|
|
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
|
|
|
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
|
|
|
<div nhname='toolbar_container_<%= act.id %>'></div>
|
|
|
|
<div nhname='toolbar_container_<%= act.id %>'></div>
|
|
|
|
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
|
|
|
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
|
|
|
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
|
|
|
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<p nhname='contentmsg_<%= act.id %>'></p>
|
|
|
|
<p nhname='contentmsg_<%= act.id %>'></p>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
function expand_reply(container, btnid) {
|
|
|
|
function expand_reply(container, btnid) {
|
|
|
|
var target = $(container);
|
|
|
|
var target = $(container);
|
|
|
|
var btn = $(btnid);
|
|
|
|
var btn = $(btnid);
|
|
|
|
if (btn.data('init') == '0') {
|
|
|
|
if (btn.data('init') == '0') {
|
|
|
|
btn.data('init', 1);
|
|
|
|
btn.data('init', 1);
|
|
|
|
btn.html('收起回复');
|
|
|
|
btn.html('收起回复');
|
|
|
|
target.show();
|
|
|
|
target.show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
btn.data('init', 0);
|
|
|
|
btn.data('init', 0);
|
|
|
|
btn.html('展开更多');
|
|
|
|
btn.html('展开更多');
|
|
|
|
target.hide();
|
|
|
|
target.hide();
|
|
|
|
target.eq(0).show();
|
|
|
|
target.eq(0).show();
|
|
|
|
target.eq(1).show();
|
|
|
|
target.eq(1).show();
|
|
|
|
target.eq(2).show();
|
|
|
|
target.eq(2).show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|