From aa1cbcdf878dfb7d01371d33a8e4cf4a37bb67d9 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 22 Mar 2016 16:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=95=99=E8=A8=80=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=8A=A0=E5=85=A5=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 +++- app/views/users/_user_activities.html.erb | 4 +++- app/views/users/show.html.erb | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9039fd041..52a610bc5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1223,7 +1223,7 @@ class UsersController < ApplicationController @page = params[:page] ? params[:page].to_i + 1 : 0 user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")" - course_types = "('Message','News','HomeworkCommon','Poll','Course')" + course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" project_types = "('Message','Issue','ProjectCreateInfo')" principal_types = "JournalsForMessage" if params[:type].present? @@ -1236,6 +1236,8 @@ class UsersController < ApplicationController @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) when "course_poll" @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10) + when "course_journals" + @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10) when "project_issue" @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10) when "project_message" diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index eb73f9226..83d2527cf 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -69,7 +69,9 @@ <% when 'Poll' %> <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %> <% when 'Course'%> - <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %> + <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %> + <% when 'JournalsForMessage'%> + <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %> <% end %> <% end %> <% when 'Project' %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index fa4eaacbe..2fe9ab079 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -14,6 +14,7 @@
  • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
  • <%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%> +
  • <%= link_to "课程留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> @@ -30,7 +31,7 @@