Files
codeocean/app/views/exercise_collections/_form.html.slim
2018-07-13 15:42:26 +02:00

36 lines
1.5 KiB
Plaintext

- users = InternalUser.order(:name)
= form_for(@exercise_collection, multipart: true) do |f|
= render('shared/form_errors', object: @exercise_collection)
.form-group
= f.label(t('activerecord.attributes.exercise_collections.name'))
= f.text_field(:name, class: 'form-control', required: true)
.form-group
= f.label(t('activerecord.attributes.exercise_collections.use_anomaly_detection'))
= f.check_box(:use_anomaly_detection, {class: 'form-control'})
.form-group
= f.label(t('activerecord.attributes.exercise_collections.user'))
= f.collection_select(:user_id, users, :id, :name, {}, {class: 'form-control'})
.table-responsive#exercise-list
table.table
thead
tr
th
th = t('activerecord.attributes.exercise_collection_item.exercise')
th colspan=2 = t('shared.actions')
tbody#sortable
- @exercise_collection.items.order(:position).each do |item|
tr data-id=item.exercise.id
td
span.fa.fa-bars
td = item.exercise.title
td = link_to(t('shared.show'), item.exercise)
td
a.remove-exercise href='#' = t('shared.destroy')
button.btn.btn-primary type='button' data-toggle='modal' data-target='#add-exercise-modal' = t('exercise_collections.form.add_exercises')
.actions = render('shared/submit_button', f: f, object: @exercise_collection)
= render('shared/modal', id: 'add-exercise-modal', title: t('.add_exercises'), template: 'exercise_collections/_add_exercise_modal')