summaryrefslogtreecommitdiff
path: root/app/controllers/projects/environments_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/environments_controller.rb')
-rw-r--r--app/controllers/projects/environments_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index 2ec316a1ebd..40da5be2e49 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -10,8 +10,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
@all_environments = project.environments
@environments =
case @scope
- when 'closed' then @all_environments.closed
- else @all_environments.opened
+ when 'stopped' then @all_environments.stopped
+ else @all_environments.available
end
end
@@ -45,7 +45,9 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
def stop
-
+ action = @environment.stop_action
+ new_action = action.active? ? action : action.play(current_user)
+ redirect_to [project.namespace.become(Namespace), project, new_action]
end
def destroy