<% content_for :js do %> <%= javascript_include_tag 'list-contents' %> <%= javascript_include_tag 'attachemnt_size_validator' %> <%= javascript_include_tag 'summernote' %> <%= javascript_include_tag 'views/teaching_plans/shared' %> <%= javascript_include_tag 'views/knowledge_area_teaching_plans/form' %> <%= javascript_include_tag 'views/layouts/copy-objectives' %> <% end %> <%= hidden_field_tag :action_name, action_name %> <%= hidden_field_tag :yearly_school_term_type_id, @yearly_term_type_id %> <%= simple_form_for @knowledge_area_teaching_plan, url: knowledge_area_teaching_plan_form_url(@knowledge_area_teaching_plan, action_name), method: teaching_plan_form_method(action_name), html: { class: 'smart-form', id: 'knowledge_area_teaching_plan' } do |f| %> <%= f.error_notification %> <%= render 'base_errors', f: f %> <%= f.simple_fields_for :teaching_plan, @knowledge_area_teaching_plan.teaching_plan do |teaching_plan_form| %> <%= teaching_plan_form.hidden_field :id %>
<% school_type = GeneralConfiguration.current.group_children_education ? 'group_child_schools' : 'experience_fields' %> <%= render 'teaching_plans/copy_objectives', f: teaching_plan_form, type: school_type, modal_id: 'confirm-copy-objectives-modal', confirm_btn: 'confirm-copy-objectives-btn' %>
<%= teaching_plan_form.input :year, readonly: true %>
<%= teaching_plan_form.association :unity, as: :select2_unity, user: current_user %>
<% if current_user.current_role_is_admin_or_employee? %> <%= teaching_plan_form.association :grade, as: :select2_grade, user: current_user, selected: @knowledge_area_teaching_plan.teaching_plan.grade_id, readonly: ['show', 'edit'].include?(action_name) %> <% else %> <%= teaching_plan_form.association :grade, as: :select2, elements: @grades, selected: @knowledge_area_teaching_plan.teaching_plan.grade_id, user: current_user, readonly: ['show', 'edit'].include?(action_name) %> <% end %>
<%= f.input :knowledge_area_ids, as: :select2, elements: @knowledge_areas, multiple: true, input_html: { data: { without_json_parser: true } }, readonly: action_name.eql?('show'), selected: current_user_discipline.knowledge_area.id %>
<%= teaching_plan_form.association :school_term_type, as: :select2, required: true, elements: SchoolTermType.to_select2( current_user.current_school_year, current_user.current_unity_id, add_empty_element: false ).to_json, input_html: { value: teaching_plan_form.object.school_term_type_id, data: { without_json_parser: true } }, readonly: action_name.eql?('show') %>
<%= teaching_plan_form.association :school_term_type_step, as: :select2, elements: [], required: true, readonly: action_name.eql?('show') %>
<%= f.input :experience_fields, readonly: action_name.eql?('show') %>
<%= @knowledge_area_teaching_plan.class.human_attribute_name(:contents) %> * <% if f.object.errors[:'teaching_plan.contents'].any? %>
<%= f.object.errors[:'teaching_plan.contents'].first %>
<% end %>
    <% contents.each do |content| %>
  • <%= check_box_tag("knowledge_area_teaching_plan[teaching_plan_attributes][content_ids][]", content.id, content.id.in?(@knowledge_area_teaching_plan.contents.collect(&:id)), hidden: true, 'data-content_description': content.to_s ) %> <%= content %> <% if content.is_editable && !action_name.eql?('show') %> <% end %>
  • <% end %>
<% if !action_name.eql?('show') %>
<% translation = Translator.t('activerecord.attributes.knowledge_area_teaching_plan.contents') %> <%= teaching_plan_form.input :contents_tags, as: :string, label: "Adicionar #{translation}", input_html: { class: 'select2-tags', value: '' } %>
<% end %>
<%= @knowledge_area_teaching_plan.class.human_attribute_name(:objectives) %> <% if f.object.errors[:'teaching_plan.objectives'].any? %>
<%= f.object.errors[:'teaching_plan.objectives'].first %>
<% end %> <% if !action_name.eql?('show') %> Copiar objetivos/habilidades por área <% end %>
    <% objectives.each do |objective| %>
  • <%= check_box_tag("knowledge_area_teaching_plan[teaching_plan_attributes][objective_ids][]", objective.id, objective.id.in?(@knowledge_area_teaching_plan.objectives.collect(&:id)), hidden: true, 'data-objective_description': objective.to_s ) %> <%= objective %> <% if objective.is_editable && !action_name.eql?('show') %> <% end %>
  • <% end %>
<% if !action_name.eql?('show') %>
<% translation = Translator.t('activerecord.attributes.knowledge_area_teaching_plan.objectives') %> <%= teaching_plan_form.input :objectives_tags, as: :string, label: "Adicionar #{translation}", input_html: { class: 'select2-content-tags-ajax', value: '', data: { url: contents_path, data: [] } } %>
<% end %> <% @methodology_translation = Translation.find_by(key: 'navigation.methodology_by_knowledge_area', group: 'teaching_plans').translation %> <% @evaluation_translation = Translation.find_by(key: 'navigation.avaliation_by_knowledge_area', group: 'teaching_plans').translation %> <% @references_translation = Translation.find_by(key: 'navigation.references_by_knowledge_area', group: 'teaching_plans').translation %>
<%= teaching_plan_form.input :methodology, label: @methodology_translation, input_html: { class: 'col col-sm-12 summernote-field', data: { disabled: action_name.eql?('show') }} %>
<%= teaching_plan_form.input :evaluation, label: @evaluation_translation, input_html: { class: 'col col-sm-12 summernote-field', data: { disabled: action_name.eql?('show') }} %>
<%= teaching_plan_form.input :references, label: @references_translation, input_html: { class: 'col col-sm-12 summernote-field', data: { disabled: action_name.eql?('show') }} %>
<%= t('.attachments') %>
<%= t('.format_message') + ' ' + t('.size_message') %>

<% if teaching_plan_form.object.errors[:teaching_plan_attachments].present? %>
<%= teaching_plan_form.object.errors[:teaching_plan_attachments].join "
" %>
<% end %> <% if !action_name.eql?('show') %> <% end %> <% if action_name.eql?('show') && teaching_plan_form.object.teaching_plan_attachments.blank? %> <% else %> <%= teaching_plan_form.simple_fields_for :teaching_plan_attachments, teaching_plan_form.object.teaching_plan_attachments do |attachment| %> <% if attachment.object.persisted? %> <%= render 'teaching_plan_attachment_show', f: attachment %> <% else %> <%= render 'teaching_plan_attachment_fields', f: attachment %> <% end %> <% end %> <% end %> <% if !action_name.eql?('show') %> <% end %>
Anexo
Nenhum documento anexado
<%= link_to_add_association t('.add_attachment'), teaching_plan_form, :teaching_plan_attachments, class: 'btn btn-success btn-sm', :"data-association-insertion-method" => "append", :"data-association-insertion-node" => "#teaching-plan-attachments" %>
<% if teaching_plan_form.object.persisted? %>
<%= t('teaching_plans.form.additional_information') %>
<%= teaching_plan_form.input :opinion, input_html: { class: 'col col-sm-12' }, readonly: current_user.teacher? %>
<%= teaching_plan_form.input :validated, as: :boolean, label: false, inline_label: true, disabled: current_user.teacher? %>
<% end %> <% end %> <% end %>