- <%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
- <%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生姓名、学号进行搜索'%>
- <% if @group %>
- <%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
-
- <% else %>
-
- <% end %>
- <% end %>
-
搜索
- <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
+
+ <%= render :partial => 'searchmembers' %>
-
+
<%= render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups} %>
diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb
index bf88ce340..60c10dff6 100644
--- a/app/views/courses/_member_list.html.erb
+++ b/app/views/courses/_member_list.html.erb
@@ -23,7 +23,8 @@
<% if @subPage_title == l(:label_student_list) %>
- - <%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
+
-
+ <%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<% else %>
diff --git a/app/views/courses/_new_groups_name.html.erb b/app/views/courses/_new_groups_name.html.erb
index 5de5b0b11..da599ef5a 100644
--- a/app/views/courses/_new_groups_name.html.erb
+++ b/app/views/courses/_new_groups_name.html.erb
@@ -1,7 +1,7 @@
- 分班:
- -
- <%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('group_name_0')", method: 'get', remote: true%>
+
-
+ <%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
<% unless course_groups.nil? %>
@@ -10,27 +10,31 @@
-
<%= link_to group_name, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%>
<% if @canShowCode%>
- <%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
- :data => {confirm: l(:label_delete_group)},
- :class => 'f_1',
- :style => "width: 11px;height: 16px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
- %>
- <% else%>
-
-
+ <% if group.members.empty?%>
+ <%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
+ :data => {confirm: l(:label_delete_group)},
+ :class => 'f_1',
+ :style => "width: 11px;height: 16px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
+ %>
+ <% else%>
+
+
+
+ <% end%>
+
+
<% end %>
-
-
-
-
- <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>
-
-
-
-
+ <% if @canShowCode%>
+ <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %>
+
+
+
+
+ <% end %>
<% end %>
<% end %>
@@ -42,9 +46,9 @@
-
- <%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true) do %>
+ <%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
-
+
<% end %>
diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb
index 8fb399037..e7d282256 100644
--- a/app/views/courses/_new_member_list.html.erb
+++ b/app/views/courses/_new_member_list.html.erb
@@ -24,7 +24,14 @@
- 姓名
- 学号
- - 作业积分
+ -
+ <%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
+ <% if @score_sort_by == 'desc' %>
+
+ <% else %>
+
+ <% end %>
+
- 加入时间
diff --git a/app/views/courses/_searchmembers.html.erb b/app/views/courses/_searchmembers.html.erb
index 71bacd02e..c6b577c8d 100644
--- a/app/views/courses/_searchmembers.html.erb
+++ b/app/views/courses/_searchmembers.html.erb
@@ -1,12 +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 %>
+<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
+ <%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生姓名、学号进行搜索'%>
+ <% if @group %>
+ <%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
+
+ <% else %>
+
<% end %>
- <%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
-<% end %>
\ No newline at end of file
+<% end %>
+搜索
+<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
\ No newline at end of file
diff --git a/app/views/courses/addgroups.js.erb b/app/views/courses/addgroups.js.erb
index a6f6933b9..cb7e1fbb1 100644
--- a/app/views/courses/addgroups.js.erb
+++ b/app/views/courses/addgroups.js.erb
@@ -1 +1 @@
-$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
+$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
diff --git a/app/views/courses/deletegroup.js.erb b/app/views/courses/deletegroup.js.erb
index a6f6933b9..cb7e1fbb1 100644
--- a/app/views/courses/deletegroup.js.erb
+++ b/app/views/courses/deletegroup.js.erb
@@ -1 +1 @@
-$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
+$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
diff --git a/app/views/courses/member_score_sort.js.erb b/app/views/courses/member_score_sort.js.erb
index c6ff97164..926836356 100644
--- a/app/views/courses/member_score_sort.js.erb
+++ b/app/views/courses/member_score_sort.js.erb
@@ -1,4 +1,4 @@
/**
* Created by Administrator on 2014/12/3.
*/
-$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
\ No newline at end of file
+$("#member_content").html("<%= escape_javascript( render :partial => "new_member_list", :locals => {:members => @results})%>");
\ No newline at end of file
diff --git a/app/views/courses/updategroupname.js.erb b/app/views/courses/updategroupname.js.erb
index 8eb4e865c..8dd142557 100644
--- a/app/views/courses/updategroupname.js.erb
+++ b/app/views/courses/updategroupname.js.erb
@@ -1,4 +1,4 @@
/**
* Created by Administrator on 2014/12/3.
*/
-$("#st_groups").html("<%= escape_javascript( render :partial => 'groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
+$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index d7e393863..5ccb57ffe 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2088,6 +2088,7 @@ zh:
label_open_anonymous_evaluation: 是否匿评
label_evaluation_description: 即每份作业被允许匿评的人数
label_name_not_null: 名称不能为空
+ modal_valid_unpassing: 该分班已经存在
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 3c296699b..18aa965ca 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -1,47 +1,45 @@
///////////////////////////////////////////////////////////////
-function check_groupname(course_id) {
- var $group_name = $('#group_name');
+//添加分班
+function add_group(url,course_id) {
+ var group_name = $('#group_name').val();
$.get(
- '<%=valid_ajax_course_path%>',
+ url,
{ valid: "name",
- value: document.getElementById('group_name').value,
+ value: group_name,
course_id: course_id },
function (data) {
- if (!data.valid) {
+ if (data.valid) {
+ $("#add_group_name").submit();
+ }
+ else
+ {
alert(data.message);
}
- });
-}
-
-function validate_groupname(value1) {
- if(value1.length > 20) {
- alert('<%= l(:label_limit_groupname) %>');
- }
-}
-
-function checkclass(value) {
- for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
- if(document.getElementsByName("check_group_name")[i].id == value) {
- document.getElementById(value).className = "selected";
}
- else {
- document.getElementsByName("check_group_name")[i].className = "classbox";
+ );
+}
+//修改分班:修改分班时得考虑什么都不改但是点击确定的情况
+function edit_group(id,url,course_id,group_id)
+{
+ var group_name = $('#'+id).val();
+ $.get(
+ url,
+ {
+ valid: "name",
+ value: group_name,
+ course_id: course_id,
+ group_id: group_id
+ },
+ function (data) {
+ if (data.valid) {
+ $("#update_group_"+group_id).submit();
+ }
+ else
+ {
+ alert(data.message);
+ }
}
- }
-}
-function validate_groupname_null(value1) {
- value1 = value1.trim();
- if(value1.length == 0 ) {
- alert('<%= l(:label_limit_groupname_null) %>');
- }
-}
-function validate_update(name) {
- value1 = document.getElementById(name).value;
- validate_groupname(value1);
-
-}
-function validate_add_group() {
- check_groupname();
+ );
}
///////////////////////////////////////////////////////////////
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 8522ea1af..9a315e558 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -290,7 +290,7 @@ a.xls{ margin-left:5px; color:#136b3b;}
.st_search{ }
.st_search span{ font-size:14px; font-weight:bold; color:#606060; margin-right:35px;}
.st_search_input{ border:1px solid #1c9ec7; background:#fff; height:20px; color:#c4c4c4; width:200px; padding-left:5px; margin-bottom:5px;}
-.st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:45px; height:20px; float:left; font-size:12px; }
+.st_search a{ background:#1c9ec7; color:#fff;border:1px solid #1c9ec7; text-align:center; display:block; width:60px; height:20px; float:left; font-size:12px; }
.st_search a:hover{ background:#048fbb; text-decoration:none;}
.classbox{ border:1px solid #f8df8c; background:#fffce6; color:#0d90c3; padding:0 3px; float:left; margin-left:15px;}
.st_addclass{ margin-top:5px;}