From 4f64859b145f42fc17a50949a8e3227d7a3b7d3a Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 29 Oct 2015 09:11:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E7=9A=84=E4=BA=BA=EF=BC=8Csql=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 175c8ce51..7c41dd038 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -949,7 +949,7 @@ class UsersController < ApplicationController when "current_user" @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10) else - blog_ids = "("+@user.blog.id.to_s+","+User.watched_by(@user.id).map{|u| u.blog.id}.join(',')+")" + blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + @@ -957,7 +957,7 @@ class UsersController < ApplicationController end else # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10) - blog_ids = "("+@user.blog.id.to_s+","+User.watched_by(@user.id).map{|u| u.blog.id}.join(',')+")" + blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + From c3a67a544bc6fc88d3eeeb59aff5202d559e1301 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 29 Oct 2015 09:23:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AFlogo=E4=B8=BA=E7=BA=A2=E8=89=B2trustie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_system.html.erb | 2 +- app/views/users/user_system_messages.html.erb | 2 +- public/images/trustie_logo1.png | Bin 0 -> 121085 bytes 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 public/images/trustie_logo1.png diff --git a/app/views/users/_user_message_system.html.erb b/app/views/users/_user_message_system.html.erb index efbd5d76b..e3037f227 100644 --- a/app/views/users/_user_message_system.html.erb +++ b/app/views/users/_user_message_system.html.erb @@ -2,7 +2,7 @@ <%# @user_system_messages.each do |usm| %> <% end %> + + + <% if ma.course_message_type == "JoinCourse" %> + + <% end %> + + + <% if ma.course_message_type == "RemoveFromCourse" %> + + <% end %> <% end %> \ No newline at end of file