From 78d8a0a1c6fcf8d47729b1d18ea59e7b44ba70bb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 2 Feb 2015 09:09:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=8A=98=E5=8F=A0=E5=90=8E=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E4=B8=BA=E9=80=8F=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_feedback.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index 2039735bc..c4479b43a 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -8,7 +8,7 @@ html{ overflow-x:hidden;} .custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;} -.scrollsidebar{position:absolute; z-index:999; top:150px;} +.scrollsidebar{position:absolute; z-index:999; top:150px;background:none !important;} .side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content .side_list {width:154px;overflow:hidden;} .show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;} From 858b5ea97c2bb896d09c515003b2d406381b90a2 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 2 Feb 2015 11:00:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E8=AE=A8?= =?UTF-8?q?=E8=AE=BA=E5=90=A7=E5=8F=91=E5=B8=96=E5=8F=91=E9=80=81=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=E3=80=8B=20Signed?= =?UTF-8?q?-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/forum.rb | 2 +- app/models/mailer.rb | 14 ++++++++------ app/models/memo.rb | 2 +- config/application.rb | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/models/forum.rb b/app/models/forum.rb index e47d18b02..baa8e6260 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -23,7 +23,7 @@ class Forum < ActiveRecord::Base acts_as_taggable scope :by_join_date, order("created_at DESC") - after_create :send_email + #after_create :send_email def reset_counters! self.class.reset_counters!(id) end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index f42c20acc..ffd5e87be 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -50,10 +50,15 @@ class Mailer < ActionMailer::Base @forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id) @issue_author_url = url_for(user_activities_url(@author)) recipients ||= [] - mems = memo.self_and_siblings - mems.each do |mem| - recipients << mem.author.mail unless recipients.include? mem.author.mail + if !memo.parent_id.nil? + mems = memo.self_and_siblings + mems.each do |mem| + recipients << mem.author.mail unless recipients.include? mem.author.mail + end + else + recipients << memo.author.mail end + recipients << @author.mail unless recipients.include? @author.mail # cc = wiki_content.page.wiki.watcher_recipients - recipients @memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))) @@ -98,10 +103,7 @@ class Mailer < ActionMailer::Base #收件人邮箱 @recipients ||= [] @members.each do |teacher| - @recipients << teacher.user.mail - - end mail :to => @recipients, :subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} " diff --git a/app/models/memo.rb b/app/models/memo.rb index 165f8e144..7d463c28b 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -47,7 +47,7 @@ class Memo < ActiveRecord::Base "parent_id", "replies_count" - after_create :add_author_as_watcher, :reset_counters!, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分 + after_create :add_author_as_watcher, :reset_counters! #, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分 # after_update :update_memos_forum after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分 # after_create :send_notification diff --git a/config/application.rb b/config/application.rb index c7f2f3ea5..000250a61 100644 --- a/config/application.rb +++ b/config/application.rb @@ -39,7 +39,8 @@ module RedmineApp # config.plugins = [ :exception_notification, :ssl_requirement, :all ] # Activate observers that should always be running. - config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, :document_observer, :wiki_content_observer, :comment_observer + config.active_record.observers = :journals_for_message_observer, :message_observer, :issue_observer, :journal_observer, :news_observer, + :document_observer, :wiki_content_observer, :comment_observer, :forum_observer, :memo_observer config.active_record.store_full_sti_class = true config.active_record.default_timezone = :local From 646678c9db4278ae42d717bd3d4608d6ecd47e6a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 2 Feb 2015 17:01:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B--=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8=EF=BC=9A?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=9C=89=E6=95=88=E6=9D=A1=E4=BB=B6=E8=8E=B7?= =?UTF-8?q?=E5=BE=97=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=8C=89=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=8D=B4=E8=87=AA=E5=8A=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AF=B9=E6=89=80=E6=9C=89=E5=AD=A6=E7=94=9F=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E3=80=8Bbug=20Signed-off-by:=20alan=20<547533434@qq.c?= =?UTF-8?q?om>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 35 ++++++++++++++++++------- app/views/courses/_member_list.html.erb | 2 +- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 7653be94d..61944ca2c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -254,8 +254,8 @@ class CoursesController < ApplicationController end @is_remote = true @result_count = @results.count - @results = paginateHelper @results - + @results = paginateHelper @results, 10 + @search_name = q end def addgroups @@ -428,17 +428,34 @@ class CoursesController < ApplicationController # @results = paginateHelper @results@score_sort_by = "desc" @is_remote = true @score_sort_by = params[:sort_by] if params[:sort_by] + @search_name = params[:search_name] if params[:search_name] group_id = params[:group_id] - if group_id == '0' - page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = student_homework_score(0,page, 10,@score_sort_by) + if !@search_name.nil? + if group_id == '0' + page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = paginateHelper_for_members @results, 10 + @results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name) + @result_count = @results.count + @results = paginateHelper @results, 10 + else + @group = CourseGroup.find(group_id) + @results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name) + @result_count = @results.count + @results = paginateHelper @results, 10 + end else - @group = CourseGroup.find(group_id) - @results = student_homework_score(group_id, 0, 0,@score_sort_by) - @results = paginateHelper @results, 10 + if group_id == '0' + page = params[:page].nil? ? 0 : (params['page'].to_i - 1) + @results = student_homework_score(0,page, 10,@score_sort_by) + + @results = paginateHelper_for_members @results, 10 + else + @group = CourseGroup.find(group_id) + @results = student_homework_score(group_id, 0, 0,@score_sort_by) + @results = paginateHelper @results, 10 + end end + end # 显示每个学生的作业评分详情 def show_member_score diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index dd543ec2c..11bfd9f81 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -25,7 +25,7 @@