<% define_admin_breadcrumbs do %>
  <% add_admin_breadcrumb('部门列表') %>
<% end %>

<div class="box search-form-container department-list-form">
  <%= form_tag(admins_departments_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
    <div class="form-check mr-3">
      <%= hidden_field_tag(:with_member, false,id:'') %>
      <%= check_box_tag(:with_member, true, params[:with_member].to_s == 'true', class: 'form-check-input') %>
      <label class="form-check-label" for="with_member">有部门管理员</label>
    </div>

    <div class="form-check mr-3">
      <%= hidden_field_tag(:with_identifier, false,id:'') %>
      <%= check_box_tag(:with_identifier, true, params[:with_identifier].to_s == 'true', class: 'form-check-input') %>
      <label class="form-check-label" for="with_identifier">有统计链接</label>
    </div>

    <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '部门/单位名称检索') %>
    <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
  <% end %>

  <%= javascript_void_link '新建部门', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-create-department-modal' } %>
</div>

<div class="box admin-list-container department-list-container">
  <%= render partial: 'admins/departments/shared/list',
             locals: { departments: @departments, users_count: @users_count, professional_auth_count: @professional_auth_count } %>
</div>

<%= render 'admins/departments/shared/create_department_modal' %>
<%= render 'admins/departments/shared/add_department_member_modal' %>
<%= render 'admins/departments/shared/merge_department_modal' %>