|
|
|
@ -156,61 +156,65 @@
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<% unless @replies.empty? %>
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<% @replies.each_with_index do |reply,i| %>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
|
autoUrl('reply_message_description_<%= reply.id %>');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
|
<% if reply.try(:author).try(:realname) == ' ' %>
|
|
|
|
|
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
|
|
|
|
<%= reply.content.html_safe%>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
|
|
|
|
<%= format_time(reply.created_on) %>
|
|
|
|
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
|
|
|
|
<span id="reply_praise_count_<%=reply.id %>">
|
|
|
|
|
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
|
|
|
|
</span>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:class => 'fr newsBlue mr10',
|
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:class => 'fr newsGrey mr10',
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete)
|
|
|
|
|
) if reply.destroyable_by?(User.current) %>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<p id="reply_message_<%= reply.id%>"></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<% all_comments = []%>
|
|
|
|
|
<% comments = get_all_children(all_comments, @topic) %>
|
|
|
|
|
<div class="" id="reply_div_<%= @topic.id %>">
|
|
|
|
|
<% comments.each_with_index do |reply,i| %>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
showNormalImage('reply_message_description_<%= reply.id %>');
|
|
|
|
|
autoUrl('reply_message_description_<%= reply.id %>');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
|
|
|
|
<div class="homepagePostReplyPortrait">
|
|
|
|
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="homepagePostReplyDes">
|
|
|
|
|
<div class="homepagePostReplyPublisher">
|
|
|
|
|
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
|
|
|
|
<%= time_from_now(reply.created_on) %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
|
|
|
|
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
|
|
|
|
<%= reply.content.html_safe%>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="orig_reply mb10 mt-10">
|
|
|
|
|
<div class="reply">
|
|
|
|
|
<span class="reply-right">
|
|
|
|
|
<span id="reply_praise_count_<%= reply.id %>">
|
|
|
|
|
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
|
|
|
|
</span>
|
|
|
|
|
<span style="position: relative" class="fr mr20">
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_reply),
|
|
|
|
|
{:action => 'quote', :id => reply},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'get',
|
|
|
|
|
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
|
|
|
</span>
|
|
|
|
|
<%= link_to(
|
|
|
|
|
l(:button_delete),
|
|
|
|
|
{:action => 'destroy', :id => reply},
|
|
|
|
|
:method => :post,
|
|
|
|
|
:class => 'fr mr20',
|
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
|
:title => l(:button_delete)
|
|
|
|
|
) if reply.course_destroyable_by?(User.current) %>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<p id="reply_message_<%= reply.id%>"></p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
|
|
|
|
<div class="talkWrapMsg" nhname="about_talk_reply">
|
|
|
|
|