增加《分班查询》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-26 17:31:01 +08:00
parent 6192a36481
commit 329be27567
5 changed files with 36 additions and 31 deletions

View File

@ -218,7 +218,7 @@ class CoursesController < ApplicationController
@group = CourseGroup.find(params[:search_group_id]) @group = CourseGroup.find(params[:search_group_id])
@results =searchgroupmember_by_name(student_homework_score, @group, q) @results =searchgroupmember_by_name(student_homework_score, @group, q)
end end
@is_remote = true
@result_count = @results.count @result_count = @results.count
@results = paginateHelper @results @results = paginateHelper @results
@ -313,7 +313,7 @@ class CoursesController < ApplicationController
else else
@results = student_homework_score @results = student_homework_score
end end
@@result = @results
@members = searchStudent(@course) @members = searchStudent(@course)
@membercount = @members.count @membercount = @members.count
@ -328,6 +328,7 @@ class CoursesController < ApplicationController
@teachers= searchTeacherAndAssistant(@course) @teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@role = params[:role] @role = params[:role]
@is_remote = false
@course_groups = @course.course_groups if @course.course_groups @course_groups = @course.course_groups if @course.course_groups
@show_serch = params[:role] == '2' @show_serch = params[:role] == '2'
case params[:role] case params[:role]
@ -346,7 +347,7 @@ class CoursesController < ApplicationController
@subPage_title = '' @subPage_title = ''
@members = @course.member_principals.includes(:roles, :principal).all.sort @members = @course.member_principals.includes(:roles, :principal).all.sort
end end
@@result = @members
@members = paginateHelper @members @members = paginateHelper @members
render :layout => 'base_courses' render :layout => 'base_courses'
else else
@ -356,19 +357,19 @@ class CoursesController < ApplicationController
end end
def member_score_sort def member_score_sort
@teachers= searchTeacherAndAssistant(@course) # @teachers= searchTeacherAndAssistant(@course)
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' # @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@role = params[:role] # @role = params[:role]
@course_groups = @course.course_groups if @course.course_groups # @course_groups = @course.course_groups if @course.course_groups
@show_serch = params[:role] == '2' # @show_serch = params[:role] == '2'
@subPage_title = l :label_student_list # @subPage_title = l :label_student_list
@render_file = 'member_list' # @render_file = 'member_list'
# @results = params[:result] if params[:result]
unless @@result.nil? # unless @result.nil?
@results = @@result.reverse # @results = @result.reverse
@@result = @results #
end # end
@results = paginateHelper @results # @results = paginateHelper @results
end end
# 显示每个学生的作业评分详情 # 显示每个学生的作业评分详情
def show_member_score def show_member_score

View File

@ -3,9 +3,11 @@
var classname = document.getElementById(id).className var classname = document.getElementById(id).className
if(classname == 'st_up') { if(classname == 'st_up') {
document.getElementById(id).className = 'st_down' document.getElementById(id).className = 'st_down'
} }
else else
document.getElementById(id).className = 'st_up' document.getElementById(id).className = 'st_up'
} }
</script> </script>
<div style="margin-left: 15px" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> <div style="margin-left: 15px" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
@ -34,7 +36,7 @@
<div class="st_box"> <div class="st_box">
<ul class="st_box_top" style="margin-left: 17px;"> <ul class="st_box_top" style="margin-left: 17px;">
<% if @subPage_title == l(:label_student_list) %> <% if @subPage_title == l(:label_student_list) %>
<li class="ml358"><%= link_to '作业积分', member_score_sort_course_path ,method: 'get', remote: true, :onclick => "change_pic('pic')"%> <li class="ml358"><%= link_to '作业积分', member_score_sort_course_path ,:result => members,method: 'get', remote: true, :onclick => "change_pic('pic')"%>
<a id="pic" href="#" class="st_down"></a> <a id="pic" href="#" class="st_down"></a>
</li> </li>
<li class="ml50"> <li class="ml50">
@ -101,7 +103,7 @@
</div> </div>
</div> </div>
<div class="pagination"> <div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :remote =>true, :per_page_links => false %> <%= pagination_links_full @obj_pages, @obj_count,:per_page_links => false, :remote =>@is_remote %>
</div> </div>
<% else %> <% else %>
<p class="nodata"> <p class="nodata">

View File

@ -0,0 +1,11 @@
<% if @subPage_title && @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; float: left;"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member), :name => "ingroup",:class => "f_2", :style => "float: left "%>
<% else %>
<%= submit_tag l(:label_search_member),:style => "float: left", :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<% end %>
<% end %>
<% end %>

View File

@ -59,18 +59,8 @@
<div class="st_list"> <div class="st_list">
<div class="st_search" style="margin-left: 14px" > <div class="st_search" style="margin-left: 14px" >
<span class="f_l"><%= @subPage_title %></span> <span class="f_l"><%= @subPage_title %></span>
<span> <span id = "search_members">
<% if @subPage_title && @subPage_title == l(:label_student_list)%> <%= render :partial => 'searchmembers' %>
<%= 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; float: left;"%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<%= submit_tag l(:label_search_member), :name => "ingroup",:class => "f_2", :style => "float: left "%>
<% else %>
<%= submit_tag l(:label_search_member),:style => "float: left", :name => 'incourse',:onclick => "checkclass('group_name_0')",:class => "f_2"%>
<% end %>
<% end %>
<% end %>
</span> </span>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,5 @@
/** /**
* Created by Administrator on 2014/12/3. * Created by Administrator on 2014/12/3.
*/ */
$("#search_members").html("<%= escape_javascript( render :partial => 'searchmembers')%>");
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>"); $("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");