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

View File

@ -3,9 +3,11 @@
var classname = document.getElementById(id).className
if(classname == 'st_up') {
document.getElementById(id).className = 'st_down'
}
else
document.getElementById(id).className = 'st_up'
}
</script>
<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">
<ul class="st_box_top" style="margin-left: 17px;">
<% 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>
</li>
<li class="ml50">
@ -101,7 +103,7 @@
</div>
</div>
<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>
<% else %>
<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

@ -57,20 +57,10 @@
<%= stylesheet_link_tag 'course_group', :media => 'all' %>
<script type="text/javascript" src="javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
<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>
<% 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 %>
<span id = "search_members">
<%= render :partial => 'searchmembers' %>
</span>
</div>
<div class="cl"></div>

View File

@ -1,4 +1,5 @@
/**
* 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})%>");