diff --git a/app/assets/stylesheets/exercises.css.scss b/app/assets/stylesheets/exercises.css.scss index eb1b5300..73c0b26e 100644 --- a/app/assets/stylesheets/exercises.css.scss +++ b/app/assets/stylesheets/exercises.css.scss @@ -62,7 +62,9 @@ a.file-heading { fill: #ffd897; } - +.container > form > .actions { + margin-bottom: 200px; +} .d3-tip { line-height: 1; diff --git a/app/views/exercises/_file_form.html.slim b/app/views/exercises/_file_form.html.slim index 065eca66..75deeeb5 100644 --- a/app/views/exercises/_file_form.html.slim +++ b/app/views/exercises/_file_form.html.slim @@ -2,10 +2,10 @@ li.panel.panel-default .panel-heading role="tab" id="heading" - a.file-heading data-toggle="collapse" data-parent="#files" href="#collapse#{id}" + a.file-heading data-toggle="collapse" href="#collapse#{id}" div.clearfix role="button" span = f.object.name - .panel-collapse.collapse-in id="collapse#{id}" role="tabpanel" + .panel-collapse.collapse class=('in' if f.object.name.nil?) id="collapse#{id}" role="tabpanel" .panel-body .clearfix = link_to(t('shared.destroy'), '#', class:'btn btn-warning btn-sm discard-file pull-right') .form-group diff --git a/app/views/exercises/_form.html.slim b/app/views/exercises/_form.html.slim index 5ab8502b..bb4aa851 100644 --- a/app/views/exercises/_form.html.slim +++ b/app/views/exercises/_form.html.slim @@ -38,19 +38,28 @@ .form-group = f.label(t('activerecord.attributes.exercise.worktime')) = f.number_field "expected_worktime_minutes", value: @exercise.expected_worktime_seconds / 60, in: 1..1000, step: 1 - h2 Tags - .table-responsive - table.table#tags-table - thead - tr - th = t('activerecord.attributes.exercise.selection') - th = sort_link(@search, :title, t('activerecord.attributes.tag.name')) - th = t('activerecord.attributes.tag.difficulty') - = collection_check_boxes :exercise, :tag_ids, @exercise_tags, :tag_id, :id do |b| - tr - td = b.check_box - td = b.object.tag.name - td = number_field "tag_factors[#{b.object.tag.id}]", :factor, :value => b.object.factor, in: 1..10, step: 1 + + h2 = t('exercises.form.tags') + ul.list-unstyled.panel-group + li.panel.panel-default + .panel-heading role="tab" id="heading" + a.file-heading data-toggle="collapse" href="#tag-collapse" + div.clearfix role="button" + span = t('exercises.form.click_to_collapse') + .panel-collapse.collapse id="tag-collapse" role="tabpanel" + .table-responsive + table.table#tags-table + thead + tr + th = t('activerecord.attributes.exercise.selection') + th = sort_link(@search, :title, t('activerecord.attributes.tag.name')) + th = t('activerecord.attributes.tag.difficulty') + = collection_check_boxes :exercise, :tag_ids, @exercise_tags, :tag_id, :id do |b| + tr + td = b.check_box + td = b.object.tag.name + td = number_field "tag_factors[#{b.object.tag.id}]", :factor, :value => b.object.factor, in: 1..10, step: 1 + h2 = t('activerecord.attributes.exercise.files') ul#files.list-unstyled.panel-group = f.fields_for :files do |files_form| diff --git a/config/locales/de.yml b/config/locales/de.yml index 62fc76b5..0f066fde 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -260,6 +260,8 @@ de: path: 'Pfad der Datei im Projektverzeichnis. Kann auch leer gelassen werden.' form: add_file: Datei hinzufügen + tags: "Tags" + click_to_collapse: "Zum Aus-/Einklappen hier klicken..." implement: alert: text: 'Ihr Browser unterstützt nicht alle Funktionalitäten, die %{application_name} benötigt. Bitte nutzen Sie einen modernen Browser, um %{application_name} zu besuchen.' diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e13f929..f3aa6735 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -260,6 +260,8 @@ en: path: "The file's path in the project tree. Can be left blank." form: add_file: Add file + tags: "Tags" + click_to_collapse: "Click to expand/collapse..." implement: alert: text: 'Your browser does not support features required for using %{application_name}. Please access %{application_name} using a modern browser.'