[refs #223] Fix build status color helpers

This commit is contained in:
konstantin.grabar 2012-03-19 12:39:46 +04:00
parent b3d7091db0
commit 348fd40daf
3 changed files with 17 additions and 14 deletions

View File

@ -463,6 +463,19 @@ table.tablesorter tr td.buttons a span.delete {
#fork-and-edit {display:block;}
.notify.blue div.success {
border: 1px solid #bad099;
background: #d7e599;
float: left;
}
div.notify.blue div.error {
float: left;
border: 1px solid #ddd;
background-color: #FBE3E4;
border-color: #FBC2C4;
}
div.notify.blue div.nocolor {
float: left;
border: 1px solid #a9c6dd;

View File

@ -1,11 +1,11 @@
module BuildListsHelper
def build_list_status_color(status)
if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status
return 'green'
return 'success'
end
if [BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND,
BuildServer::PROJECT_NOT_FOUND,BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? status
return 'red'
return 'error'
end
'nocolor'
@ -21,14 +21,4 @@ module BuildListsHelper
''
end
def build_list_status(build_list)
if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? build_list.status
"success"
elsif [BuildServer::BUILD_ERROR, BuildServer::PLATFORM_NOT_FOUND, BuildServer::PROJECT_NOT_FOUND,
BuildServer::PROJECT_VERSION_NOT_FOUND, BuildList::FAILED_PUBLISH].include? build_list.status
"error"
end
end
end

View File

@ -1,4 +1,4 @@
%tr{:id => "row#{build_list_counter}", :class => "#{build_list_status(build_list)}"}
%tr{:id => "row#{build_list_counter}", :class => "#{build_list_status_color(build_list.status)}"}
%td= link_to (build_list.bs_id.present? ? build_list.bs_id : t("layout.build_lists.bs_id_not_set")), build_list
%td= build_list.human_status
%td= link_to build_list.project.name, build_list.project