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

<div class="widget-body no-padding">
  <%= simple_form_for @teacher_report_card_form, url: teacher_report_cards_path, method: :post, html: { class: "smart-form", target: '_blank' } do |f| %>
    <div class="alert alert-info">
      <i class="fa fa-exclamation-circle fa-fw"></i>
      O Boletim do professor somente irá exibir as notas/faltas após concluído o Envio de avaliações/frequências.
    </div>
    <%= f.error_notification unless @teacher_report_card_form.errors[:base].any? %>
    <div class="alert alert-danger <%= 'hidden' unless @teacher_report_card_form.errors[:base].any? %>">
      <i class="fa fa-exclamation-circle fa-fw"></i>
      <%= @teacher_report_card_form.errors[:base].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 :grade_id, as: :select2, elements: @grades, required: true, user: current_user,
                input_html: { value: f.object.grade_id, data: { without_json_parser: true } }%>
        </div>
        <div class="col col-sm-4">
          <%= f.input :classroom_id, as: :select2, elements: @classrooms, user: current_user,
                input_html: { value: @teacher_report_card_form.classroom_id } %>
        </div>
      </div>
      <div class="row">
        <div class="col col-sm-4">
          <%= f.input :discipline_id, as: :select2, elements: @disciplines, user: current_user,
              classroom_id: @teacher_report_card_form.classroom_id,
              required: true, input_html: { value: @teacher_report_card_form.discipline_id } %>
        </div>
        <div class="col col-sm-4">
          <%= f.input :status, as: :select2, elements: TeacherReportCardStatus.to_select(false).to_json %>
        </div>
        <div class="col col-sm-4" style="padding: 10px 15px;">
          <%= f.hidden_field :registration_status, value: false %>
          <%= f.input :registration_status, as: :boolean, label: false, inline_label: true %>
        </div>
      </div>
    </fieldset>

    <footer>
      <%= f.submit 'Imprimir', class: 'btn btn-primary', id: 'send-report' %>
    </footer>
  <% end %>
</div>
