|
<%= sequence %>
|
<% name_class = frequency_student_name_class(dependence, active, exempted_from_discipline, in_active_search) %>
<% student_name = frequency_student_name(student, dependence, active, exempted_from_discipline, in_active_search) %>
<%= student_name %>
|
<% @daily_frequencies.each_with_index do |daily_frequency, index| %>
<% class_number = daily_frequency.class_number || 0 %>
<% daily_frequency_path = "daily_frequency[daily_frequencies]" %>
<% daily_frequency_student_path = "#{daily_frequency_path}[#{class_number}][students_attributes]" %>
<% unique_id = "#{class_number.to_s.rjust(10, '0')}#{student.id.to_s.rjust(10, '0')}" %>
<%= simple_fields_for "#{daily_frequency_student_path}[#{unique_id}]",
daily_frequency_student = daily_frequency.build_or_find_by_student(student.id) do |f| %>
<% if @general_configuration.type_of_teaching == true && index == 0 %>
<%= f.input :type_of_teaching, as: :select2, elements: TypesOfTeaching.to_select_specific_values(false, @general_configuration.types_of_teaching).to_json,
label: false, required: false,
input_html: { value: f.object.type_of_teaching, data: { without_json_parser: true, id: :type_of_teaching } } %>
|
<% end %>
<% absence_justifications = absence_justification[@daily_frequency.frequency_date] || {} %>
<% absence_justification_student_id = absence_justifications[0] || absence_justifications[class_number] %>
<% ignore_student = !active || exempted_from_discipline || in_active_search.present? %>
<%= f.hidden_field :id, value: daily_frequency_student.id, disabled: ignore_student %>
<%= f.hidden_field :daily_frequency_id, value: daily_frequency.id, disabled: ignore_student %>
<%= f.hidden_field :student_id, value: student.id, disabled: ignore_student %>
<%= f.hidden_field :dependence, value: dependence, disabled: ignore_student %>
<%= f.hidden_field :active, value: active, disabled: ignore_student %>
<%= f.hidden_field :absence_justification_student_id, class: 'hidden-justified', value: absence_justification_student_id, disabled: ignore_student %>
<% if absence_justification_student_id %>
<% else %>
<% end %>
<% if @general_configuration.type_of_teaching == true && index != 0 && active && in_active_search.blank? %>
<%= f.input :type_of_teaching, as: :select2, elements: TypesOfTeaching.to_select_specific_values(false, @general_configuration.types_of_teaching).to_json,
label: false, required: false,
input_html: { value: f.object.type_of_teaching, data: { without_json_parser: true, id: 'type_of_teaching_input' } } %>
<% end %>
|
<% end %>
<% end %>