课程论坛回复刷新

This commit is contained in:
sw 2015-09-02 11:51:49 +08:00
parent bbf4478fc0
commit 2538797a52
1 changed files with 11 additions and 19 deletions

View File

@ -50,16 +50,15 @@
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<% count=0 %> <% count=0 %>
<div class="homepagePostReplyBannerCount">回复( <div class="homepagePostReplyBannerCount">回复(
<% if activity.parent_id.nil? %> <% if activity.parent %>
<% count=activity.replies_count%> <% count=activity.parent.children.count%>
<%=count %> <% else %>
<% else %> <% count=activity.children.count%>
<% count=activity.parent.replies_count%>
<%=count %>
<% end %> <% end %>
<%= count %>
)</div> )</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>2 %> <%if count > 2 %>
<div class="homepagePostReplyBannerMore"> <div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" > <a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
点击展开更多回复(<%= count.to_s%>) 点击展开更多回复(<%= count.to_s%>)
@ -83,9 +82,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% activity= activity.parent_id.nil? ? activity:activity.parent%> <% activity= activity.parent ? activity.parent : activity%>
<% replies_all_i = 0 %> <% replies_all_i = 0 %>
<% unless activity.children.empty? %> <% if count > 0 %>
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>"> <div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
<ul> <ul>
<% activity.children.reorder("created_on desc").each do |reply|%> <% activity.children.reorder("created_on desc").each do |reply|%>
@ -102,17 +101,10 @@
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_date(reply.created_on) %> <%= format_date(reply.created_on) %>
<%#= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => 'replyGrey fr ml10'
) if reply.course_destroyable_by?(User.current) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div> </div>
<div class="homepagePostReplyContent break_word"><%= reply.content.html_safe %></div> <div class="homepagePostReplyContent break_word">
<%= reply.content.html_safe %>
</div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>