2014-12-19 23:12:32 +08:00
|
|
|
<script type="text/javascript">
|
2015-01-08 16:16:59 +08:00
|
|
|
function check_groupname() {
|
|
|
|
var $group_name = $('#group_name');
|
2015-01-09 10:22:30 +08:00
|
|
|
$.get(
|
2015-01-08 16:16:59 +08:00
|
|
|
'<%=valid_ajax_course_path%>',
|
|
|
|
{ valid: "name",
|
2015-01-23 11:46:55 +08:00
|
|
|
value: document.getElementById('group_name').value,
|
|
|
|
course_id: <%= @course.id %> },
|
2015-01-08 16:16:59 +08:00
|
|
|
function (data) {
|
|
|
|
if (!data.valid) {
|
2015-01-09 10:22:30 +08:00
|
|
|
alert(data.message);
|
2015-01-08 16:16:59 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2014-12-09 15:16:43 +08:00
|
|
|
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 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() {
|
2015-01-08 16:16:59 +08:00
|
|
|
check_groupname();
|
2014-12-09 15:16:43 +08:00
|
|
|
}
|
|
|
|
</script>
|
2015-03-25 16:01:28 +08:00
|
|
|
|
|
|
|
<div class="project_r_h">
|
|
|
|
<h2 class="project_h2"><%= @subPage_title%></h2>
|
|
|
|
</div>
|
|
|
|
<% if @subPage_title == l(:label_student_list)%>
|
|
|
|
<div class="st_list" id="member_of_course">
|
|
|
|
<div class="st_search" style="margin-left: 14px" >
|
|
|
|
<span class="f_l"><%= @subPage_title %></span>
|
2014-12-26 17:31:01 +08:00
|
|
|
<span id = "search_members">
|
|
|
|
<%= render :partial => 'searchmembers' %>
|
2014-12-22 17:02:32 +08:00
|
|
|
</span>
|
2015-03-25 16:01:28 +08:00
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<% if @subPage_title == l(:label_student_list) %>
|
|
|
|
<div class="st_addclass" id = "st_groups">
|
|
|
|
<%= render :partial => 'groups_name', :locals => {:course_groups => @course_groups} %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-12-03 19:17:10 +08:00
|
|
|
|
2015-03-25 16:01:28 +08:00
|
|
|
<div class="cl"></div>
|
2014-12-04 19:09:10 +08:00
|
|
|
|
2015-03-25 16:01:28 +08:00
|
|
|
<div class="member_content" id = "member_content">
|
|
|
|
<%= error_messages_for 'member' %>
|
|
|
|
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% else%>
|
|
|
|
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
|
|
|
<% end%>
|
2014-06-12 14:57:25 +08:00
|
|
|
|