<% content_for :js do %>
  <%= javascript_include_tag 'views/discipline_lesson_plan_report/form' %>
<% end %>

<div class="widget-body no-padding">
  <%= simple_form_for @discipline_lesson_plan_report_form, url: discipline_lesson_plan_report_path, method: :post, html: { class: 'smart-form', target: '_blank', id: "discipline-lesson-plan-report-form" } do |f| %>
    <div class="alert alert-danger hidden" id="exam-rule-not-found-alert">
      <i class="fa fa-exclamation-circle fa-fw"></i>
      <%= t('.exam_rule_not_found') %>
    </div>

    <%= f.error_notification unless @discipline_lesson_plan_report_form.errors[:discipline_lesson_plan].any? %>

    <div class="alert alert-danger <%= 'hidden' unless @discipline_lesson_plan_report_form.errors[:discipline_lesson_plan].any? %>">
      <i class="fa fa-exclamation-circle fa-fw"></i>
      <%= @discipline_lesson_plan_report_form.errors[:discipline_lesson_plan].first %>
    </div>

    <fieldset>
      <div class="row">
        <div class="col col-sm-4">
          <%= f.input :unity_id, as: :select2, elements: @unities, user: current_user, readonly: !current_user.admin? %>
        </div>

        <div class="col col-sm-4">
          <%= f.input :classroom_id, as: :select2, elements: @classrooms, user: current_user,
                input_html: { value: @discipline_lesson_plan_report_form.classroom_id } %>
        </div>
        <div class="col col-sm-4">
          <%= f.input :discipline_id, as: :select2,  elements: @disciplines, user: current_user,
                  classroom_id: @discipline_lesson_plan_report_form.classroom_id,
                  required: true, input_html: { value: @discipline_lesson_plan_report_form.discipline_id } %>
        </div>
      </div>

      <div class="row">
        <div class="col col-sm-4">
          <%= f.input :date_start, as: :date %>
        </div>

        <div class="col col-sm-4">
          <%= f.input :date_end, as: :date %>
        </div>

        <div class="col col-sm-4">
          <%= f.input :author, as: :select2, elements: PlansAuthors.to_select.to_json,
            input_html: { value: PlansAuthors::MY_PLANS } %>
        </div>
      </div>
    </fieldset>

    <footer>
      <div class="btn-group pull-right dropup">
				<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
					Imprimir
          <span class="caret"></span>
				</button>
				<ul class="dropdown-menu dropdown-menu-right">
					<li>
            <a href="javascript:void(0);" id="lesson-plan-report">Dos Planos de aula</a>
					</li>
					<li>
						<a href="javascript:void(0);" id="content-record-report">Dos Registros de conteúdo</a>
					</li>
				</ul>
			</div>
    </footer>
  <% end %>
</div>
