From 9f807438d6bbc3ee035b0f396d625327fb1756a1 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 12 Jan 2015 14:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=95=B0=E7=9B=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=9A-1=20=EF=BC=8C=E5=90=8C=E6=97=B6=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=A4=A7=E9=87=8F=E4=B8=8D=E6=98=BE=E7=A4=BA=E3=80=82?= =?UTF-8?q?=E6=98=AF=E4=B8=8D=E6=98=AF=E5=8F=AA=E6=98=BE=E7=A4=BA=E8=BF=91?= =?UTF-8?q?=E6=9C=9F3=E4=B8=AA=E6=9C=88=E7=9A=84=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: alan <547533434@qq.com> --- Gemfile | 24 +++++++++---------- app/controllers/courses_controller.rb | 4 ++-- app/controllers/projects_controller.rb | 8 +++---- app/views/welcome/_search_course.html.erb | 2 +- app/views/welcome/_search_project.html.erb | 2 +- .../20150112024820_add_data_for_members.rb | 10 ++++++++ db/schema.rb | 2 +- .../lib/acts_as_activity_provider.rb | 16 +++++++++---- lib/redmine/activity/fetcher.rb | 4 ++-- 9 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 db/migrate/20150112024820_add_data_for_members.rb diff --git a/Gemfile b/Gemfile index 6bb141404..6c2101345 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source 'http://ruby.taobao.org' +source 'http://rubygems.org' #source 'http://ruby.sdutlinux.org/' unless RUBY_PLATFORM =~ /w32/ @@ -33,21 +33,21 @@ group :test do gem 'selenium-webdriver', '~> 2.42.0' - platforms :mri, :mingw do - group :rmagick do - # RMagick 2 supports ruby 1.9 - # RMagick 1 would be fine for ruby 1.8 but Bundler does not support - # different requirements for the same gem on different platforms - gem "rmagick", ">= 2.0.0" - end - end + # platforms :mri, :mingw do + # group :rmagick do + # # RMagick 2 supports ruby 1.9 + # # RMagick 1 would be fine for ruby 1.8 but Bundler does not support + # # different requirements for the same gem on different platforms + # gem "rmagick", ">= 2.0.0" + # end + #end end group :development, :test do - gem "guard-rails", '~> 0.5.3' + # gem "guard-rails", '~> 0.5.3' gem 'spork-testunit', '~> 0.0.8' - gem 'guard-spork', '~> 1.5.1' - gem 'guard-test', '~> 1.0.0' + # gem 'guard-spork', '~> 1.5.1' + # gem 'guard-test', '~> 1.0.0' gem 'ruby-prof', '~> 0.15.1' unless RUBY_PLATFORM =~ /w32/ gem 'pry' gem 'pry-nav' diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e76fa31dc..9d35b9fb0 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -810,9 +810,9 @@ class CoursesController < ApplicationController # modify by nwb # 添加私密性判断 if User.current.member_of_course?(@course)|| User.current.admin? - events = @activity.events(@date_from, @date_to) + events = @activity.events(@days, @course.created_at) else - events = @activity.events(@date_from, @date_to, :is_public => 1) + events = @activity.events(@days, @course.created_at, :is_public => 1) end # 无新动态时,显示老动态 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0b7cbbb5f..5d43a4e20 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -597,8 +597,8 @@ class ProjectsController < ApplicationController "show_wiki_edits"=>true, "show_journals_for_messages" => true } - @date_to ||= Date.today + 1 - @date_from = @date_to - @days-1.years + + @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') @author = (params[:user_id].blank? ? nil : User.active.find(params[:user_id])) # 决定显示所用用户或单个用户活动 @@ -612,9 +612,9 @@ class ProjectsController < ApplicationController # modify by nwb # 添加私密性判断 if User.current.member_of?(@project)|| User.current.admin? - events = @activity.events(@date_from, @date_to) + events = @activity.events(@days) else - events = @activity.events(@date_from, @date_to, :is_public => 1) + events = @activity.events(@days,nil, :is_public => 1) end @offset, @limit = api_offset_and_limit({:limit => 10}) diff --git a/app/views/welcome/_search_course.html.erb b/app/views/welcome/_search_course.html.erb index 5721af9fb..895f696fb 100644 --- a/app/views/welcome/_search_course.html.erb +++ b/app/views/welcome/_search_course.html.erb @@ -49,7 +49,7 @@ form #search_type{ <%= form_tag({controller: :welcome, action: :search }, method: :get) do %>