summaryrefslogtreecommitdiff
path: root/app/views/projects/environments
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/environments')
-rw-r--r--app/views/projects/environments/_environment.html.haml8
-rw-r--r--app/views/projects/environments/_form.html.haml29
-rw-r--r--app/views/projects/environments/edit.html.haml6
-rw-r--r--app/views/projects/environments/index.html.haml7
-rw-r--r--app/views/projects/environments/new.html.haml14
-rw-r--r--app/views/projects/environments/show.html.haml6
6 files changed, 45 insertions, 25 deletions
diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml
index e2453395602..36a6162a5a8 100644
--- a/app/views/projects/environments/_environment.html.haml
+++ b/app/views/projects/environments/_environment.html.haml
@@ -2,8 +2,12 @@
%tr.environment
%td
- %strong
- = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment)
+ = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment)
+
+ %td
+ - if last_deployment
+ = user_avatar(user: last_deployment.user, size: 20)
+ %strong ##{last_deployment.id}
%td
- if last_deployment
diff --git a/app/views/projects/environments/_form.html.haml b/app/views/projects/environments/_form.html.haml
index c07f4bd510c..6d040f5cfe6 100644
--- a/app/views/projects/environments/_form.html.haml
+++ b/app/views/projects/environments/_form.html.haml
@@ -1,7 +1,22 @@
-= form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { class: 'col-lg-9' } do |f|
- = form_errors(@environment)
- .form-group
- = f.label :name, 'Name', class: 'label-light'
- = f.text_field :name, required: true, class: 'form-control'
- = f.submit 'Create environment', class: 'btn btn-create'
- = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel'
+.row.prepend-top-default.append-bottom-default
+ .col-lg-3
+ %h4.prepend-top-0
+ Environments
+ %p
+ Environments allow you to track deployments of your application
+ = succeed "." do
+ = link_to "Read more about environments", help_page_path("ci/environments")
+
+ = form_for [@project.namespace.becomes(Namespace), @project, @environment], html: { class: 'col-lg-9' } do |f|
+ = form_errors(@environment)
+
+ .form-group
+ = f.label :name, 'Name', class: 'label-light'
+ = f.text_field :name, required: true, class: 'form-control'
+ .form-group
+ = f.label :external_url, 'External URL', class: 'label-light'
+ = f.url_field :external_url, class: 'form-control'
+
+ .form-actions
+ = f.submit 'Save', class: 'btn btn-save'
+ = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel'
diff --git a/app/views/projects/environments/edit.html.haml b/app/views/projects/environments/edit.html.haml
new file mode 100644
index 00000000000..6d1bdb9320f
--- /dev/null
+++ b/app/views/projects/environments/edit.html.haml
@@ -0,0 +1,6 @@
+- page_title "Edit", @environment.name, "Environments"
+
+%h3.page-title
+ Edit environment
+%hr
+= render 'form'
diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml
index a6dd34653ab..b3eb5b0011a 100644
--- a/app/views/projects/environments/index.html.haml
+++ b/app/views/projects/environments/index.html.haml
@@ -23,10 +23,11 @@
New environment
- else
.table-holder
- %table.table.environments
+ %table.table.builds.environments
%tbody
%th Environment
- %th Last deployment
- %th Date
+ %th Last Deployment
+ %th Commit
+ %th
%th
= render @environments
diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml
index 89e06567196..e51667ade2d 100644
--- a/app/views/projects/environments/new.html.haml
+++ b/app/views/projects/environments/new.html.haml
@@ -1,12 +1,6 @@
- page_title 'New Environment'
-.row.prepend-top-default.append-bottom-default
- .col-lg-3
- %h4.prepend-top-0
- New Environment
- %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'
+%h3.page-title
+ New environment
+%hr
+= render 'form'
diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml
index b8b1ce52a91..8f8c1c4ce22 100644
--- a/app/views/projects/environments/show.html.haml
+++ b/app/views/projects/environments/show.html.haml
@@ -6,10 +6,10 @@
.top-area
.col-md-9
%h3.page-title= @environment.name.capitalize
-
.col-md-3
.nav-controls
- if can?(current_user, :update_environment, @environment)
+ = link_to 'Edit', edit_namespace_project_environment_path(@project.namespace, @project, @environment), class: 'btn'
= 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?
@@ -23,13 +23,13 @@
= link_to "Read more", help_page_path("ci/environments"), class: "btn btn-success"
- else
.table-holder
- %table.table.environments
+ %table.table.builds.environments
%thead
%tr
%th ID
%th Commit
%th Build
- %th Date
+ %th
%th
= render @deployments