socialforge/app/views/news/_news_all_replies.html.erb

100 lines
5.2 KiB
Plaintext
Raw Normal View History

<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= @comments.count>0 ? "#{@comments.count}" : "" %></sapn><span style="color: #cecece;">▪</span>
<span id="praise_count_<%=@news.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@news, :user_activity_id=>@news.id,:type=>"activity"}%>
</span>
</div>
</div>
<% unless @comments.empty? %>
<div class="" id="reply_div_<%=@news.id %>">
<% @comments.each_with_index do |comment,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= comment.id %>');
autoUrl('reply_message_description_<%= comment.id %>');
});
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
2016-07-21 10:30:48 +08:00
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
<% if !comment.content_detail.blank? %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.content_detail.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'comments',:action => 'quote', :id => comment},
:remote => true,
:method => 'get',
:title => l(:button_reply))%>
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:controller => 'comments',
:action => 'destroy', :id => @news,
:comment_id => comment},
:method => :delete,
:id => "delete_reply_#{comment.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if User.current.allowed_to?(:manage_news, object) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</div>
<% end %>
<div class="cl"></div>
<% if @news.commentable? %>
<div class="talkWrapMsg" nhname="about_talk_reply">
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml5 mb10" id="reply<%= @news.id %>">
<%= form_for @comment, :url=>{:controller => 'comments', :action => 'create', :id => @news}, :html => {:multipart => true, :id => 'add_comment_form'} do |f| %>
<div class="box" id="news_comment">
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :comments, :editor_id => 'comment_editor',
:owner_id => @comment.nil? ? 0: @comment.id,
:owner_type => OwnerTypeHelper::COMMENT,
:width => '99%',
:height => 100,
:minHeight=>100,
:input_html => { :id => 'comment_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
</div>
<p id="add_reply_news"></p>
<p class="mt10">
<a href="javascript:void(0)" class="grey_btn fr ml10 mr5" onclick="KindEditor.instances[0].html('');">
<%= l(:label_cancel_with_space) %>
</a>
<a href="javascript:void(0)" class="blue_btn fr" id="news_submit_comment">
<%= l(:label_comment_with_space) %>
</a>
</p>
<% end %>
<div class="cl"></div>
</div>
</div>
<% end %>