diff --git a/app/assets/stylesheets/experiment/show.scss b/app/assets/stylesheets/experiment/show.scss index 5da5c4285..3d2c38d4a 100644 --- a/app/assets/stylesheets/experiment/show.scss +++ b/app/assets/stylesheets/experiment/show.scss @@ -46,3 +46,41 @@ } } } + +.dropdown-experiment-actions, +.my-module-menu { + .divider-label { + @include font-small; + color: $color-silver-chalice; + padding: .25em 1em; + + &.footer { + border-top: 1px solid $color-concrete; + padding-top: .5em; + } + } + + li { + @include font-button; + cursor: pointer; + padding: .5em 1em; + white-space: nowrap; + + .fas { + display: inline-block; + margin-right: .25em; + width: 18px; + } + + &:hover:not(.divider-label) { + background: $color-concrete; + } + + a { + display: inline-block; + margin: -.5em -1em; + padding: .5em 1em; + width: calc(100% + 2em); + } + } +} diff --git a/app/assets/stylesheets/experiment/table.scss b/app/assets/stylesheets/experiment/table.scss index 997944650..c27c32341 100644 --- a/app/assets/stylesheets/experiment/table.scss +++ b/app/assets/stylesheets/experiment/table.scss @@ -427,40 +427,6 @@ margin-bottom: 0; } - .my-module-menu { - .dropdown-menu { - .divider-label { - @include font-small; - color: $color-silver-chalice; - padding: .25em 1em; - } - - li { - @include font-button; - cursor: pointer; - padding: .5em 1em; - white-space: nowrap; - - .fas { - display: inline-block; - margin-right: .25em; - width: 18px; - } - - &:hover:not(.divider-label) { - background: $color-concrete; - } - - a { - display: inline-block; - margin: -.5em -1em; - padding: .5em 1em; - width: calc(100% + 2em); - } - } - } - } - &.archived { .table-body-cell { background-color: $color-concrete; diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 6f68f4f8c..83471796f 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -224,7 +224,8 @@ class ExperimentsController < ApplicationController format.json do render json: { html: render_to_string( - partial: 'clone_modal.html.erb' + partial: 'clone_modal.html.erb', + locals: { view_mode: params[:view_mode] } ) } end @@ -243,7 +244,8 @@ class ExperimentsController < ApplicationController if service.succeed? flash[:success] = t('experiments.clone.success_flash', experiment: @experiment.name) - redirect_to canvas_experiment_path(service.cloned_experiment) + redirect_to canvas_experiment_path(service.cloned_experiment) if params[:view_mode] == 'canvas' + redirect_to table_experiment_path(service.cloned_experiment) if params[:view_mode] == 'table' else flash[:error] = t('experiments.clone.error_flash', experiment: @experiment.name) @@ -274,14 +276,13 @@ class ExperimentsController < ApplicationController if service.succeed? flash[:success] = t('experiments.move.success_flash', experiment: @experiment.name) - path = canvas_experiment_url(@experiment) status = :ok else message = service.errors.values.join(', ') status = :unprocessable_entity end - render json: { message: message, path: path }, status: status + render json: { message: message }, status: status end def move_modules_modal diff --git a/app/views/experiments/_clone_modal.html.erb b/app/views/experiments/_clone_modal.html.erb index a272134ce..c8e870466 100644 --- a/app/views/experiments/_clone_modal.html.erb +++ b/app/views/experiments/_clone_modal.html.erb @@ -1,7 +1,7 @@