From f785fe4fbd4fb07814054bea899b61f9cf38c7fa Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 21 Oct 2016 19:14:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 7 ++++++- app/views/boards/_course_show.html.erb | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 56176119c..35c75e641 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -564,7 +564,12 @@ class CoursesController < ApplicationController #添加成员消息状态 join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0) join_course_messages.update_all(:viewed => true) - @tab = params[:tab].to_i || 0 + + if params[:tab] && params[:tab] == 'boards' + @tab = 4 + else + @tab = 0 + end if User.current.allowed_to?(:as_teacher,@course) @select_tab = params[:tab] @issue_custom_fields = IssueCustomField.sorted.all diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 9b63dcc88..fba62df87 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -27,7 +27,7 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@board.course)) %> <% if is_teacher %> - <%= link_to "添加子栏目", settings_course_path(@board.course.id,4), :class => "link-blue fr mt5" %> + <%= link_to "添加子栏目", settings_course_path(@board.course.id,'boards'), :class => "link-blue fr mt5" %> <% end %>
From 5811f3944e42c10e16c2258d5a36211fed57d3e2 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 21 Oct 2016 19:25:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=8F=E7=8F=AD=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=88=97=E8=A1=A8500BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 35c75e641..9464f96b9 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -473,7 +473,7 @@ class CoursesController < ApplicationController if params[:group_id] group = CourseGroup.find params[:group_id] unless group.nil? - @all_members = student_homework_score(@group.id,0,0,"desc") + @all_members = student_homework_score(group.id,0,0,"desc") end else @all_members = student_homework_score(0,0,0,"desc")