<% content_for :js do %> <%= javascript_include_tag 'views/absence_justification_report/form' %> <% end %> <%= simple_form_for @absence_justification_report_form, url: absence_justification_report_path, method: :post, html: { class: "smart-form", target: '_blank' } do |f| %> <%= f.error_notification unless @absence_justification_report_form.errors[:base].any? %>
<%= @absence_justification_report_form.errors[:base].first %>
<%= f.input :unity_id, as: :select2, elements: @unities, user: current_user, readonly: !current_user.admin? %>
<%= f.input :classroom_id, as: :select2, elements: @classrooms, user: current_user, input_html: { value: @absence_justification_report_form.classroom_id } %>
<%= f.input :absence_date, as: :date %>
<%= f.input :absence_date_end, as: :date %>
<%= f.input :author, as: :select2, elements: AbsenceJustificationAuthors.to_select.to_json %>
<%= hidden_field_tag :teacher_id, current_teacher %>
<% end %>