From b5a718d1d793dd0dde38d598b5594d40873874cd Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 21 Jun 2016 09:54:15 +0100 Subject: Updated blank state for environments and deployments Closes #18661 --- app/views/projects/environments/index.html.haml | 11 +++++++---- app/views/projects/environments/new.html.haml | 5 ++++- app/views/projects/environments/show.html.haml | 12 ++++++++---- 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index ae9e77e7d89..bfd8a11ce93 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -3,16 +3,19 @@ = render "projects/pipelines/head" %div{ class: (container_class) } - - if can?(current_user, :create_environment, @project) + - if can?(current_user, :create_environment, @project) && !@environments.blank? .top-area .nav-controls = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do New environment - if @environments.blank? - %ul.content-list.environments - %li.nothing-here-block - No environments to show + .blank-state.blank-state-no-icon + %h2.blank-state-title + You don't have any environments right now. + %p.blank-state-text + Environments are places where code gets deployed, such as staging or production. + = link_to "Read more", help_page_path("ci", "environments"), class: "btn btn-success" - else .table-holder %table.table.environments diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml index 54465828ba9..da325efecd2 100644 --- a/app/views/projects/environments/new.html.haml +++ b/app/views/projects/environments/new.html.haml @@ -4,6 +4,9 @@ .col-lg-3 %h4.prepend-top-0 New Environment - %p Environments allow you to track deployments of your application + %p + Environments allow you to track deployments of your application + = succeed "." do + = link_to "Read more about environments", help_page_path("ci", "environments") = render 'form' diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 069b77b5adf..4c15e2759d6 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -13,10 +13,14 @@ = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure you want to delete this environment?' }, class: 'btn btn-danger', method: :delete - if @deployments.blank? - %ul.content-list.environments - %li.nothing-here-block - No deployments for - %strong= @environment.name + .blank-state.blank-state-no-icon + %h2.blank-state-title + You don't have any deployments right now. + %p.blank-state-text + Define environments in the deploy stage(s) in + %code .gitlab-ci.yml + to track deployments here. + = link_to "Read more", help_page_path("ci", "environments"), class: "btn btn-success" - else .table-holder %table.table.environments -- cgit v1.2.1 From 85a5e42576fdbdef804dcab9b4ed2ad1d2bda23e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 21 Jun 2016 11:12:28 +0100 Subject: Moved new environment link to below blank state text --- app/views/projects/environments/index.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index bfd8a11ce93..89b0e1b39e0 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -15,7 +15,11 @@ You don't have any environments right now. %p.blank-state-text Environments are places where code gets deployed, such as staging or production. - = link_to "Read more", help_page_path("ci", "environments"), class: "btn btn-success" + %br + = succeed "." do + = link_to "Read more about environments", help_page_path("ci", "environments") + = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do + New environment - else .table-holder %table.table.environments -- cgit v1.2.1 From c207b9e0512f630b646d9e62f75ca13a188cf83b Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 21 Jun 2016 11:52:51 +0100 Subject: Tests update --- app/views/projects/environments/index.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 89b0e1b39e0..a03f117291f 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -18,8 +18,9 @@ %br = succeed "." do = link_to "Read more about environments", help_page_path("ci", "environments") - = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do - New environment + - if can?(current_user, :create_environment, @project) + = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do + New environment - else .table-holder %table.table.environments -- cgit v1.2.1