From 90a01c8d84b615abc1daa43e3e402361659499d1 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 9 Dec 2014 15:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E3=80=8A=E6=B7=BB=E5=8A=A0=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=8F=AD=E5=86=85=E6=90=9C=E7=B4=A2=E5=92=8C=E8=AF=BE=E5=86=85?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E3=80=8B=E6=A0=B7=E5=BC=8F=E5=BE=AE=E8=B0=83?= =?UTF-8?q?=20Signed-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 | 6 ++-- app/helpers/courses_helper.rb | 2 +- app/views/courses/_groups_name.html.erb | 36 ------------------------ app/views/courses/_member_list.html.erb | 6 ++-- app/views/courses/member.html.erb | 37 +++++++++++++++++++++++++ config/locales/zh.yml | 2 ++ 6 files changed, 46 insertions(+), 43 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 788237444..326ae0f42 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -207,9 +207,9 @@ class CoursesController < ApplicationController #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? if params[:incourse] @results = searchStudent_by_name(@course, q) - else - group = CourseGroup.find(params[:search_group_id]) - @results = searchgroupstudent_by_name(group, @course, q) + elsif params[:ingroup] + @group = CourseGroup.find(params[:search_group_id]) + @results = searchgroupstudent_by_name(@group, @course, q) end @result_count = @results.count @results = paginateHelper @results diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index bf3810030..a1199a55a 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -184,7 +184,7 @@ module CoursesHelper end members end - def searchgroupstudent_by_name(group, project, q) + def searchgroupstudent_by_name(group, project, name) members = [] group.members.each do |m| if m && m.user && m.user.allowed_to?(:as_student,project) diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 68baa2ccd..ca0fed9c2 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -1,40 +1,4 @@ -