summaryrefslogtreecommitdiff
path: root/app/views/projects/environments/index.html.haml
blob: 11e2ff506b47a40839ef910cf9e271887eced618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
- @no_container = true
- page_title "Environments"
= render "projects/pipelines/head"

%div{ class: container_class }
  .top-area
    %ul.nav-links
      %li{class: ('active' if @scope.nil?)}
        = link_to project_environments_path(@project) do
          Available
          %span.badge.js-avaibale-environments-count
            = number_with_delimiter(@all_environments.opened.count)

      %li{class: ('active' if @scope == 'closed')}
        = link_to project_environments_path(@project, scope: :closed) do
          Stopped
          %span.badge.js-stopped-environments-count
            = number_with_delimiter(@all_environments.closed.count)

    .nav-controls
      - if can?(current_user, :create_environment, @project) && !@all_environments.blank?
        = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do
          New environment

  - if @all_environments.blank?
    .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.
        %br
        = succeed "." do
          = link_to "Read more about environments", help_page_path("ci/environments")
      - 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.builds.environments
        %tbody
          %th Environment
          %th Last Deployment
          %th Commit
          %th
          %th.hidden-xs
        = render @environments