Commit e8666898 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Style CI project/build list

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0aec0d53
...@@ -13,31 +13,6 @@ ...@@ -13,31 +13,6 @@
.builds, .builds,
.projects-table { .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 { .light {
border-color: $border-color; border-color: $border-color;
} }
...@@ -47,8 +22,8 @@ ...@@ -47,8 +22,8 @@
} }
td { td {
color: $gl-gray;
vertical-align: middle !important; vertical-align: middle !important;
border-color: inherit !important;
a { a {
font-weight: normal; font-weight: normal;
......
...@@ -16,15 +16,15 @@ module Ci ...@@ -16,15 +16,15 @@ module Ci
ci_project_build_url(build.project, build) ci_project_build_url(build.project, build)
end end
def build_status_alert_class(build) def build_status_css_class(build)
if build.success? if build.success?
'alert-success' 'build-success'
elsif build.failed? elsif build.failed?
'alert-danger' 'build-danger'
elsif build.canceled? elsif build.canceled?
'alert-disabled' 'build-disabled'
else else
'alert-warning' 'build-warning'
end end
end end
......
module Ci module Ci
module CommitsHelper module CommitsHelper
def commit_status_alert_class(commit) def commit_status_css_class(commit)
return 'alert-info' unless commit return 'build-info' unless commit
case commit.status case commit.status
when 'success' when 'success'
'alert-success' 'build-success'
when 'failed', 'canceled' when 'failed', 'canceled'
'alert-danger' 'build-danger'
when 'skipped' when 'skipped'
'alert-disabled' 'build-disabled'
else else
'alert-warning' 'build-warning'
end end
end end
......
- if build.commit && build.project - 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 %td.build-link
= link_to ci_project_build_url(build.project, build) do = link_to ci_project_build_url(build.project, build) do
%strong #{build.id} %strong #{build.id}
......
- last_commit = project.last_commit - last_commit = project.last_commit
%tr.alert{class: commit_status_alert_class(last_commit) } %tr{class: commit_status_css_class(last_commit) }
%td %td
= project.id = project.id
%td %td
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
%th Finished at %th Finished at
- @builds.each do |build| - @builds.each do |build|
%tr.build.alert{class: build_status_alert_class(build)} %tr.build.alert{class: build_status_css_class(build)}
%td.status %td.status
= build.status = build.status
......
%tr.build.alert{class: build_status_alert_class(build)} %tr.build{class: build_status_css_class(build)}
%td.status %td.status
= build.status = build.status
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
.row .row
.col-md-9 .col-md-9
.build-head.alert{class: build_status_alert_class(@build)} .build-head.alert{class: build_status_css_class(@build)}
%h4 %h4
- if @build.commit.tag? - if @build.commit.tag?
Build for tag Build for tag
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
%h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}: %h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}:
%table.builds %table.builds
- @builds.each_with_index do |build, i| - @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 %td
= link_to ci_project_build_url(@project, build) do = link_to ci_project_build_url(@project, build) do
%span ##{build.id} %span ##{build.id}
......
%tr.build.alert{class: commit_status_alert_class(commit)} %tr.build{class: commit_status_css_class(commit)}
%td.status %td.status
= commit.status = commit.status
- if commit.running? - if commit.running?
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
%h3 Status %h3 Status
.build.alert{class: commit_status_alert_class(@commit)} .build.alert{class: commit_status_css_class(@commit)}
.status .status
= @commit.status.titleize = @commit.status.titleize
......
- last_commit = project.last_commit - last_commit = project.last_commit
%tr.alert{class: commit_status_alert_class(last_commit) } %tr{class: commit_status_css_class(last_commit) }
%td %td
= link_to [:ci, project] do = link_to [:ci, project] do
= project.name = project.name
......
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