Move rendering CI status to helper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
7b06c83cf7
commit
696a708401
4 changed files with 10 additions and 8 deletions
|
@ -42,4 +42,11 @@ module CiStatusHelper
|
|||
|
||||
icon(icon_name)
|
||||
end
|
||||
|
||||
def render_ci_status(ci_commit)
|
||||
link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
|
||||
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
|
||||
ci_status_icon(ci_commit)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
|
||||
.pull-right
|
||||
- if ci_commit
|
||||
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}" do
|
||||
= ci_status_icon(ci_commit)
|
||||
= render_ci_status(ci_commit)
|
||||
|
||||
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
|
||||
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
= link_to_label(label, project: merge_request.project)
|
||||
.pull-right.light
|
||||
- if ci_commit
|
||||
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
|
||||
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
|
||||
= ci_status_icon(ci_commit)
|
||||
= render_ci_status(ci_commit)
|
||||
- if merge_request.merged?
|
||||
%span
|
||||
%i.fa.fa-check
|
||||
|
|
|
@ -21,9 +21,7 @@
|
|||
.project-controls
|
||||
- if ci && !project.empty_repo? && project.commit
|
||||
- if ci_commit = project.ci_commit(project.commit.sha)
|
||||
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}",
|
||||
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
|
||||
= ci_status_icon(ci_commit)
|
||||
= render_ci_status(ci_commit)
|
||||
|
||||
- if stars
|
||||
%span
|
||||
|
|
Loading…
Reference in a new issue