From 3de8687440d825a19086bdf5581298ba2c8ed9ee Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Jan 2016 20:11:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=86=85=E5=AE=B9=E4=B8=8D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=8C=E7=95=99=E8=A8=80=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 1 + app/views/users/_user_activities.html.erb | 2 +- .../users/_user_journalsformessage.html.erb | 26 +++++++++++++------ app/views/users/_user_jours_list.html.erb | 2 +- app/views/words/create_reply.js.erb | 4 +-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 8115f3f91..d24427a9d 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -76,6 +76,7 @@ class WordsController < ApplicationController @reply_type = params[:reply_type] @user_activity_id = params[:user_activity_id] @activity = JournalsForMessage.find(parent_id) + @is_activity = params[:is_activity] } end diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 62752bdf5..d4169bc47 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -111,7 +111,7 @@ <% case user_activity.act_type.to_s %> <% when 'JournalsForMessage' %> <% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %> - <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id} %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>true} %> <% end %> <% end %> <% end %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 609b1e35b..70cce2374 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -16,13 +16,22 @@ <% end %> <% end %> -
- <% if activity.parent %> - <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> - <% else %> - <%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> - <% end %> -
+ <% if is_activity %> +
+ <% if activity.parent %> + <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> + <% else %> + <%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> + <% end %> +
+ <% else %> + <% if activity.parent %> + <% content = activity.parent.notes %> + <% else %> + <% content = activity.notes %> + <% end %> + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> + <% end %>
留言时间:<%= format_time(activity.created_on) %>
@@ -85,10 +94,10 @@
<%= comment.notes.html_safe %>
- <% end %>
+ <% end %> <% end %> @@ -104,6 +113,7 @@ <%= hidden_field_tag 'show_name',params[:show_name],:value =>true %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %> <%= hidden_field_tag 'reply_type',params[:reply_type],:value =>'user' %> + <%= hidden_field_tag 'is_activity',params[:is_activity],:value =>is_activity %>
diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb index cc5a589b5..6993a7e91 100644 --- a/app/views/users/_user_jours_list.html.erb +++ b/app/views/users/_user_jours_list.html.erb @@ -22,7 +22,7 @@ init_activity_KindEditor_data(<%= jour.id%>, null, "87%", "<%=jour.class.to_s%>"); }); - <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %> + <%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id,:is_activity=>false} %> <%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %> <% end %> <%end%> diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index ac56b69fc..8d6674845 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,9 +1,9 @@ <% if @save_succ %> <% if @user_activity_id %> <% if @reply_type == 'user' %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>"); + $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>"); <% end %> init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity"); <% else %>