<% content_for :js do %>
  <%= javascript_include_tag 'views/discipline_lesson_plans/index' %>
<% end %>
<div class="widget-body no-padding">
  <%= simple_form_for :filter, { url: discipline_lesson_plans_path, method: :get, html: { class: 'filterable_search_form' } } do |f| %>
    <div class="table-responsive">
      <table id="resources" class="table table-bordered table-only-inner-bordered table-striped table-condensed table-hover">
        <thead>
          <tr>
            <th scope="col"></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="colgroup" colspan="2">
              <%= f.input :by_date, as: :date, label: false,
                    placeholder: t('.by_date') %>
            </th>
            <th scope="col">
              <%= f.input :by_author, as: :select2_plans, label: false %>
            </th>
            <th scope="col">
              <%= link_to t('.new_html'), new_discipline_lesson_plan_path,
                  class: 'btn btn-primary pull-right', style: 'width: 210px;' %>
            </th>
          </tr>

          <tr>
            <th scope="col"><%= LessonPlan.human_attribute_name :unity %></th>
            <th scope="col" style="width: 20%"><%= LessonPlan.human_attribute_name :classroom %></th>
            <th scope="col" style="width: 20%"><%= DisciplineLessonPlan.human_attribute_name :discipline %>
            <th scope="col" style="width: 7%"><%= LessonPlan.human_attribute_name :start_at %></th>
            <th scope="col" style="width: 7%"><%= LessonPlan.human_attribute_name :end_at %></th>
            <th scope="col" style="width: 7%"><%= DisciplineLessonPlan.human_attribute_name :author %></th>
            <th scope="col" style="width: 230px"></th>
          </tr>
        </thead>

        <%= render 'resources' %>

        <tfoot id="paginator" class="remote">
          <td id="pagination-tfoot" colspan="7">
            <%= render 'shared/pagination', records: @discipline_lesson_plans %>
          </td>
        </tfoot>
      </table>
    </div>
  <% end %>
</div>
<%= render 'copy_discipline_lesson_plan_modal' %>
