summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-15 15:50:12 +0000
committerRobert Speicher <robert@gitlab.com>2016-03-15 15:50:12 +0000
commitbbfe15491e496bad0b532b9607d3b380c98206c9 (patch)
treeab249c1756bf9fa68ead6f2d7d0fda2995f8de9a
parent6f50cef8094d9b14d2bdff731f0eeb01c31516bf (diff)
parent89e50a0264c4651b9c2f4ac2981b9b1d95de2875 (diff)
downloadgitlab-ce-bbfe15491e496bad0b532b9607d3b380c98206c9.tar.gz
Merge branch 'ci-fix-double-borders' into 'master'
Fix double borders around the CI status Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14281 Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2760#note_4238291 See merge request !3224
-rw-r--r--app/helpers/ci_status_helper.rb10
-rw-r--r--app/views/projects/ci/builds/_build.html.haml3
-rw-r--r--app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml3
3 files changed, 9 insertions, 7 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index f20779f2fbb..8b1575d5e0c 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -12,9 +12,13 @@ module CiStatusHelper
ci_label_for_status(ci_commit.status)
end
- def ci_status_with_icon(status)
- content_tag :span, class: "ci-status ci-#{status}" do
- ci_icon_for_status(status) + '&nbsp;'.html_safe + ci_label_for_status(status)
+ def ci_status_with_icon(status, target = nil)
+ content = ci_icon_for_status(status) + '&nbsp;'.html_safe + ci_label_for_status(status)
+ klass = "ci-status ci-#{status}"
+ if target
+ link_to content, target, class: klass
+ else
+ content_tag :span, content, class: klass
end
end
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 7123efffd5b..d22d1da8402 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -1,8 +1,7 @@
%tr.build
%td.status
- if can?(current_user, :read_build, build)
- = link_to namespace_project_build_url(build.project.namespace, build.project, build), class: "ci-status ci-#{build.status}" do
- = ci_status_with_icon(build.status)
+ = ci_status_with_icon(build.status, namespace_project_build_url(build.project.namespace, build.project, build))
- else
= ci_status_with_icon(build.status)
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 4143ea13063..c15386b4883 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
@@ -1,8 +1,7 @@
%tr.generic_commit_status
%td.status
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
- = link_to generic_commit_status.target_url, class: "ci-status ci-#{generic_commit_status.status}" do
- = ci_status_with_icon(generic_commit_status.status)
+ = ci_status_with_icon(generic_commit_status.status, generic_commit_status.target_url)
- else
= ci_status_with_icon(generic_commit_status.status)