<% content_for :js do %>
  <%= javascript_include_tag 'views/daily_notes/new' %>
<% end %>

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

    <fieldset>
      <div class="row">
        <div class="col col-sm-4">
          <%= f.input :unity_id, as: :select2_unity, user: current_user %>
        </div>

        <div class="col col-sm-4">
          <% if @admin_or_teacher %>
            <%= f.input :classroom_id, as: :select2_classroom, user: current_user %>
          <% else %>
            <%= f.input :classroom_id, as: :select2, elements: @classrooms, user: current_user %>
          <% end %>
        </div>

        <div class="col col-sm-4">
        <% if @admin_or_teacher %>
          <%= f.input :discipline_id, as: :select2_discipline, user: current_user,
                classroom_id: @daily_note.classroom_id %>
        <% else %>
          <%= f.input :discipline_id, as: :select2, elements: @disciplines, user: current_user,
                classroom_id: @daily_note.classroom_id %>
        <% end %>
        </div>
      </div>
      <div class="row">
        <div class="col col-sm-4">
          <%= f.association :avaliation, as: :select2, elements: @avaliations.try(:data_for_select2) || {} %>
        </div>
      </div>

    </fieldset>

    <footer>
      <%= f.submit 'Carregar', class: 'btn btn-primary', data: { disable_with: 'Carregando...'}  %>
    </footer>
  <% end %>
</div>
