summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-16 17:09:04 -0500
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-16 17:09:04 -0500
commit7657d202160e04e6b5e5412d949977bc48cdacea (patch)
treef6c86360546074bb42b8f8a60765274d3e5da6b7
parentbf4dc75801176c95b49763ff6ab5e03305c91f73 (diff)
downloadgitlab-ce-7657d202160e04e6b5e5412d949977bc48cdacea.tar.gz
Improve design of commit_box with status of builds and pipelines
-rw-r--r--app/views/projects/commit/_builds.html.haml2
-rw-r--r--app/views/projects/commit/_ci_commit.html.haml29
-rw-r--r--app/views/projects/commit/_commit_box.html.haml35
3 files changed, 37 insertions, 29 deletions
diff --git a/app/views/projects/commit/_builds.html.haml b/app/views/projects/commit/_builds.html.haml
index 5c9a319edeb..7f7a15aa214 100644
--- a/app/views/projects/commit/_builds.html.haml
+++ b/app/views/projects/commit/_builds.html.haml
@@ -1,2 +1,2 @@
- @ci_commits.each do |ci_commit|
- = render "ci_commit", ci_commit: ci_commit
+ = render "ci_commit", ci_commit: ci_commit, pipeline_details: true
diff --git a/app/views/projects/commit/_ci_commit.html.haml b/app/views/projects/commit/_ci_commit.html.haml
index 0ff679d0e3d..df92a38db31 100644
--- a/app/views/projects/commit/_ci_commit.html.haml
+++ b/app/views/projects/commit/_ci_commit.html.haml
@@ -7,20 +7,21 @@
- if ci_commit.builds.running_or_pending.any?
= link_to "Cancel running", cancel_namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), data: { confirm: 'Are you sure?' }, class: 'btn btn-grouped btn-danger', method: :post
- .oneline
- Pipeline
- = link_to "##{ci_commit.id}", namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), class: "monospace"
- with
- = pluralize ci_commit.statuses.count(:id), "build"
- - if ci_commit.ref
- for
- = link_to ci_commit.ref, namespace_project_commits_path(@project.namespace, @project, ci_commit.ref), class: "monospace"
- - if defined?(link_to_commit) && link_to_commit
- for commit
- = link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
- - if ci_commit.duration
- in
- = time_interval_in_words ci_commit.duration
+ - if defined?(pipeline_details) && pipeline_details
+ .oneline
+ Pipeline
+ = link_to "##{ci_commit.id}", namespace_project_pipeline_path(@project.namespace, @project, ci_commit.id), class: "monospace"
+ with
+ = pluralize ci_commit.statuses.count(:id), "build"
+ - if ci_commit.ref
+ for
+ = link_to ci_commit.ref, namespace_project_commits_path(@project.namespace, @project, ci_commit.ref), class: "monospace"
+ - if defined?(link_to_commit) && link_to_commit
+ for commit
+ = link_to ci_commit.short_sha, namespace_project_commit_path(@project.namespace, @project, ci_commit.sha), class: "monospace"
+ - if ci_commit.duration
+ in
+ = time_interval_in_words ci_commit.duration
- if ci_commit.yaml_errors.present?
.bs-callout.bs-callout-danger
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index 30ec47cc8e3..611272b8a74 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -23,20 +23,6 @@
%p
.commit-info-row
- - if defined?(pipeline) && pipeline
- .pull-right
- = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status ci-#{pipeline.status}" do
- = ci_icon_for_status(pipeline.status)
- Pipeline:
- = ci_label_for_status(pipeline.status)
-
- - elsif @commit.status
- .pull-right
- = link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status ci-#{@commit.status}" do
- = ci_icon_for_status(@commit.status)
- Build:
- = ci_label_for_status(@commit.status)
-
%span.light Authored by
%strong
= commit_author_link(@commit, avatar: true, size: 24)
@@ -60,6 +46,27 @@
%span.commit-info.branches
%i.fa.fa-spinner.fa-spin
+- if defined?(pipeline) && pipeline
+ .commit-info-row
+ Pipeline
+ = link_to namespace_project_pipeline_path(@project.namespace, @project, pipeline), class: "ci-status-link ci-status-icon-#{pipeline.status}" do
+ = ci_icon_for_status(pipeline.status)
+ = ci_label_for_status(pipeline.status)
+ - if pipeline.duration
+ in
+ = time_interval_in_words 3600
+
+- elsif @commit.status
+ .commit-info-row
+ Builds for
+ = pluralize(@commit.ci_commits.count, 'pipeline')
+ = link_to builds_namespace_project_commit_path(@project.namespace, @project, @commit.id), class: "ci-status-link ci-status-icon-#{@commit.status}" do
+ = ci_icon_for_status(@commit.status)
+ = ci_label_for_status(@commit.status)
+ - if @commit.ci_commits.duration
+ in
+ = time_interval_in_words @commit.ci_commits.duration
+
.commit-box.content-block
%h3.commit-title
= markdown escape_once(@commit.title), pipeline: :single_line