
<div class="cl"></div>
    <ul>
      <li class="classbox" id = "group_name_0" name="check_group_name">
        <% course_member_count = l(:label_all) %>
        <%= link_to course_member_count, searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('group_name_0')", method: 'get', remote: true,:style => " border:0px; color: #0d90c3; float:left;"%>
      </li>
      <% if course_groups.any? %>
      <% course_groups.each do |group| %>
      <% group_display = group.name %>
      <% group_count = " ( " + group.members.count.to_s + "人)" %>
      <li class="classbox" id="group_name_<%= group.id %>" name="check_group_name">
        <%= link_to group_display, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
                    :onclick => "checkclass('group_name_#{group.id}')"%>
        <%= link_to group_count, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,
                    :onclick => "checkclass('group_name_#{group.id}')", :style => "color: red;"%>
        <% if @canShowCode && group.members.count == 0 %>
            <%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
                        :data => {confirm: l(:label_delete_group)},
                        :class => 'f_1',
                        :style => "width: 16px;height: 21px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;"
            %>
        <% end %>
        <% if @canShowCode %>
        <a href="javascript:void(0)" class="f_l" onclick="document.getElementById('group_name<%= group.id %>').value='';$('#add_tag_<%= group.id %>').slideToggle();"><img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" /></a>
        <% end %>
      </li>
      <li>
        <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>
                <span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
                    <%= text_field_tag "group_name#{group.id}", params[:group_name],:name => "group_name", :size=>10, :class=>"isTxt w90 f_l", :style=>"padding: 0px", :max => 20 %>
                    <!--<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>-->
                  <%= submit_tag '', class: "submit f_l", :onclick => "validate_update('group_name#{group.id}')", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
                   </span>
            <% end %>
      </li>
      <% end %>
     <% end %>
      <% if @canShowCode %>
      <li style="margin-left:15px;">
        <a href="javascript:void(0)" class="st_add f_l" onclick="document.getElementById('group_name').value='';$('#add_tag04').slideToggle();">+添加分班</a>
      </li>
      <li>
        <span id="add_tag04" style="display:none; vertical-align: middle;" class="ml10 f_l">
        <%= form_tag( addgroups_course_path(@course),  method: 'get',:remote=>true) do %>

                    <%= text_field_tag "group_name", params[:group_name], size: "20", class: "isTxt w90 f_l", style: "padding: 0px",  maxlength: "100" %>
                    <%= submit_tag '', class: "submit f_l",:onclick => "validate_add_group()", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
                    <%= link_to_function '', "document.getElementById('group_name').value='';$('#add_tag04').slideToggle();", class: "submit_2", style: "width: 43px"%>

       <% end %>
       </span>
      </li>
      <% end %>
    </ul>
   
    

