From 3092121a7a05fd89ac2b3b00f28f07f2026c470a Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 19 Jun 2015 11:42:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?bug#2878:=E5=85=AC=E5=85=B1=E8=B4=B4?= =?UTF-8?q?=E5=90=A7=EF=BC=9A=E7=BC=96=E8=BE=91=E5=B8=96=E5=AD=90=E3=80=81?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=9B=9E=E5=B8=96=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA=E4=B8=BB?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- app/views/memos/edit.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 54bcc0496..68f6f6473 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -157,7 +157,7 @@ class MemosController < ApplicationController def update respond_to do |format| - if( @memo.update_column(:subject, params[:memo][:subject]) && + if( #@memo.update_column(:subject, params[:memo][:subject]) && @memo.update_column(:content, params[:memo][:content]) && @memo.update_column(:sticky, params[:memo][:sticky]) && @memo.update_column(:lock, params[:memo][:lock])) diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index b7aa08abd..6328edcac 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -21,9 +21,9 @@

<% if @memo.parent.nil? && @memo.children.first.nil? %> - <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => false, :maxlength => 50%> + <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => false, :maxlength => 50%> <% else %> - <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => true, :style => "border: 1px solid gray", :maxlength => 50%> + <%#= f.text_field :subject, :required => true, :size => 96 ,:readonly => true, :style => "border: 1px solid gray", :maxlength => 50%> <% end %>

<% if User.current.admin?%> From 0a7a834ebe765b6ce43410a301d487cd523a744a Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 19 Jun 2015 13:59:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE--=E7=89=88=E6=9C=AC=E5=BA=93--=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=20404=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- .../settings/_new_repositories.html.erb | 3 +-- .../projects/settings/_repositories.html.erb | 26 ++++++------------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d0af82c8c..ffa3fb4aa 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -227,7 +227,7 @@ update elsif request.get? respond_to do |format| format.html{ - render :layout => "project_base" + render :layout => "base_projects" } end diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb index 6e0d74849..ca771a487 100644 --- a/app/views/projects/settings/_new_repositories.html.erb +++ b/app/views/projects/settings/_new_repositories.html.erb @@ -33,8 +33,7 @@ <% if repository.scm_name=="Git"%> <%if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to(l(:label_user_plural), committers_repository_path(repository) - ) %> + <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %> <% end %> <% end %> diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index 3d9d71a56..6c340f47c 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -27,25 +27,15 @@ <% end %> - <% if repository.scm_name=="Subversion"%> - <%if User.current.allowed_to?(:manage_repository, @project) %> - <%= link_to(l(:label_user_plural), committers_repository_path(repository), - :class => 'icon icon-user') %> - <%= link_to(l(:button_edit), edit_repository_path(repository), - :class => 'icon icon-edit') %> - <%= delete_link repository_path(repository) %> - <% end %> - <% elsif repository.scm_name=="Git"%> - <%if User.current.allowed_to?(:manage_repository, @project) %> - - <%= link_to(l(:label_user_plural), committers_repository_path(repository), - :class => 'icon icon-user') %> - <% if repository.login.to_s==User.current.login.to_s %> - <%= delete_link repository_path(repository) %> - <% end %> - <% end %> - <% end %> + <%= link_to(l(:label_user_plural), committers_repository_path(repository), :class => 'icon icon-user') %> + <% if repository.login.to_s==User.current.login.to_s %> + <%= delete_link repository_path(repository) %> + <% end %> + <% end %> <% end %> From fa3b216e0f1ad020e0f1384523fe7f15e5cfeed4 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Fri, 19 Jun 2015 14:02:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B2=8C=E4=BC=BC=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=B8=8D=E4=BC=9A=E6=9B=B4=E6=96=B0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=20=E8=BF=98=E6=98=AF=E5=85=88=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 524bde9d7..210ac8f3d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -695,12 +695,13 @@ class CoursesController < ApplicationController # 显示老师和助教的活动 # @authors = searchTeacherAndAssistant(@course) @authors = course_all_member(@course) - Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require file } + #TODO 貌似删除操作不会更新缓存 还是先不用缓存吧 + # Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require file } events = [] - key = "course_events_#{@course.id}".to_sym - if Rails.env.production? && Setting.course_cahce_enabled? - events = Rails.cache.read(key) || [] - end + # key = "course_events_#{@course.id}".to_sym + # if Rails.env.production? && Setting.course_cahce_enabled? + # events = Rails.cache.read(key) || [] + # end if events.empty? @authors.each do |author| @activity = Redmine::Activity::Fetcher.new(User.current, :course => @course, @@ -716,7 +717,7 @@ class CoursesController < ApplicationController events += @activity.events(@days, @course.created_at, :is_public => 1) end end - Rails.cache.write(key, events) if Rails.env.production? && Setting.course_cahce_enabled? + # Rails.cache.write(key, events) if Rails.env.production? && Setting.course_cahce_enabled? end else # @author = @course.teacher From e05a66e8fdd29abc39e93bf84a28bd811449408f Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 19 Jun 2015 14:10:08 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E7=9C=8B=E4=BF=AE=E8=AE=A2404=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ffa3fb4aa..607c9b5db 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -376,7 +376,7 @@ update def revision respond_to do |format| - format.html{render :layout => 'project_base'} + format.html{render :layout => 'base_projects'} format.js {render :layout => false} end end