2016-01-29 16:16:02 +08:00
|
|
|
<div class="resources mt10">
|
|
|
|
<div class="homepagePostBrief">
|
|
|
|
|
|
|
|
<div class="homepagePostDes" style="width:690px;">
|
|
|
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
|
|
|
<% unless document.content.blank? %>
|
|
|
|
<div class="homepagePostIntro" id="intro_content_<%= document.id%>">
|
|
|
|
<%= document.content.html_safe %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if params[:show_homepage].nil? %>
|
|
|
|
<div class="homepagePostDate" style="float:right;">
|
|
|
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="homepagePostDate" style="float:right;">
|
|
|
|
最后编辑:<%= User.find(EditorOfDocument.where("org_document_comment_id =?", document.id).order("created_at desc").first.editor_id).realname %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-02-23 16:17:14 +08:00
|
|
|
<div class="cl"></div>
|
2016-01-29 16:16:02 +08:00
|
|
|
<!-- <%# if defined?(home_id) %>
|
|
|
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
|
|
|
<%# end %>-->
|
|
|
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
|
|
|
<div class="homepagePostSetting">
|
|
|
|
<ul>
|
|
|
|
<li class="homepagePostSettingIcon">
|
|
|
|
<ul class="homepagePostSettiongText">
|
|
|
|
<li>
|
|
|
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
|
|
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<%= link_to "编辑首页", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 2), :class => "postOptionLink" %>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<%= link_to "删除首页", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:remote => true, :class => 'postOptionLink' %>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2016-02-03 12:42:42 +08:00
|
|
|
$("#intro_content_<%= document.id%> p,#intro_content_<%= document.id%> span,#intro_content_<%= document.id%> em").each(function(){
|
2016-02-02 10:08:04 +08:00
|
|
|
var postContent = $(this).html();
|
|
|
|
postContent = postContent.replace(/ /g," ");
|
|
|
|
postContent= postContent.replace(/ {2}/g," ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
postContent=postContent.replace(/ /g," ");
|
|
|
|
$(this).html(postContent);
|
|
|
|
});
|
2016-05-20 18:40:39 +08:00
|
|
|
autoUrl('intro_content_<%= document.id %>');
|
2016-01-29 16:16:02 +08:00
|
|
|
function expand_reply(container, btnid) {
|
|
|
|
var target = $(container);
|
|
|
|
var btn = $(btnid);
|
|
|
|
if (btn.data('init') == '0') {
|
|
|
|
btn.data('init', 1);
|
|
|
|
btn.html('收起回复');
|
|
|
|
target.show();
|
|
|
|
} else {
|
|
|
|
btn.data('init', 0);
|
|
|
|
btn.html('展开更多');
|
|
|
|
target.hide();
|
|
|
|
target.eq(0).show();
|
|
|
|
target.eq(1).show();
|
|
|
|
target.eq(2).show();
|
|
|
|
}
|
|
|
|
}
|
2015-11-30 16:04:43 +08:00
|
|
|
</script>
|