<%= f.association :unity, as: :select2_unity, user: current_user %>
<% if current_user.current_role_is_admin_or_employee? %>
<%= f.association :classroom, as: :select2_classroom, user: current_user, record: f.object %>
<% else %>
<%= f.association :classroom, as: :select2, elements: @classrooms,
user: current_user, record: f.object, readonly: readonly
%>
<% end %>
<% if @absence_justification.legacy %>
<% if current_user.current_role_is_admin_or_employee? %>
<%= f.association :disciplines, as: :select2_discipline,
multiple: true,
user: current_user,
classroom_id: @absence_justification.classroom_id,
admin_or_employee: current_user.current_role_is_admin_or_employee?,
required: true,
input_html: {
value: f.object.discipline_ids.join(','),
readonly: readonly,
data: { without_json_parser: true }
} %>
<% else %>
<%= f.association :disciplines, as: :select2, elements: @disciplines,
multiple: true,
user: current_user,
classroom_id: @absence_justification.classroom_id,
admin_or_employee: current_user.current_role_is_admin_or_employee?,
required: true,
input_html: {
value: f.object.discipline_ids.join(','),
readonly: readonly,
data: { without_json_parser: true }
}
%>
<% end %>
<% end %>
<%= f.input :absence_date, input_html: { readonly: readonly } %>
<%= f.input :absence_date_end, input_html: { readonly: readonly } %>
<% if @absence_justification.legacy %>
<%= f.association :students, as: :select2, elements: @students, multiple: true, required: true,
input_html: { value: f.object.student_ids.join(','), readonly: readonly, data: { without_json_parser: true } } %>
<% end %>
<% unless @absence_justification.legacy %>
<%= f.input :period, as: :select2, elements: Periods.to_select_specific_values(false, %w[1 2 3]).to_json,
readonly: @period != Periods::FULL %>
<%= f.association :students, as: :select2, elements: @students, multiple: true, required: true,
input_html: {
value: f.object.student_ids.join(','),
readonly: readonly,
data: { without_json_parser: true }
} %>
<% if @frequency_by_discipline %>
<%= f.input :class_number, as: :select2, multiple: true,
hint: "O não preenchimento do campo 'Aula' vincula a justificativa de falta com todas as aulas do período selecionado.",
elements: number_of_classes_elements(@absence_justification.school_calendar.number_of_classes),
input_html: {
value: @absence_justification.class_number,
readonly: readonly,
data: { without_json_parser: true }
} %>
<% end %>
<% end %>
Somente arquivos nos formatos jpeg, jpg, png, gif, pdf, odt, doc, docx, ods, xls, xlsx, odp, ppt, pptx, odg, xml, csv. Tamanho máximo por arquivo: 3MB
<% if f.object.errors[:absence_justification_attachments].present? %>
<%= f.object.errors[:absence_justification_attachments].join "
" %>
<% end %>
| Anexo |
|
<%= f.simple_fields_for :absence_justification_attachments, f.object.absence_justification_attachments do |attachment| %>
<% if attachment.object.persisted? %>
<%= render 'absence_justification_attachment_show', f: attachment %>
<% else %>
<%= render 'absence_justification_attachment_fields', f: attachment %>
<% end %>
<% end %>
|
<%= link_to_add_association t('.add_attachment'), f, :absence_justification_attachments,
class: 'btn btn-success btn-sm',
disabled: @absence_justification.legacy || action_name == 'show',
:"data-association-insertion-method" => "append",
:"data-association-insertion-node" => "#absence-justification-attachments" %>
|
<% if action_name == 'show' %>