From 4b26eebeca955d1a8d3fc1afd48893ab6af26a8f Mon Sep 17 00:00:00 2001 From: "konstantin.grabar" Date: Sun, 18 Mar 2012 12:20:31 +0400 Subject: [PATCH] [refs #223] Add new design to build list task page --- app/assets/stylesheets/design/custom.scss | 12 ++ app/assets/stylesheets/design/main.scss | 35 ++++ app/helpers/build_lists_helper.rb | 24 +++ app/views/build_lists/_submenu.html.haml | 14 +- app/views/build_lists/show.html.haml | 234 +++++++++++++++------- config/locales/models/build_list.en.yml | 1 + config/locales/models/build_list.ru.yml | 1 + doc/design/abf-monitoring task.html | 204 +++++++++++++++++++ doc/design/styles/main.css | 67 ++++++- spec/helpers/build_lists_helper_spec.rb | 15 ++ 10 files changed, 518 insertions(+), 89 deletions(-) create mode 100644 app/helpers/build_lists_helper.rb create mode 100644 doc/design/abf-monitoring task.html create mode 100644 spec/helpers/build_lists_helper_spec.rb diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 10698998f..cc3e2ad3e 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -444,3 +444,15 @@ table.wiki .history .td2 .name span.username { } #fork-and-edit {display:block;} + +div.notify.blue div.nocolor { + float: left; + border: 1px solid #a9c6dd; +} + +div.notify.blue div.red { + float: left; + border: 1px solid #ddd; + background-color: #FBE3E4; + border-color: #FBC2C4; +} diff --git a/app/assets/stylesheets/design/main.scss b/app/assets/stylesheets/design/main.scss index bc13f0e97..6a1c2ed45 100644 --- a/app/assets/stylesheets/design/main.scss +++ b/app/assets/stylesheets/design/main.scss @@ -1590,6 +1590,10 @@ table td.width145 { width: 145px; } +.width125 { + width: 125px; +} + table td.width30 { width: 30px; } @@ -1941,6 +1945,21 @@ img.delete-row { cursor: pointer; } +table tbody tr.error td { + background: #fedede; +} + +table tbody tr.success td { + background: #e3edb7; +} + +table.tablesorter.width565 { + width: 565px; +} + +table.tablesorter thead th { + padding-left: 5px; +} /* Create group */ @@ -2101,6 +2120,22 @@ article div.rightlist div.load { padding: 5px 10px; } +.notify.blue { + border: 1px solid #a9c6dd; + background: #dcecfa; + border-radius: 1px; + width: 555px; + margin-top: 20px; + text-align: right; + padding: 5px; +} + +.notify.blue div.green { + border: 1px solid #bad099; + background: #d7e599; + float: left; +} + /* Pagination */ div.pagination em { diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb new file mode 100644 index 000000000..c351afae1 --- /dev/null +++ b/app/helpers/build_lists_helper.rb @@ -0,0 +1,24 @@ +module BuildListsHelper + def build_list_status_color(status) + if [BuildList::BUILD_PUBLISHED, BuildServer::SUCCESS].include? status + return 'green' + 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' + end + + 'nocolor' + end + + def build_list_item_status_color(status) + if BuildServer::SUCCESS == status + return 'success' + end + if [BuildServer::DEPENDENCIES_ERROR, BuildServer::BUILD_ERROR, BuildList::Item::GIT_ERROR].include? status + return 'error' + end + + '' + end +end diff --git a/app/views/build_lists/_submenu.html.haml b/app/views/build_lists/_submenu.html.haml index 06ade1465..e329b7afb 100644 --- a/app/views/build_lists/_submenu.html.haml +++ b/app/views/build_lists/_submenu.html.haml @@ -1,7 +1,11 @@ - content_for :submenu do - - if content_for?(:sidebar) + - if @build_list .left - %nav - %ul - %li= link_to t('layout.projects.list_header'), build_lists_path, :class => (params[:controller] == 'build_lists' ? 'active' : nil) - %li= link_to t('layout.products.list_header'), '#' \ No newline at end of file + = @build_list.project.name + - else + - if content_for?(:sidebar) + .left + %nav + %ul + %li= link_to t('layout.projects.list_header'), build_lists_path, :class => (params[:controller] == 'build_lists' ? 'active' : nil) + %li= link_to t('layout.products.list_header'), '#' diff --git a/app/views/build_lists/show.html.haml b/app/views/build_lists/show.html.haml index 486d3afd6..d07fd2131 100644 --- a/app/views/build_lists/show.html.haml +++ b/app/views/build_lists/show.html.haml @@ -1,81 +1,161 @@ -%table.columns2.info - %tr - %td.first= t("activerecord.attributes.build_list.name") - %td= @build_list.present? ? @build_list.name : t("layout.build_lists.name_not_yet_defined") - %tr - %td= t("activerecord.attributes.build_list.bs_id") - %td= @build_list.bs_id - %tr - %td= t("activerecord.attributes.build_list.container_path") - %td - - if @build_list.status == BuildList::BUILD_PUBLISHED - = t("layout.build_lists.container_published") - - elsif @build_list.container_path.present? - - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" - = link_to container_url, container_url - %tr - %td= t("activerecord.attributes.build_list.bpl") - %td= link_to @build_list.bpl.name, @build_list.bpl - %tr - %td= t("activerecord.attributes.build_list.pl") - %td= link_to @build_list.pl.name, @build_list.pl - %tr - %td= t("activerecord.attributes.build_list.include_repos") - %td= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') - %tr - %td= t("activerecord.attributes.build_list.update_type") - %td= @build_list.update_type - %tr - %td= t("activerecord.attributes.build_list.build_requires") - %td= @build_list.build_requires - %tr - %td= t("activerecord.attributes.build_list.auto_publish") - %td= @build_list.auto_publish - %tr - %td= t("activerecord.attributes.build_list.status") - %td= @build_list.human_status - %tr - %td= t("activerecord.attributes.build_list.project") - %td= link_to @build_list.project.name, project_path(@build_list.project) - %tr - %td= t("activerecord.attributes.build_list.project_version") - %td= @build_list.project_version - %tr - %td= t("activerecord.attributes.build_list.arch") - %td= @build_list.arch.name - %tr - %td= t("activerecord.attributes.build_list.user") - %td= link_to @build_list.user.try(:fullname), @build_list.user - %tr - %td= t("activerecord.attributes.build_list.notified_at") - %td= @build_list.notified_at - %tr - %td= t("activerecord.attributes.build_list.is_circle") - %td= t("layout.#{@build_list.is_circle?}_") - -%br -%br - -= link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button" if @build_list.can_publish? and can?(:publish, @build_list) - -%br -%br - -%h2= t("layout.build_lists.items_header") -= t("layout.build_lists.no_items_data") if @item_groups.blank? - +.notify.blue + %div{:class => build_list_status_color(@build_list.status)} + %p= @build_list.human_status + %p 2012-01-27 17:28:05 UTC + .both +%h3= t("layout.build_lists.main_data") +.leftside.width125= t("activerecord.attributes.build_list.container_path") +.leftside + - if @build_list.status == BuildList::BUILD_PUBLISHED + = t("layout.build_lists.container_published") + - elsif @build_list.container_path.present? + - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" + = link_to container_url, container_url +.both +.leftside.width125= t("activerecord.attributes.build_list.user") +.leftside + = link_to @build_list.user.try(:fullname), @build_list.user +.both += link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button tmargin10" if @build_list.can_publish? and can?(:publish, @build_list) +.hr +%h3= t("layout.build_lists.main_data") +.leftside.width125= t("activerecord.attributes.build_list.bpl") +.leftside + = link_to @build_list.bpl.name, @build_list.bpl +.both +.leftside.width125= t("activerecord.attributes.build_list.pl") +.leftside + = link_to @build_list.pl.name, @build_list.pl +.both +.leftside.width125= t("activerecord.attributes.build_list.include_repos") +.leftside= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') +.both +.leftside.width125= t("activerecord.attributes.build_list.update_type") +.leftside= @build_list.update_type +.both +.leftside.width125= t("activerecord.attributes.build_list.build_requires") +.leftside= @build_list.build_requires +.both +.leftside.width125= t("activerecord.attributes.build_list.auto_publish") +.leftside= @build_list.auto_publish +.both +.leftside.width125= t("activerecord.attributes.build_list.project_version") +.leftside= @build_list.project_version +.both +.leftside.width125= t("activerecord.attributes.build_list.arch") +.leftside= @build_list.arch.name +.both +.leftside.width125= t("activerecord.attributes.build_list.notified_at") +.leftside= @build_list.notified_at +.both +.leftside.width125= t("activerecord.attributes.build_list.is_circle") +.leftside= t("layout.#{@build_list.is_circle?}_") +.both +.leftside.width125 Recurrent +.leftside false +.both +.hr +%h3= t("layout.build_lists.items_header") +- if @item_groups.blank? + %h4.nomargin= t("layout.build_lists.no_items_data") - @item_groups.each_with_index do |group, level| - %h3.title Level ##{level} - %table.columns3.info - %tr - %th.first= t("activerecord.attributes.build_list/item.name") - %th= t("activerecord.attributes.build_list/item.version") - %th.last= t("activerecord.attributes.build_list/item.status") + -#%h4.nomargin= "#{group} ##{level}" + - group.each do |item| + %h4.nomargin= "#{item.name} ##{level}" + %table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"} + %thead + %tr + %th= t("activerecord.attributes.build_list/item.name") + %th= t("activerecord.attributes.build_list/item.version") + %th= t("activerecord.attributes.build_list/item.status") + %tbody + %tr{:class => build_list_item_status_color(item.status)} + %td= item.name + %td= item.version + %td= item.human_status +.both - - group.each do |item| - %tr{:class => cycle("odd", "even")} - %td= item.name - %td= item.version - %td= item.human_status +:javascript + $('article .all').addClass('bigpadding'); + +-#%table.columns2.info +-# %tr +-# %td.first= t("activerecord.attributes.build_list.name") +-# %td= @build_list.present? ? @build_list.name : t("layout.build_lists.name_not_yet_defined") +-# %tr +-# %td= t("activerecord.attributes.build_list.bs_id") +-# %td= @build_list.bs_id +-# %tr +-# %td= t("activerecord.attributes.build_list.container_path") +-# %td +-# - if @build_list.status == BuildList::BUILD_PUBLISHED +-# = t("layout.build_lists.container_published") +-# - elsif @build_list.container_path.present? +-# - container_url = "http://#{request.host_with_port}/downloads#{@build_list.container_path}" +-# = link_to container_url, container_url +-# %tr +-# %td= t("activerecord.attributes.build_list.bpl") +-# %td= link_to @build_list.bpl.name, @build_list.bpl +-# %tr +-# %td= t("activerecord.attributes.build_list.pl") +-# %td= link_to @build_list.pl.name, @build_list.pl +-# %tr +-# %td= t("activerecord.attributes.build_list.include_repos") +-# %td= (@build_list.include_repos||[]).map{|r| Repository.find(r).name}.join(', ') +-# %tr +-# %td= t("activerecord.attributes.build_list.update_type") +-# %td= @build_list.update_type +-# %tr +-# %td= t("activerecord.attributes.build_list.build_requires") +-# %td= @build_list.build_requires +-# %tr +-# %td= t("activerecord.attributes.build_list.auto_publish") +-# %td= @build_list.auto_publish +-# %tr +-# %td= t("activerecord.attributes.build_list.status") +-# %td= @build_list.human_status +-# %tr +-# %td= t("activerecord.attributes.build_list.project") +-# %td= link_to @build_list.project.name, project_path(@build_list.project) +-# %tr +-# %td= t("activerecord.attributes.build_list.project_version") +-# %td= @build_list.project_version +-# %tr +-# %td= t("activerecord.attributes.build_list.arch") +-# %td= @build_list.arch.name +-# %tr +-# %td= t("activerecord.attributes.build_list.user") +-# %td= link_to @build_list.user.try(:fullname), @build_list.user +-# %tr +-# %td= t("activerecord.attributes.build_list.notified_at") +-# %td= @build_list.notified_at +-# %tr +-# %td= t("activerecord.attributes.build_list.is_circle") +-# %td= t("layout.#{@build_list.is_circle?}_") +-# +-#%br +-#%br +-# +-#= link_to t("layout.publish"), publish_build_list_path(@build_list), :method => "put", :confirm => t("layout.confirm"), :class => "button" if @build_list.can_publish? and can?(:publish, @build_list) +-# +-#%br +-#%br +-# +-#%h2= t("layout.build_lists.items_header") +-#= t("layout.build_lists.no_items_data") if @item_groups.blank? +-# +-#- @item_groups.each_with_index do |group, level| +-# %h3.title Level ##{level} +-# %table.columns3.info +-# %tr +-# %th.first= t("activerecord.attributes.build_list/item.name") +-# %th= t("activerecord.attributes.build_list/item.version") +-# %th.last= t("activerecord.attributes.build_list/item.status") +-# +-# - group.each do |item| +-# %tr{:class => cycle("odd", "even")} +-# %td= item.name +-# %td= item.version +-# %td= item.human_status = render 'build_lists/submenu' diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index 517cc53d5..eb86a4647 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -58,6 +58,7 @@ en: container_published: 'Container in a repository' action: Action new_header: New build + main_data: Main data ownership: header: Build list ownership diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 531448717..0bfa9ec88 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -58,6 +58,7 @@ ru: container_published: 'Контейнер размещен в репозитории' action: Действие new_header: Новая сборка + main_data: Основные данные ownership: header: Принадлежность заданий diff --git a/doc/design/abf-monitoring task.html b/doc/design/abf-monitoring task.html new file mode 100644 index 000000000..f590c6be4 --- /dev/null +++ b/doc/design/abf-monitoring task.html @@ -0,0 +1,204 @@ + + + + + Сборочная среда + + + + + + + +
+ +
+
+
+
+ + + + + +
+ + + +
+
+ avatar +
+ +
+ +
+
+ + + +
+ +
+
+
+
+
+
+ + + + +
+
+ + +
+ +
+ +
+
+

Build published

+
+

2012-01-27 17:28:05 UTC

+
+ +

Основные данные

+
Container path
+ +
+
User
+ +
+ Опубликовать + +
+ +

Основные данные

+
Platform
+ +
+
Packet list repository
+ +
+
Includes repository
+
main
+
+
Update type
+
security
+
+
Dependable build requires
+
false
+
+
Automated publishing
+
true
+
+
Version
+
latest_mandriva2011
+
+
Architecture
+
i586
+
+
Recurrent
+
false
+
+ +
+ +

Build items

+

Item #0

+ + + + + + + + + + + + + + + + +
NameVersionStatus
libreofficelatest_mandriva2011Build complete
+ +
+ +
+ +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/doc/design/styles/main.css b/doc/design/styles/main.css index b1caadb42..edf152f70 100644 --- a/doc/design/styles/main.css +++ b/doc/design/styles/main.css @@ -276,7 +276,7 @@ header div.droplist a:hover{ } -.sub-menu nav { /* */ +.sub-menu nav { /*��� ������� ��� ��������*/ float: left; margin: 0px 0px 0px 0px; } @@ -407,6 +407,10 @@ article h4 { padding-bottom: 2px; } +article h4.nomargin { + margin: 0px; +} + article p { margin: 0; padding: 0; @@ -440,7 +444,7 @@ article a.button { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 4px 20px; + padding: 4px 20px 6px; margin: 0; font-size: 12px; text-decoration: none; @@ -509,7 +513,7 @@ article input[type="submit"] { background-image: linear-gradient(top, #68a3d8, #125687); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#68a3d8', EndColorStr='#125687'); border: 1px solid #5084b4; - padding: 0px 20px 0px; + padding: 3px 20px 5px; margin: 0; font-size: 12px; text-decoration: none; @@ -519,7 +523,6 @@ article input[type="submit"] { border-radius: 5px; text-align: center; height: auto; - height: 28px; width: auto; font-family: Tahoma; } @@ -1415,8 +1418,8 @@ div.desription-top input.name { height: 21px; width: auto; color: #575756; - font-size: 12px; - width: 215px; + font-size: 11px; + width: 415px; padding: 2px 5px 3px; } @@ -1592,6 +1595,10 @@ table td.width145 { width: 145px; } +.width125 { + width: 125px; +} + table td.width30 { width: 30px; } @@ -1944,7 +1951,7 @@ img.delete-row { } table tbody tr.error td { - background: #e7bcbc; + background: #fedede; } table tbody tr.success td { @@ -2110,6 +2117,22 @@ article div.rightlist div.load { padding: 5px 10px; } +.notify.blue { + border: 1px solid #a9c6dd; + background: #dcecfa; + border-radius: 1px; + width: 555px; + margin-top: 20px; + text-align: right; + padding: 5px; +} + +.notify.blue div.green { + border: 1px solid #bad099; + background: #d7e599; + float: left; +} + /* Pagination */ div.pagination em { @@ -2307,10 +2330,40 @@ div.tmargin10 { margin-top: 10px; } +.tmargin10 { + margin-top: 10px; +} + a.lmargin7 { margin-left: 7px; } a.lmargin5 { margin-left: 5px; +} + +/*My projects*/ + +table.tablesorter tr.search td { + background: #dcecfa; +} + +table.tablesorter tr.search td input[type="text"] { + height: 16px; + width: 830px; + border: 1px solid #cdcdcd; + border-radius: 4px; + padding: 5px; + font-family: Tahoma, Geneva, Helvetica, sans-serif; + font-size: 12px; + margin-top: 2px; +} + + +table.tablesorter.width565 { + width: 565px; +} + +article h3 a { + font-size: 14px; } \ No newline at end of file diff --git a/spec/helpers/build_lists_helper_spec.rb b/spec/helpers/build_lists_helper_spec.rb new file mode 100644 index 000000000..bda7a8ffb --- /dev/null +++ b/spec/helpers/build_lists_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the BuildListsHelper. For example: +# +# describe BuildListsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe BuildListsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end