diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index f2d3390c..7a26627a 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -62,7 +62,7 @@ class ExercisesController < ApplicationController end def exercise_params - params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :team_id, :title, files_attributes: file_attributes).merge(user_id: current_user.id, user_type: current_user.class.name) + params[:exercise].permit(:description, :execution_environment_id, :file_id, :instructions, :public, :hide_file_tree, :team_id, :title, files_attributes: file_attributes).merge(user_id: current_user.id, user_type: current_user.class.name) end private :exercise_params diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 986af92d..cc5dfe7e 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -1,6 +1,6 @@ #editor.row data-exercise-id=exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-errors-url=execution_environment_errors_path(exercise.execution_environment) data-submissions-url=submissions_path data-user-id=@current_user.id - .col-sm-3 = render('editor_file_tree', files: @files) - #frames.col-sm-9 + div class=(@exercise.hide_file_tree ? 'hidden col-sm-3' : 'col-sm-3') = render('editor_file_tree', files: @files) + div id='frames' class=(@exercise.hide_file_tree ? 'col-sm-12' : 'col-sm-9') - @files.each do |file| = render('editor_frame', exercise: exercise, file: file) #autosave-label diff --git a/app/views/exercises/_form.html.slim b/app/views/exercises/_form.html.slim index 32365e4a..1002f78a 100644 --- a/app/views/exercises/_form.html.slim +++ b/app/views/exercises/_form.html.slim @@ -23,6 +23,10 @@ label = f.check_box(:public) = t('activerecord.attributes.exercise.public') + .checkbox + label + = f.check_box(:hide_file_tree) + = t('activerecord.attributes.exercise.hide_file_tree') h2 = t('activerecord.attributes.exercise.files') ul#files.list-unstyled = f.fields_for :files do |files_form| diff --git a/app/views/exercises/implement.html.slim b/app/views/exercises/implement.html.slim index b0a3f0e0..85557b81 100644 --- a/app/views/exercises/implement.html.slim +++ b/app/views/exercises/implement.html.slim @@ -13,19 +13,15 @@ #development-environment ul.nav.nav-justified.nav-tabs role='tablist' li.active - a data-placement='top' data-toggle='tab' data-tooltip=true href='#instructions' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 1') - i.fa.fa-question - = t('activerecord.attributes.exercise.instructions') - li - a data-placement='top' data-toggle='tab' data-tooltip=true href='#workspace' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 2') + a data-placement='top' data-toggle='tab' data-tooltip=true href='#workspace' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 1') i.fa.fa-code = t('.workspace') li - a data-placement='top' data-toggle='tab' data-tooltip=true href='#outputInformation' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 3') + a data-placement='top' data-toggle='tab' data-tooltip=true href='#outputInformation' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 2') i.fa.fa-terminal = t('.output') li - a data-placement='top' data-toggle='tab' data-tooltip=true href='#progress' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 4') + a data-placement='top' data-toggle='tab' data-tooltip=true href='#progress' role='tab' title=t('shared.tooltips.shortcut', shortcut: 'ALT + 3') i.fa.fa-line-chart = t('.progress') @@ -46,6 +42,7 @@ .panel-heading = t('.hint') .panel-body .row + / #output-col1.col-sm-12 #output-col1 // todo set to full width if turtle isnt used #prompt.input-group.hidden diff --git a/app/views/exercises/show.html.slim b/app/views/exercises/show.html.slim index 6456c3c0..67185046 100644 --- a/app/views/exercises/show.html.slim +++ b/app/views/exercises/show.html.slim @@ -14,6 +14,7 @@ h1 = row(label: 'exercise.team', value: @exercise.team ? link_to(@exercise.team, @exercise.team) : nil) = row(label: 'exercise.maximum_score', value: @exercise.maximum_score) = row(label: 'exercise.public', value: @exercise.public?) += row(label: 'exercise.hide_file_tree', value: @exercise.hide_file_tree?) = row(label: 'exercise.embedding_parameters') do = content_tag(:input, nil, class: 'form-control', readonly: true, value: embedding_parameters(@exercise)) diff --git a/config/locales/de.yml b/config/locales/de.yml index cb8ef305..9cb546b3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -28,6 +28,7 @@ de: execution_environment: Ausführungsumgebung execution_environment_id: Ausführungsumgebung files: Dateien + hide_file_tree: Dateibaum verstecken instructions: Anweisungen maximum_score: Erreichbare Punktzahl public: Öffentlich diff --git a/config/locales/en.yml b/config/locales/en.yml index e726557d..d7fd84a9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -28,6 +28,7 @@ en: execution_environment: Execution Environment execution_environment_id: Execution Environment files: Files + hide_file_tree: Hide File Tree instructions: Instructions maximum_score: Maximum Score public: Public diff --git a/db/schema.rb b/db/schema.rb index 7f3be339..d895da3f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150903152727) do +ActiveRecord::Schema.define(version: 20150922125415) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -79,6 +79,7 @@ ActiveRecord::Schema.define(version: 20150903152727) do t.string "user_type" t.string "token" t.integer "team_id" + t.boolean "hide_file_tree" end create_table "external_users", force: true do |t|