二级域名中帖子回复功能

This commit is contained in:
huang 2016-05-03 17:11:08 +08:00
parent 5fb5a2e8bc
commit 0e46d0ac27
1 changed files with 72 additions and 0 deletions

View File

@ -41,6 +41,78 @@
</div>
</div>
<!--回复暂时不提供-->
<% 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">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<!--<span id="praise_count_<%#=document.id %>">-->
<!--<%# 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>-->
<!--<%# else %>-->
<!--<%#=render :partial=> "praise_tread/praise", :locals => {:activity=>document, :user_activity_id=>document.id,:type=>"activity"}%>-->
<!--<%# end %>-->
<!--</span>-->
</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' : '' %>">
<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="homepagePostReplyPublisher">
<%= 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) %>
<!--<span id="reply_praise_count_<%#=comment.id %>">-->
<!--<%# 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>-->
<!--<%# else %>-->
<!--<%#=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>-->
<!--<%# end %>-->
<!--</span>-->
</div>
<% unless comment.content.blank? %>
<div class="homepagePostReplyContent"><%= comment.content.html_safe %></div>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
</div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<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.id) %>
</div>
<div class="homepagePostReplyInputContainer">
<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| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div>
<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)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
<script type="text/javascript">