<div class="box admin-list-container users-list-container">
  <table class="table table-hover users-list-table">
    <thead class="thead-light">
      <tr>
        <th width="30%" class="edu-txt-left">
          <span class="pl15">版块</span>
          <%= link_to "<i class='fa fa-plus-circle'></i>".html_safe,new_admins_forum_section_path, remote: true,  class: "btn btn-primary btn-sm" %>
        </th>
        <th width="30%">主页推荐</th>
        <th width="40%" class="edu-txt-left"><span class="pl15">一级版主任命/解除</span></th>
      </tr>
    </thead>
    <tbody id="forum-section-contents">
      <% if @forum_sections_count > 0 %>
        <% @forum_sections.each do |forum| %>
          <%= render partial: "admins/forum_sections/forum_section_detail", locals: {forum: forum} %>
        <% end %>
      <% else %>
        <tr id="forum-section-detail-no-data">
          <td colspan="100">
            没有数据
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>
<div class="edu-back-white mt10">
  <%= render partial: 'admins/shared/paginate', locals: { objects: @forum_sections } %>
</div>
<script>
  function first_menu_click(that) {
    var target = $(that);
    var menu_i = target.find(".fa");
    var children_tags = target.parent().parent().find(".set_l_submenu");
    if(menu_i.hasClass("fa-plus-square-o")){
      menu_i.removeClass("fa-plus-square-o").addClass("fa-minus-square-o");
      children_tags.addClass("active")
    }else{
      menu_i.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");
      children_tags.removeClass("active")
    }
  }
  
  function first_menu_action(that) {
    console.log('ddddd')
    var target = $(that);
    var target_action = target.find(".operateList");
    if(target_action.hasClass("active")){
      $(".operateList").removeClass("active");
      target_action.removeClass("active");
    }else {
      $(".operateList").removeClass("active");
      target_action.addClass("active");
    }
  }
  
  function recommend_form_submit(id) {
    $("#"+id).trigger("click")
  }
  
  $(document).mouseup(function(e){
  var _con = $('.menu_operate');   // 设置目标区域
  if(!_con.is(e.target) && _con.has(e.target).length === 0){
    _con.find(".operateList").removeClass("active")
  }
  });
</script>
