Commit 696a7084 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move rendering CI status to helper

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7b06c83c
...@@ -42,4 +42,11 @@ module CiStatusHelper ...@@ -42,4 +42,11 @@ module CiStatusHelper
icon(icon_name) icon(icon_name)
end 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 end
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
.pull-right .pull-right
- if ci_commit - if ci_commit
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}" do = render_ci_status(ci_commit)
= ci_status_icon(ci_commit)
&nbsp; &nbsp;
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id" = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
= link_to_label(label, project: merge_request.project) = link_to_label(label, project: merge_request.project)
.pull-right.light .pull-right.light
- if ci_commit - if ci_commit
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}", = render_ci_status(ci_commit)
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
= ci_status_icon(ci_commit)
- if merge_request.merged? - if merge_request.merged?
%span %span
%i.fa.fa-check %i.fa.fa-check
......
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
.project-controls .project-controls
- if ci && !project.empty_repo? && project.commit - if ci && !project.empty_repo? && project.commit
- if ci_commit = project.ci_commit(project.commit.sha) - if ci_commit = project.ci_commit(project.commit.sha)
= link_to ci_status_path(ci_commit), class: "c#{ci_status_color(ci_commit)}", = render_ci_status(ci_commit)
title: "Build status: #{ci_commit.status}", data: {toggle: 'tooltip', placement: 'left'} do
= ci_status_icon(ci_commit)
&nbsp; &nbsp;
- if stars - if stars
%span %span
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment