From c96e037dcbe127c6525058a7884fc7c5f2708979 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 15 Mar 2016 14:26:15 +0100 Subject: Fix double borders around the CI status --- app/helpers/ci_status_helper.rb | 10 +++++++--- app/views/projects/ci/builds/_build.html.haml | 3 +-- .../generic_commit_statuses/_generic_commit_status.html.haml | 3 +-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index f20779f2fbb..391d74ebdbf 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) + ' '.html_safe + ci_label_for_status(status) + def ci_status_with_icon(status, target = nil) + content = ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) + clazz = "ci-status ci-#{status}" + if target + link_to content, target, class: clazz + else + content_tag :span, content, class: clazz 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) -- cgit v1.2.1 From 89e50a0264c4651b9c2f4ac2981b9b1d95de2875 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 15 Mar 2016 16:08:32 +0100 Subject: Use klass instead of clazz --- app/helpers/ci_status_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 391d74ebdbf..8b1575d5e0c 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -14,11 +14,11 @@ module CiStatusHelper def ci_status_with_icon(status, target = nil) content = ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) - clazz = "ci-status ci-#{status}" + klass = "ci-status ci-#{status}" if target - link_to content, target, class: clazz + link_to content, target, class: klass else - content_tag :span, content, class: clazz + content_tag :span, content, class: klass end end -- cgit v1.2.1