Commit 0bd52500 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Move sidebar build class into helper

parent 87222e27
module BuildsHelper
def sidebar_build_class(build, current_build)
build_class = ''
build_class += ' active' if build == current_build
build_class += ' retried' if build.retried?
end
end
......@@ -126,7 +126,7 @@
.builds-container
- statuses.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build|
.build-job{class: ('active' if build == @build; 'retried' if build.retried?), data: {stage: build.stage}}
.build-job{class: sidebar_build_class(build, @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do
= icon('arrow-right')
= ci_icon_for_status(build.status)
......@@ -136,4 +136,4 @@
- else
= build.id
- if build.retried?
%i.fa.fa-refresh.has-tooltip{data: { container: 'body', placement: 'bottom' }, title: 'This build was retried'}
%i.fa.fa-refresh.has-tooltip{data: { container: 'body', placement: 'bottom' }, title: 'Build was retried'}
......@@ -37,7 +37,7 @@
= icon('warning', class: 'text-warning has-tooltip', title: 'Build is stuck. Check runners.')
- if defined?(retried) && retried
= icon('refresh', class: 'text-warning has-tooltip', title: 'Build was retried.')
= icon('refresh', class: 'text-warning has-tooltip', title: 'Build was retried')
.label-container
- if build.tags.any?
......
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