动态和文章样式问题解决

This commit is contained in:
ouyangxuhua 2015-11-14 10:25:51 +08:00
parent c51491367f
commit 9bf8f6058f
1 changed files with 71 additions and 70 deletions

View File

@ -1,75 +1,76 @@
<div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> |
<% if document.organization.home_id == document.id %>
<span style="color:#269ac9;">首页</span>
<% else %>
<span style="color:#269ac9;">组织</span>
<% end %>
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
</div>
<div class="homepagePostTitle postGrey"><%= document.title %></div>
<div class="homepagePostDate">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
<% unless document.content.blank? %>
<div class="homepagePostIntro">
<%= document.content.html_safe %>
</div>
<% end %>
<!-- <%# if defined?(home_id) %>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
<% if document.organization.home_id == document.id %>
<span style="color:#269ac9;">首页</span>
<% else %>
<span style="color:#269ac9;">组织</span>
<% end %>
</div>
<div class="homepagePostTitle postGrey"><%= document.title %></div>
<div class="homepagePostDate">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
<% unless document.content.blank? %>
<div class="homepagePostIntro">
<%= document.content.html_safe %>
</div>
<% end %>
<!-- <%# 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 => 'set_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), :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>
<div class="cl"></div>
</div>
<% end %>
<% comments_for_doc = document.children.reorder("created_at desc") %>
<% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<div class="homepagePostReplyBanner" style="display:<%= count == 0?'none':'block' %>">
<div class="homepagePostReplyBannerCount">回复(<%= count %></div>
<% if count > 3 %>
<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>
</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 => 'set_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), :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 class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0?'none':'block' %>">
<% comments_for_doc = document.children.reorder("created_at desc") %>
<% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<div class="homepagePostReplyBanner" style="display:<%= count == 0 ? 'none' : 'block' %>">
<div class="homepagePostReplyBannerCount">回复(<%= count %></div>
<% if count > 3 %>
<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>
</div>
<% end %>
</div>
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<ul>
<% reply_id = 0 %>
<% comments_for_doc.each do |comment| %>
<% 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_path(comment.creator_id) %></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
@ -87,12 +88,12 @@
</div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15">
<%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
</div>
<div class="homepagePostReplyInputContainer">
<div nhname='new_message_<%= document.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="user_activity_id" value="<%= document.id %>" />
<input type="hidden" name="user_activity_id" value="<%= document.id %>"/>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= document.id %>' name="org_content"></textarea>
<div nhname='toolbar_container_<%= document.id %>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
@ -110,15 +111,15 @@
</div>
<script type="text/javascript">
function expand_reply(container,btnid){
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);
if(btn.data('init')=='0'){
btn.data('init',1);
if (btn.data('init') == '0') {
btn.data('init', 1);
btn.html('收起回复');
target.show();
}else{
btn.data('init',0);
} else {
btn.data('init', 0);
btn.html('展开更多');
target.hide();
target.eq(0).show();