summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-11 00:15:53 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-06-11 00:15:53 +0200
commit4f00b93ddd07d8a31a04b37dbe150340e84ccfd8 (patch)
treed54658fa105b1bfa311016b28cfb7591689eacba /app/views
parent907c0e6796b69f9577c147dd489cf55748c749ac (diff)
downloadgitlab-ce-4f00b93ddd07d8a31a04b37dbe150340e84ccfd8.tar.gz
Add deployment views
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/deployments/_deployment.html.haml14
-rw-r--r--app/views/projects/environments/_environment.html.haml9
-rw-r--r--app/views/projects/environments/index.html.haml11
-rw-r--r--app/views/projects/environments/new.html.haml15
-rw-r--r--app/views/projects/environments/show.html.haml15
-rw-r--r--app/views/projects/pipelines/_head.html.haml1
6 files changed, 43 insertions, 22 deletions
diff --git a/app/views/projects/deployments/_deployment.html.haml b/app/views/projects/deployments/_deployment.html.haml
index 363c394d6d3..539c297cad3 100644
--- a/app/views/projects/deployments/_deployment.html.haml
+++ b/app/views/projects/deployments/_deployment.html.haml
@@ -1,11 +1,11 @@
%tr.deployment
%td
- %strong= "##{environment.id}"
+ %strong= "##{deployment.iid}"
%td
%div.branch-commit
- if deployment.ref
- = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace"
+ = link_to deployment.ref, namespace_project_commits_path(@project.namespace, @project, deployment.ref), class: "monospace"
&middot;
= link_to deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, deployment.sha), class: "commit-id monospace"
@@ -18,15 +18,13 @@
%td
- if deployment.deployable
- = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable], class: "monospace" do
+ = link_to namespace_project_build_path(@project.namespace, @project, deployment.deployable), class: "monospace" do
= "#{deployment.deployable.name} (##{deployment.deployable.id})"
%td
- %p
- %i.fa.fa-calendar
- &nbsp;
- #{time_ago_with_tooltip(deployment.created_at)}
+ #{time_ago_with_tooltip(deployment.created_at)}
%td
- if can?(current_user, :update_deployment, @project) && deployment.deployable
- = link_to [@project.namespace.becomes(Namespace), @project, deployment.deployable, :retry], method: :post, title: 'Retry', class: 'btn btn-build'
+ .pull-right
+ = link_to 'Retry', retry_namespace_project_build_path(@project.namespace, @project, deployment.deployable), method: :post, class: 'btn btn-build'
diff --git a/app/views/projects/environments/_environment.html.haml b/app/views/projects/environments/_environment.html.haml
index a4c88fface2..16d04832e1a 100644
--- a/app/views/projects/environments/_environment.html.haml
+++ b/app/views/projects/environments/_environment.html.haml
@@ -9,7 +9,7 @@
- if last_deployment
%div.branch-commit
- if last_deployment.ref
- = link_to last.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace"
+ = link_to last_deployment.ref, namespace_project_commits_path(@project.namespace, @project, last_deployment.ref), class: "monospace"
&middot;
= link_to last_deployment.short_sha, namespace_project_commit_path(@project.namespace, @project, last_deployment.sha), class: "commit-id monospace"
@@ -24,9 +24,8 @@
No deployments yet
%td
- %p
- %i.fa.fa-calendar
- &nbsp;
- #{time_ago_with_tooltip(last_deployment.created_at)}
+ - if last_deployment
+ %p
+ #{time_ago_with_tooltip(last_deployment.created_at)}
%td
diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml
index 40d35ef3881..2da8d068e9f 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) }
- .gray-content-block
- Environments for this project
+ - if can?(current_user, :create_environment, @project)
+ .top-area
+ .nav-controls
+ = link_to new_namespace_project_environment_path(@project.namespace, @project), class: 'btn btn-create' do
+ New environment
- %ul.content-list
+ %ul.content-list.environments
- if @environments.blank?
%li
.nothing-here-block No environments to show
- else
.table-holder
- %table.table.builds
+ %table.table
%tbody
%th Environment
%th Last deployment
diff --git a/app/views/projects/environments/new.html.haml b/app/views/projects/environments/new.html.haml
new file mode 100644
index 00000000000..5e8bc596f1e
--- /dev/null
+++ b/app/views/projects/environments/new.html.haml
@@ -0,0 +1,15 @@
+- page_title "New Environment"
+
+%h3.page-title
+ New Environment
+%hr
+
+= form_for @environment, url: namespace_project_environments_path(@project.namespace, @project), html: { id: "new-environment-form", class: "form-horizontal js-new-environment-form js-requires-input" } do |f|
+ = form_errors(@environment)
+ .form-group
+ = f.label :ref, 'Name', class: 'control-label'
+ .col-sm-10
+ = f.text_field :name, required: true, tabindex: 2, class: 'form-control'
+ .form-actions
+ = f.submit 'Create', class: 'btn btn-create', tabindex: 3
+ = link_to 'Cancel', namespace_project_environments_path(@project.namespace, @project), class: 'btn btn-cancel'
diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml
index de5e686044f..dc07ad1a769 100644
--- a/app/views/projects/environments/show.html.haml
+++ b/app/views/projects/environments/show.html.haml
@@ -3,21 +3,26 @@
= render "projects/pipelines/head"
%div{ class: (container_class) }
- .gray-content-block
- Latest deployments for
- %strong= @environment.name
+ .top-area
+ .col-md-9
+ %h3= @environment.name.titleize
+
+ .col-md-3
+ .nav-controls
+ = link_to 'Destroy', namespace_project_environment_path(@project.namespace, @project, @environment), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
%ul.content-list
- if @deployments.blank?
%li
- .nothing-here-block No deployment for specific environment
+ .nothing-here-block No deployments for #{@environment.name}
- else
.table-holder
%table.table.builds
%thead
%tr
+ %th ID
%th Commit
- %th Context
+ %th Build
%th Date
%th
diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml
index 3562d91dfbd..8374cb4223d 100644
--- a/app/views/projects/pipelines/_head.html.haml
+++ b/app/views/projects/pipelines/_head.html.haml
@@ -19,3 +19,4 @@
= link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do
%span
Environments
+ %span.badge.count.environments_counter= number_with_delimiter(@project.environments.count)