app/views/class_schedules/_form.html.haml
- content_for(:js_and_css) do
= select2_scripts_and_stylesheets
.col-xs-12.col-sm-6.vert-offset-top-1
= simple_form_for @class_schedule do |f|
= render 'shared/error_messages', object: f.object
= f.association :course, label_method: :label_for_select, collection: [*f.object.course],
input_html: { data: { placeholder: 'Select an option', 'ajax--url': ui_courses_path } }
= f.input :subject
= f.association :classroom, label_method: :title, collection: [*f.object.classroom],
input_html: { data: { placeholder: 'Select an option', 'ajax--url': ui_classrooms_path } }
= f.association :teacher_profile, label_method: :complex_name, collection: [*f.object.teacher_profile],
input_html: { data: { placeholder: 'Select an option', 'ajax--url': ui_teacher_profiles_path } }
= f.association :academic_groups, label_method: :title, collection: f.object.academic_groups,
input_html: { data: { placeholder: 'Select an option', 'ajax--url': ui_academic_groups_path } }
.row
.col-xs-12.col-sm-6
= f.input :start_time,
as: :string,
input_html: { type: 'datetime-local', value: time_value(f.object.start_time) }
.col-xs-12.col-sm-6
= f.input :finish_time,
as: :string,
input_html: { type: 'datetime-local', value: time_value(f.object.finish_time) }
.row
.col-xs-12.col-sm-6
= f.button :submit
- if %w(new create).include? params[:action]
.col-xs-12.col-sm-6
= f.button :submit, t('class_schedules.create_and_clone')