_form.html.erb 694 B

123456789101112131415161718
  1. <%= bootstrap_form_for(@lecture) do |f| %>
  2. <%= render 'shared/error_messages', object: f.object %>
  3. <% if can_edit_full? %>
  4. <%= f.select :course_id, options_for_select(current_user.schools_administering.map{ |school| school.courses }.flatten.map{ |course| [course.name, course.id] }) %>
  5. <% else %>
  6. <%= f.text_field :course, value: @lecture.course.name, disabled: true %>
  7. <% end %>
  8. <%= f.datetime_field :starts_at, disabled: !can_edit_full? %>
  9. <%= f.datetime_field :ends_at, disabled: !can_edit_full? %>
  10. <%= f.text_field :location, disabled: !can_edit_full? %>
  11. <%= f.text_area :description %>
  12. <%= f.submit yield(:button_text), class: "btn btn-primary" %>
  13. <% end %>