From cd8f3bdea3394e00b6abb18247cb3e7e81ee2184 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Thu, 4 Jun 2015 17:49:53 +0800 Subject: [PATCH 1/5] ... --- app/views/courses/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 0feca0d1b..63285a2cd 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -35,7 +35,7 @@ :class => "problem_tit c_dblue fl fb",'data-type'=>e.event_type, 'data-notify-id'=>(e.respond_to?('get_notify_id') ? e.get_notify_id : ''),:nhname=>"nh_act_link", 'data-href'=>(course_activity_notifys_path(@course)+"/chang_read_flag?an_id="+(e.respond_to?('get_notify_id') ? e.get_notify_id : '').to_s)%> - <%if @controller_name=='ActivityNotifys' && !e.get_notify_is_read%> + <%if @controller_name=='ActivityNotifys' && e.get_notify_is_read!=1%> <%end%>
From d9dd744fb1f20781c23bb5e9aabe0993bfc275d8 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 5 Jun 2015 10:16:16 +0800 Subject: [PATCH 2/5] ... --- app/controllers/messages_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index c3cb3d8c9..b1da35cfc 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -99,7 +99,7 @@ class MessagesController < ApplicationController for teacher in teachers if(teacher.user_id != User.current.id) notify = ActivityNotify.new() - if(@board.course_id>0) + if(@board.course) notify.activity_container_id = @board.course_id notify.activity_container_type = 'Course' else @@ -188,7 +188,7 @@ class MessagesController < ApplicationController notifyto_arr.each do |k,user_id| if(user_id != User.current.id) notify = ActivityNotify.new() - if(@board.course_id>0) + if(@board.course) notify.activity_container_id = @board.course_id notify.activity_container_type = 'Course' else From 8fcf7ac7a815bfed361a1fc617a5dc52802fd14f Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 5 Jun 2015 10:25:42 +0800 Subject: [PATCH 3/5] ... --- app/views/courses/show.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 63285a2cd..60134381f 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -49,6 +49,8 @@ <% end%> <% end%> +<% elsif @controller_name=='ActivityNotifys' %> +

<%= l(:label_no_data) %>

<% end%> <% if @obj_pages.next_page.nil? && @controller_name!='ActivityNotifys' %>
From a456616212ac7c0d964068e62eae1d5701a49715 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 5 Jun 2015 10:33:42 +0800 Subject: [PATCH 4/5] ... --- app/controllers/activity_notifys_controller.rb | 4 +--- app/views/courses/show.html.erb | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/activity_notifys_controller.rb b/app/controllers/activity_notifys_controller.rb index c696836b2..01e4260ea 100644 --- a/app/controllers/activity_notifys_controller.rb +++ b/app/controllers/activity_notifys_controller.rb @@ -15,11 +15,10 @@ class ActivityNotifysController < ApplicationController end if( query != nil ) - logger.info('xxoo') limit = 10; @obj_count = query.count(); @obj_pages = Paginator.new @obj_count,limit,params['page'] - list = query.order('id desc').limit(limit).offset(@obj_pages.offset).all(); + list = query.order('is_read,id desc').limit(limit).offset(@obj_pages.offset).all(); events=[]; for item in list event = item.activity; @@ -29,7 +28,6 @@ class ActivityNotifysController < ApplicationController end @events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)} @controller_name = 'ActivityNotifys' - logger.info('aavv') end respond_to do |format| format.html {render :template => 'courses/show', :layout => 'base_courses'} diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 60134381f..9bbe4ea5a 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -3,7 +3,9 @@ <%= l(:label_activity)%>

与我相关

- + + +
<% else %>

<%= l(:label_activity)%>

From 2e7c6c4afbdd0251a9fca2879f0379f2f02cbcb5 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 5 Jun 2015 11:39:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2725=20:=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=90=9C=E7=B4=A2--=E9=BB=98=E8=AE=A4=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E5=92=8C=E5=A7=93=E5=90=8D=E4=B8=80=E8=B5=B7?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/users_service.rb | 4 +++- app/views/users/search.html.erb | 4 ++-- app/views/welcome/_search_project.html.erb | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/services/users_service.rb b/app/services/users_service.rb index aff0a975c..7e8e775ed 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -255,7 +255,9 @@ class UsersService watcher.push(params[:user_id]) scope = scope.where("id not in (?)",watcher) end - scope = scope.like(params[:name],search_by) + #scope = scope.like(params[:name],search_by) + scope = scope.where("( LOWER(login) LIKE ? or LOWER(concat(lastname, firstname)) LIKE ? or LOWER(mail) LIKE ? )", + "%#{params[:name]}%","%#{params[:name]}%","%#{params[:name]}%") end #modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件 end else diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb index ef1db3b0c..13979f79f 100644 --- a/app/views/users/search.html.erb +++ b/app/views/users/search.html.erb @@ -30,8 +30,8 @@ <%#= hidden_field_tag 'project_type', project_type %>