From 0994ae9f07eabe64787e43815aa49662962520fa Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 1 Sep 2015 15:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/messages/reply.js.erb | 7 +++-- app/views/users/_project_message.html.erb | 33 ++++++++++++----------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb index b1a18a8af..9d3d68855 100644 --- a/app/views/messages/reply.js.erb +++ b/app/views/messages/reply.js.erb @@ -1,3 +1,6 @@ -$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); - +<%if @project%> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); +<%elsif @course%> + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>"); +<%end%> init_KindEditor_data(<%= @user_activity_id%>); \ No newline at end of file diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index af6233d82..825820cc7 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> @@ -26,14 +26,14 @@
时间:<%= format_date(activity.created_on) %>
-
帖子描述: +
帖子描述: <% if activity.parent_id.nil? %> <%= activity.content.to_s.html_safe%> <% else %> <%= activity.parent.content.to_s.html_safe%> <% end %>
- - +
+ <% activity= activity.parent_id.nil? ? activity : activity.parent %> <% replies_all_i = 0 %> <% unless activity.children.empty? %> -
+
    <% activity.children.reorder("created_on desc").each do |reply| %> <% replies_all_i=replies_all_i+1 %>