From 03a8d8ccc918e784d92aa12cdb62d4cc563571c6 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 6 Dec 2014 12:34:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=95=99?= =?UTF-8?q?=E5=B8=88=E5=88=97=E8=A1=A8=E4=B8=AD=E4=B8=8D=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=9C=89=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=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/controllers/courses_controller.rb | 7 +++++++ app/views/courses/_member_list.html.erb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index f83a5657f..8eab83fef 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -199,6 +199,7 @@ class CoursesController < ApplicationController end def searchmembers + @subPage_title = l :label_student_list @render_file = 'member_list' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true @@ -211,6 +212,7 @@ class CoursesController < ApplicationController end def addgroups + @subPage_title = l :label_student_list if params[:group_name] group = CourseGroup.new group.name = params[:group_name] @@ -225,6 +227,7 @@ class CoursesController < ApplicationController end def updategroupname + @subPage_title = l :label_student_list if params[:group_name] group = CourseGroup.find(params[:group_id]) group.name = params[:group_name] @@ -237,6 +240,7 @@ class CoursesController < ApplicationController @course_groups = @course.course_groups end def join_group + @subPage_title = l :label_student_list group = CourseGroup.find(params[:object_id]) member = Member.where(:course_id => @course.id, :user_id => User.current.id).first member.course_group_id = group.id @@ -248,6 +252,7 @@ class CoursesController < ApplicationController search_group_members group end def unjoin_group + @subPage_title = l :label_student_list group = CourseGroup.find(params[:object_id]) member = Member.where(:course_id => @course.id, :user_id => User.current.id).first member.course_group_id = 0 @@ -259,6 +264,7 @@ class CoursesController < ApplicationController search_group_members group end def searchgroupmembers + @subPage_title = l :label_student_list @render_file = 'member_list' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true @@ -273,6 +279,7 @@ class CoursesController < ApplicationController @results = paginateHelper @results end def search_group_members group + @subPage_title = l :label_student_list @render_file = 'member_list' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index 6de228fd2..b7a3926f8 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -5,12 +5,13 @@ <% end %> <%= l(:label_current_group)%>: <%= @group.name %> <% end %> + <% if @subPage_title == l(:label_student_list) %> <%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%> <%= submit_tag l(:label_search), :class => "f_2"%> <%#= link_to l(:label_search),'' , :class => 'f_2' %> <% end %> - + <% end %>
<% if members.any? %> From 19936fa05fe3046ac834899006d4e0036cb7acac Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 6 Dec 2014 13:32:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96=E6=97=B6=E5=88=86?= =?UTF-8?q?=E7=8F=AD=E4=BA=BA=E6=95=B0=E4=B8=8D=E5=AF=B9=E3=80=8Bbug=20Sig?= =?UTF-8?q?ned-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/members_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index fa19a1a3d..867c2a302 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -217,6 +217,7 @@ class MembersController < ApplicationController joined.each do |join| join.delete end + @member.course_group_id = 0 end if role.allowed_to?(:is_manager) @courseInfo = CourseInfos.new(:user_id => @member.user_id, :course_id => @course.id)