summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-12 13:28:02 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-12 13:28:02 +0100
commitdc67554c08ac6cfe23809af9f086336ca9ca740e (patch)
treea1b19de9def76953bc1befaff1653eb768fba070
parent23f02681c036b150966ce4459410c94694167b34 (diff)
downloadgitlab-ce-dc67554c08ac6cfe23809af9f086336ca9ca740e.tar.gz
Improve detailed status badge partial
-rw-r--r--app/views/admin/runners/show.html.haml2
-rw-r--r--app/views/ci/status/_badge.html.haml8
-rw-r--r--app/views/ci/status/_icon_with_description.html.haml12
-rw-r--r--app/views/projects/builds/_header.html.haml2
-rw-r--r--app/views/projects/ci/builds/_build.html.haml2
-rw-r--r--app/views/projects/ci/pipelines/_pipeline.html.haml2
-rw-r--r--app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml2
-rw-r--r--app/views/projects/pipelines/_info.html.haml2
8 files changed, 14 insertions, 18 deletions
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
index badeb11b208..ca503e35623 100644
--- a/app/views/admin/runners/show.html.haml
+++ b/app/views/admin/runners/show.html.haml
@@ -91,7 +91,7 @@
%strong ##{build.id}
%td.status
- = render "ci/status/icon_with_description", subject: build
+ = render 'ci/status/badge', status: build.detailed_status(current_user)
%td.status
- if project
diff --git a/app/views/ci/status/_badge.html.haml b/app/views/ci/status/_badge.html.haml
new file mode 100644
index 00000000000..b1b6e9c2b05
--- /dev/null
+++ b/app/views/ci/status/_badge.html.haml
@@ -0,0 +1,8 @@
+- if status.has_details?
+ = link_to status.details_path, class: "ci-status ci-#{status}" do
+ = custom_icon(status.icon)
+ = status.text
+- else
+ %span{ class: "ci-status ci-#{status}" }
+ = custom_icon(status.icon)
+ = detailed_status.text
diff --git a/app/views/ci/status/_icon_with_description.html.haml b/app/views/ci/status/_icon_with_description.html.haml
deleted file mode 100644
index 34c923440d0..00000000000
--- a/app/views/ci/status/_icon_with_description.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-- detailed_status = subject.detailed_status(current_user)
-- details_path = detailed_status.details_path if detailed_status.has_details?
-- klass = "ci-status ci-#{detailed_status}"
-
-- if details_path
- = link_to details_path, class: klass do
- = custom_icon(detailed_status.icon)
- = detailed_status.text
-- else
- %span{ class: klass }
- = custom_icon(detailed_status.icon)
- = detailed_status.text
diff --git a/app/views/projects/builds/_header.html.haml b/app/views/projects/builds/_header.html.haml
index 85d1793ecb9..057a720a54a 100644
--- a/app/views/projects/builds/_header.html.haml
+++ b/app/views/projects/builds/_header.html.haml
@@ -1,6 +1,6 @@
.content-block.build-header
.header-content
- = render "ci/status/icon_with_description", subject: build
+ = render 'ci/status/badge', status: @build.detailed_status(current_user)
Build
%strong ##{@build.id}
in pipeline
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 4257bb86859..f1cb0201032 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -9,7 +9,7 @@
%tr.build.commit{class: ('retried' if retried)}
%td.status
- = render "ci/status/icon_with_description", subject: build
+ = render "ci/status/badge", status: build.detailed_status(current_user)
%td.branch-commit
- if can?(current_user, :read_build, build)
diff --git a/app/views/projects/ci/pipelines/_pipeline.html.haml b/app/views/projects/ci/pipelines/_pipeline.html.haml
index 6dff955ea3d..3f05a21990f 100644
--- a/app/views/projects/ci/pipelines/_pipeline.html.haml
+++ b/app/views/projects/ci/pipelines/_pipeline.html.haml
@@ -4,7 +4,7 @@
%tr.commit
%td.commit-link
- = render "ci/status/icon_with_description", subject: pipeline
+ = render 'ci/status/badge', status: pipeline.detailed_status(current_user)
%td
= link_to namespace_project_pipeline_path(pipeline.project.namespace, pipeline.project, pipeline.id) do
diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
index 1dd07ae1a2a..9f444f076c0 100644
--- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
+++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
@@ -8,7 +8,7 @@
%tr.generic_commit_status{class: ('retried' if retried)}
%td.status
- = render "ci/status/icon_with_description", subject: generic_commit_status
+ = render 'ci/status/badge', status: generic_commit_status.detailed_status(current_user)
%td.generic_commit_status-link
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index d05697b4ee3..b00ba2d5307 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -1,6 +1,6 @@
.page-content-header
.header-main-content
- = render "ci/status/icon_with_description", subject: @pipeline
+ = render 'ci/status/badge', status: @pipeline.detailed_status(current_user)
%strong Pipeline ##{@commit.pipelines.last.id}
triggered #{time_ago_with_tooltip(@commit.authored_date)} by
= author_avatar(@commit, size: 24)