<div class="widget-body no-padding">
  <%= simple_form_for @school_calendar, html: { class: "smart-form" } do |f| %>
    <%= f.error_notification %>

    <fieldset>
      <div class="row">
        <div class="col col-sm-4">
          <%= f.input :year, input_html: { max_length: 4 }, disabled: true %>
        </div>

        <div class="col col-sm-4">
          <%= f.input :unity, disabled: true %>
        </div>

        <div class="col col-sm-4">
          <%= f.input :number_of_classes %>
        </div>
      </div>
    </fieldset>

    <fieldset id="school_calendar_steps">
      <legend><%= t('.steps') %></legend>

      <div class="alert alert-info fade in">
        <i class="fa-fw fa fa-info"></i>
        <%= t('.info') %>
      </div>

      <table class="table table-striped table-bordered table-condensed records">
        <thead>
          <tr>
            <th style="width: 22%;"><%= SchoolCalendarStep.human_attribute_name :start_at %></th>
            <th style="width: 22%;"><%= SchoolCalendarStep.human_attribute_name :end_at %></th>
            <th style="width: 22%;"><%= SchoolCalendarStep.human_attribute_name :start_date_for_posting %></th>
            <th style="width: 22%;"><%= SchoolCalendarStep.human_attribute_name :end_date_for_posting %></th>
          </tr>
        </thead>

        <tbody id="school-calendar-steps">
          <%= f.simple_fields_for :steps do |step| %>
            <%= render 'step_fields', f: step %>
          <% end %>
        </tbody>
      </table>
    </fieldset>

    <fieldset id="school_calendar_classroom_steps">
      <legend>Etapas específicas</legend>

      <%= f.simple_fields_for :classrooms, @school_calendar.classrooms.ordered_by_grade.ordered_by_description do |classroom| %>
        <%= render 'classroom_fields', f: classroom %>
      <% end %>
    </fieldset>

    <footer>
      <%= link_to t('views.form.back'), school_calendars_path, class: "btn btn-default" %>

      <%= link_to t('views.form.history'), history_school_calendar_path(@school_calendar), class: 'btn btn-info' %>

      <%= f.submit t('views.form.save'), class: 'btn btn-primary' %>
    </footer>
  <% end %>
</div>
