From 4f64859b145f42fc17a50949a8e3227d7a3b7d3a Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 29 Oct 2015 09:11:13 +0800 Subject: [PATCH 1/5] =?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/5] =?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 From 958d7819974b533e3dd5c300d124fed8c3b1a9ae Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 29 Oct 2015 10:43:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/public.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d03ee1a74..0be7a6ff0 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -12,7 +12,7 @@ textarea {resize: none;} .pInline {margin:0px; padding:0px; display:inline-block;} /*常用*/ -select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px;padding-right: 5px; } +select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px} .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; margin-bottom:10px; background:#dbdbdb;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} table{ background:#fff;}