91 lines
3.4 KiB
Plaintext
91 lines
3.4 KiB
Plaintext
<script type="text/javascript">
|
|
jQuery(document).ready(function () {
|
|
var $group_name = $('#group_name')
|
|
$group_name.blur(function (event) {
|
|
if ($(this).is('#group_name')) {
|
|
$.get(
|
|
'<%=valid_ajax_course_path%>',
|
|
{ valid: "name",
|
|
value: this.value },
|
|
function (data) {
|
|
if (!data.valid) {
|
|
alert('<%= l(:label_groupname_repeat) %>');
|
|
}
|
|
});
|
|
}
|
|
|
|
});
|
|
});
|
|
</script>
|
|
<script type=" text/javascript" charset="utf-8">
|
|
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() {
|
|
value1 = document.getElementById('group_name').value;
|
|
validate_groupname(value1);
|
|
validate_groupname_null(value1);
|
|
|
|
}
|
|
</script>
|
|
<%= 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">
|
|
<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>
|
|
</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 %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="member_content" id = "member_content">
|
|
<%= error_messages_for 'member' %>
|
|
<%= render :partial => @render_file, :locals => {:members => @members} %>
|
|
</div>
|
|
</div>
|
|
|