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 %>