<%= link_to image_tag(url_to_avatar(comment.author), :width => "45", :height => "45"), user_path(comment.author_id), :alt => "用户头像" %>
From 2538797a5232805fb22707df10c2d062a0db5fef Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 2 Sep 2015 11:51:49 +0800
Subject: [PATCH 7/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=BA=E5=9D=9B?=
=?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_course_message.html.erb | 30 +++++++++---------------
1 file changed, 11 insertions(+), 19 deletions(-)
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index a2ff03dd2..2248b40c3 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -50,16 +50,15 @@
<% count=0 %>
回复(
- <% if activity.parent_id.nil? %>
- <% count=activity.replies_count%>
- <%=count %>
- <% else %>
- <% count=activity.parent.replies_count%>
- <%=count %>
+ <% if activity.parent %>
+ <% count=activity.parent.children.count%>
+ <% else %>
+ <% count=activity.children.count%>
<% end %>
+ <%= count %>
)
<%#=format_date(activity.updated_on)%>
- <%if count>2 %>
+ <%if count > 2 %>
- <% activity= activity.parent_id.nil? ? activity:activity.parent%>
+ <% activity= activity.parent ? activity.parent : activity%>
<% replies_all_i = 0 %>
- <% unless activity.children.empty? %>
+ <% if count > 0 %>
<% 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" %>
<% end %>
<%= 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) %>
-
-
<%= reply.content.html_safe %>
+
+ <%= reply.content.html_safe %>
+