修改《教师列表中不应该有搜索功能》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-06 12:34:02 +08:00
parent b5d007ccf7
commit 03a8d8ccc9
2 changed files with 9 additions and 1 deletions

View File

@ -199,6 +199,7 @@ class CoursesController < ApplicationController
end end
def searchmembers def searchmembers
@subPage_title = l :label_student_list
@render_file = 'member_list' @render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@ -211,6 +212,7 @@ class CoursesController < ApplicationController
end end
def addgroups def addgroups
@subPage_title = l :label_student_list
if params[:group_name] if params[:group_name]
group = CourseGroup.new group = CourseGroup.new
group.name = params[:group_name] group.name = params[:group_name]
@ -225,6 +227,7 @@ class CoursesController < ApplicationController
end end
def updategroupname def updategroupname
@subPage_title = l :label_student_list
if params[:group_name] if params[:group_name]
group = CourseGroup.find(params[:group_id]) group = CourseGroup.find(params[:group_id])
group.name = params[:group_name] group.name = params[:group_name]
@ -237,6 +240,7 @@ class CoursesController < ApplicationController
@course_groups = @course.course_groups @course_groups = @course.course_groups
end end
def join_group def join_group
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id]) group = CourseGroup.find(params[:object_id])
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
member.course_group_id = group.id member.course_group_id = group.id
@ -248,6 +252,7 @@ class CoursesController < ApplicationController
search_group_members group search_group_members group
end end
def unjoin_group def unjoin_group
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id]) group = CourseGroup.find(params[:object_id])
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
member.course_group_id = 0 member.course_group_id = 0
@ -259,6 +264,7 @@ class CoursesController < ApplicationController
search_group_members group search_group_members group
end end
def searchgroupmembers def searchgroupmembers
@subPage_title = l :label_student_list
@render_file = 'member_list' @render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true
@ -273,6 +279,7 @@ class CoursesController < ApplicationController
@results = paginateHelper @results @results = paginateHelper @results
end end
def search_group_members group def search_group_members group
@subPage_title = l :label_student_list
@render_file = 'member_list' @render_file = 'member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true @is_remote = true

View File

@ -5,12 +5,13 @@
<% end %>&nbsp;&nbsp;&nbsp; <% end %>&nbsp;&nbsp;&nbsp;
<span style="font-size: 18px; float: left; margin-right: 35px"><%= l(:label_current_group)%>:&nbsp;<%= @group.name %></span> <span style="font-size: 18px; float: left; margin-right: 35px"><%= l(:label_current_group)%>:&nbsp;<%= @group.name %></span>
<% end %> <% 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 %> <%= 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"%> <%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%>
<%= submit_tag l(:label_search), :class => "f_2"%> <%= submit_tag l(:label_search), :class => "f_2"%>
<%#= link_to l(:label_search),'' , :class => 'f_2' %> <%#= link_to l(:label_search),'' , :class => 'f_2' %>
<% end %> <% end %>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% if members.any? %> <% if members.any? %>