<% content_for :js do %> <%= javascript_include_tag 'views/complementary_exams/form' %> <% end %> <%= simple_form_for @complementary_exam, html: { class: 'smart-form' } do |f| %> <%= f.error_notification %>
<%= 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 %> <% end %>
<% if current_user.current_role_is_admin_or_employee? %> <%= f.association :discipline, as: :select2_discipline, user: current_user, record: f.object, classroom_id: @complementary_exam.classroom_id %> <% else %> <%= f.association :discipline, as: :select2, elements: @disciplines, user: current_user, record: f.object, classroom_id: @complementary_exam.classroom_id %> <% end %>
<%= f.input :step_id, as: :select2_step, classroom: current_user_classroom, readonly: f.object.persisted? %>
<%= f.association :complementary_exam_setting, as: :select2, elements: complementary_exam_settings, readonly: f.object.persisted? %>
<%= f.input :recorded_at, as: :date %>
<%= t('.students') %> <% if f.object.errors.added? :students, :at_least_one_score %>
<%= f.object.errors[:students].first %>
<% end %> <%= f.fields_for :students do |student| %> <%= render 'student_fields', f: student %> <% end %>
<%= ComplementaryExamStudent.human_attribute_name :student %> <%= ComplementaryExamStudent.human_attribute_name :score %>
<%= t('.no_item_found') %>
<% end %>