diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-06-21 12:05:25 +0300 |
---|---|---|
committer | Jose <jvargas@gitlab.com> | 2018-06-27 07:06:25 +0300 |
commit | 55943872f43798b58009c4248d993cc8cb8d34cc (patch) | |
tree | 626c2e14592a7dcb8853e0a8ad5debdfdf374d5d /app/controllers/projects | |
parent | 3c49bcb602a38364d0034bfe927097bedbca986c (diff) |
Adds empty environments page
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/projects/environments_controller.rb | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 719a3c37f45..5475e333db9 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -5,7 +5,7 @@ class Projects::ApplicationController < ApplicationController skip_before_action :authenticate_user! before_action :project before_action :repository - before_action :environment + before_action :available_environment layout 'project' helper_method :repository, :can_collaborate_with_project?, :user_access @@ -33,8 +33,8 @@ class Projects::ApplicationController < ApplicationController @repository ||= project.repository end - def environment - @environment ||= project.environments.first + def available_environment + @available_environment ||= project.environments.with_state(:available).first end def authorize_action!(action) diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb index 0821362f5df..47b2028860d 100644 --- a/app/controllers/projects/environments_controller.rb +++ b/app/controllers/projects/environments_controller.rb @@ -31,6 +31,10 @@ class Projects::EnvironmentsController < Projects::ApplicationController end end + def empty + render :empty + end + def folder folder_environments = project.environments.where(environment_type: params[:id]) @environments = folder_environments.with_state(params[:scope] || :available) |