<div class="widget-body no-padding">
  <%= simple_form_for :search, { url: school_calendars_path, method: :get, html: { class: 'filterable_search_form' } } do |f| %>
    <div class="table-responsive">
      <table class="table table-bordered table-only-inner-bordered table-striped table-condensed table-hover" id="resources">
        <thead>
          <tr>
              <th scope="col" width="10%"><%= f.input :by_year, label: false, placeholder: t('.by_year') %></th>
              <th scope="col">
                <% if show_all_unities? %>
                  <%= f.input :by_unity_id, as: :select2, elements: @unities, label: false, placeholder: t('.by_unity_id') %>
                <% end %>
              </th>
              <th scope="col"></th>
              <th scope="col" class="actions" style="width: <%= @school_calendars.any? ? 230 : 130 %>px">
                <% if current_user.roles.any? { |role| role.administrator? } %>
                  <%= link_to 'Eventos em lote',
                              school_calendar_event_batches_path,
                              class: "btn btn-info pull-right" %>
                <% end %>
              </th>
            </tr>
          <tr>
            <th scope="col"><%= SchoolCalendar.human_attribute_name :year %></th>
            <th scope="col"><%= SchoolCalendar.human_attribute_name :unity %></th>
            <th scope="col"><%= SchoolCalendar.human_attribute_name :number_of_classes %></th>
            <th scope="col"></th>
          </tr>
        </thead>

        <%= render 'resources' %>

        <tfoot id="paginator" class="remote">
          <td colspan="4">
            <div id="page_entries_info" class="pull-left hidden-xs">
              <%= page_entries_info @school_calendars %>
            </div>
            <div class="pull-right">
              <%= paginate @school_calendars %>
            </div>
          </td>
        </tfoot>
      </table>
    </div>
  <% end %>
</div>
