blob: 9f4eb116cb66484755dde3d81985046f07dc713c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
module BuildsHelper
def build_ref_link build
if build.commit.gitlab?
gitlab_ref_link build.project, build.ref
else
build.ref
end
end
def build_compare_link build
if build.commit.gitlab?
gitlab_compare_link build.project, build.commit.short_before_sha, build.short_sha
end
end
def build_commit_link build
if build.commit.gitlab?
gitlab_commit_link build.project, build.short_sha
else
build.short_sha
end
end
def build_url(build)
project_build_url(build.project, build)
end
def build_status_alert_class(build)
if build.success?
'alert-success'
elsif build.failed?
'alert-danger'
elsif build.canceled?
'alert-disabled'
else
'alert-warning'
end
end
def build_icon_css_class(build)
if build.success?
'icon-circle cgreen'
elsif build.failed?
'icon-circle cred'
else
'icon-circle light'
end
end
end
|