diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-03-15 14:26:15 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-03-15 14:29:02 +0100 |
commit | c96e037dcbe127c6525058a7884fc7c5f2708979 (patch) | |
tree | 674d6b5b4fc82de164bba3cb1b7a879c068e4e6a /app | |
parent | ea7d062fa60e3e622288237fc66a815348bbcf36 (diff) | |
download | gitlab-ce-c96e037dcbe127c6525058a7884fc7c5f2708979.tar.gz |
Fix double borders around the CI status
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/ci_status_helper.rb | 10 | ||||
-rw-r--r-- | app/views/projects/ci/builds/_build.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml | 3 |
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..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) |