Style CI project/build list
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
0aec0d53b1
commit
e86668984f
11 changed files with 21 additions and 46 deletions
|
@ -13,31 +13,6 @@
|
|||
|
||||
.builds,
|
||||
.projects-table {
|
||||
.alert-success {
|
||||
background-color: #6fc995;
|
||||
border-color: #5bba83;
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
background-color: #eb897f;
|
||||
border-color: #d4776e;
|
||||
}
|
||||
|
||||
.alert-info {
|
||||
background-color: #3498db;
|
||||
border-color: #2e8ece;
|
||||
}
|
||||
|
||||
.alert-warning {
|
||||
background-color: #EB974E;
|
||||
border-color: #E87E04;
|
||||
}
|
||||
|
||||
.alert-disabled {
|
||||
background: $background-color;
|
||||
border-color: $border-color;
|
||||
}
|
||||
|
||||
.light {
|
||||
border-color: $border-color;
|
||||
}
|
||||
|
@ -47,8 +22,8 @@
|
|||
}
|
||||
|
||||
td {
|
||||
color: $gl-gray;
|
||||
vertical-align: middle !important;
|
||||
border-color: inherit !important;
|
||||
|
||||
a {
|
||||
font-weight: normal;
|
||||
|
|
|
@ -16,15 +16,15 @@ module Ci
|
|||
ci_project_build_url(build.project, build)
|
||||
end
|
||||
|
||||
def build_status_alert_class(build)
|
||||
def build_status_css_class(build)
|
||||
if build.success?
|
||||
'alert-success'
|
||||
'build-success'
|
||||
elsif build.failed?
|
||||
'alert-danger'
|
||||
'build-danger'
|
||||
elsif build.canceled?
|
||||
'alert-disabled'
|
||||
'build-disabled'
|
||||
else
|
||||
'alert-warning'
|
||||
'build-warning'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
module Ci
|
||||
module CommitsHelper
|
||||
def commit_status_alert_class(commit)
|
||||
return 'alert-info' unless commit
|
||||
def commit_status_css_class(commit)
|
||||
return 'build-info' unless commit
|
||||
|
||||
case commit.status
|
||||
when 'success'
|
||||
'alert-success'
|
||||
'build-success'
|
||||
when 'failed', 'canceled'
|
||||
'alert-danger'
|
||||
'build-danger'
|
||||
when 'skipped'
|
||||
'alert-disabled'
|
||||
'build-disabled'
|
||||
else
|
||||
'alert-warning'
|
||||
'build-warning'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- if build.commit && build.project
|
||||
%tr.build.alert{class: build_status_alert_class(build)}
|
||||
%tr.build{class: build_status_css_class(build)}
|
||||
%td.build-link
|
||||
= link_to ci_project_build_url(build.project, build) do
|
||||
%strong #{build.id}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- last_commit = project.last_commit
|
||||
%tr.alert{class: commit_status_alert_class(last_commit) }
|
||||
%tr{class: commit_status_css_class(last_commit) }
|
||||
%td
|
||||
= project.id
|
||||
%td
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
%th Finished at
|
||||
|
||||
- @builds.each do |build|
|
||||
%tr.build.alert{class: build_status_alert_class(build)}
|
||||
%tr.build.alert{class: build_status_css_class(build)}
|
||||
%td.status
|
||||
= build.status
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%tr.build.alert{class: build_status_alert_class(build)}
|
||||
%tr.build{class: build_status_css_class(build)}
|
||||
%td.status
|
||||
= build.status
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
.row
|
||||
.col-md-9
|
||||
.build-head.alert{class: build_status_alert_class(@build)}
|
||||
.build-head.alert{class: build_status_css_class(@build)}
|
||||
%h4
|
||||
- if @build.commit.tag?
|
||||
Build for tag
|
||||
|
@ -150,7 +150,7 @@
|
|||
%h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}:
|
||||
%table.builds
|
||||
- @builds.each_with_index do |build, i|
|
||||
%tr.build.alert{class: build_status_alert_class(build)}
|
||||
%tr.build.alert{class: build_status_css_class(build)}
|
||||
%td
|
||||
= link_to ci_project_build_url(@project, build) do
|
||||
%span ##{build.id}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%tr.build.alert{class: commit_status_alert_class(commit)}
|
||||
%tr.build{class: commit_status_css_class(commit)}
|
||||
%td.status
|
||||
= commit.status
|
||||
- if commit.running?
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
%h3 Status
|
||||
|
||||
.build.alert{class: commit_status_alert_class(@commit)}
|
||||
.build.alert{class: commit_status_css_class(@commit)}
|
||||
.status
|
||||
= @commit.status.titleize
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- last_commit = project.last_commit
|
||||
%tr.alert{class: commit_status_alert_class(last_commit) }
|
||||
%tr{class: commit_status_css_class(last_commit) }
|
||||
%td
|
||||
= link_to [:ci, project] do
|
||||
= project.name
|
||||
|
|
Loading…
Reference in a new issue