99 lines
6.1 KiB
Plaintext
99 lines
6.1 KiB
Plaintext
<ul>
|
|
<% comments.each do |comment| %>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
showNormalImage('reply_content_<%= comment.id %>');
|
|
autoUrl('reply_content_<%= 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">
|
|
<div class="homepagePostReplyPublisher">
|
|
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
|
<%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
|
|
</div>
|
|
<% if !comment.parent.nil? %>
|
|
<% parents_rely = [] %>
|
|
<% parents_rely = get_reply_parents parents_rely, comment %>
|
|
<% length = parents_rely.length %>
|
|
<div id="comment_reply_<%=comment.id %>">
|
|
<% if length <= 3 %>
|
|
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
|
|
<% else %>
|
|
<div class="orig_cont clearfix">
|
|
<div class="orig_cont clearfix">
|
|
<div>
|
|
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
|
|
</div>
|
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
|
|
</div>
|
|
<div class="orig_cont_hide clearfix">
|
|
<span class="orig_icon" >↓ </span>
|
|
<span class="orig_icon" style="display:none;" > ↑</span>
|
|
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
|
|
</div>
|
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
<% if !comment.content_detail.blank? || comment.class == Journal %>
|
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
|
<% if comment.class == Journal %>
|
|
<% if comment.details.any? %>
|
|
<% details_to_strings(comment.details).each do |string| %>
|
|
<p><%= string %></p>
|
|
<% end %>
|
|
<% end %>
|
|
<P><%= comment.notes.html_safe %></P>
|
|
<% else %>
|
|
<%= comment.content_detail.html_safe %>
|
|
<% end %>
|
|
</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>
|
|
<% if type == 'HomeworkCommon' %>
|
|
<span style="position: relative" class="fr mr20">
|
|
<%= link_to(
|
|
l(:button_reply),
|
|
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
|
|
:remote => true,
|
|
:method => 'get',
|
|
:title => l(:button_reply)) %>
|
|
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
</span>
|
|
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
|
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
|
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
|
|
<% end %>
|
|
<% elsif type == 'News' %>
|
|
<span style="position: relative" class="fr mr20">
|
|
<%= link_to(
|
|
l(:button_reply),
|
|
{:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
|
:remote => true,
|
|
:method => 'get',
|
|
:title => l(:button_reply)) %>
|
|
<span id="reply_iconup_<%= comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
|
</span>
|
|
<%= link_to('删除', {:controller => 'comments', :action => 'destroy', :id => activity_id, :comment_id => comment, :user_activity_id => user_activity_id},
|
|
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) if News.find(activity_id).author == User.current %>
|
|
<% end %>
|
|
</span>
|
|
<div class="cl"></div>
|
|
</div>
|
|
</div>
|
|
<p id="reply_message_<%= comment.id%>"></p>
|
|
<% end %>
|
|
</div>
|
|
<div class="cl"></div>
|
|
</li>
|
|
<% end %>
|
|
</ul> |