<div class="widget-body no-padding">
  <%= simple_form_for :search, { url: teaching_plans_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"><%= f.input :by_year, label: false, placeholder: t('.by_year') %></th>
            <th scope="col"><%= f.input :by_unity_id, as: :select2, elements: @unities, label: false, placeholder: t('.by_unity_id') %></th>
            <th scope="col"><%= f.input :by_classroom_id, as: :select2, elements: @classrooms, label: false, placeholder: t('.by_classroom_id') %></th>
            <th scope="col"><%= f.input :by_discipline_id, as: :select2, elements: @disciplines, label: false, placeholder: t('.by_discipline_id') %></th>
            <th scope="col"><%= f.input :by_school_term_type_id, as: :select2, elements: SchoolTermType.to_select2(current_user.current_school_year, current_user.current_unity_id).to_json, label: false, placeholder: t('.by_school_term_type') %></th>
            <th scope="col"><%= f.input :by_school_term_type_step_id, as: :select2, elements: SchoolTermTypeStep.to_select2(current_user.current_school_year, current_user.current_unity_id).to_json, label: false, placeholder: t('.by_school_term_type_step') %></th>
            <th scope="col"><%= link_to t('.new_html'), new_teaching_plan_path, class: "btn btn-primary pull-right" %></th>
          </tr>
          <tr>
            <th scope="col" width="110"><%= TeachingPlan.human_attribute_name :year %></th>
            <th scope="col"><%= Classroom.human_attribute_name :unity %></th>
            <th scope="col"><%= TeachingPlan.human_attribute_name :classroom %></th>
            <th scope="col"><%= TeachingPlan.human_attribute_name :discipline %></th>
            <th scope="col"><%= TeachingPlan.human_attribute_name :school_term_type %></th>
            <th scope="col"><%= TeachingPlan.human_attribute_name :school_term_type_step %></th>
            <th scope="col" style="width: 153px"></th>
          </tr>
        </thead>

        <%= render 'resources' %>

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