[refs #223] Add new design to build list task page

This commit is contained in:
konstantin.grabar 2012-03-18 12:20:31 +04:00
parent 5108269792
commit 4b26eebeca
10 changed files with 518 additions and 89 deletions

View File

@ -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;
}

View File

@ -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 {

View File

@ -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

View File

@ -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'), '#'
= @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'), '#'

View File

@ -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'

View File

@ -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

View File

@ -58,6 +58,7 @@ ru:
container_published: 'Контейнер размещен в репозитории'
action: Действие
new_header: Новая сборка
main_data: Основные данные
ownership:
header: Принадлежность заданий

View File

@ -0,0 +1,204 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Сборочная среда</title>
<script type="text/javascript" src="js/html5shiv.js"></script>
<link rel="stylesheet" type="text/css" href="styles/main.css" />
<link rel="stylesheet" type="text/css" href="styles/blue/style.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/all.js"></script>
</head>
<body>
<div class="wrap">
<!--Top block-->
<header>
<div class="left">
</div>
<div class="middle">
<!--Main menu-->
<menu>
<ul>
<li>
<a href="#" class="first">Главная</a>
</li>
<li>
<a href="#">Проекты</a>
</li>
<li>
<a href="#">Группы</a>
</li>
<li>
<a href="#" class="active">Мониторинг</a>
</li>
<li>
<a href="#">Платформа</a>
</li>
<li>
<a href="#">Документация</a>
</li>
</ul>
<div class="logo">
<img src="pics/logo-mini.png" alt="logo" />
</div>
</menu>
<div class="information">
<!--Search-->
<div class="search">
<div class="pic">
</div>
<div class="field">
<input type="text" value="Поиск" class="gray" onClick="if(this.value=='Поиск'){this.value='';this.className='black';}" onblur="if(this.value==''){this.value='Поиск';this.className='gray';}" />
</div>
</div>
<div class="user">
<div class="avatar" onclick="droplist();">
<img src="pics/ava.png" alt="avatar" height="30" />
</div>
<div class="profile" onclick="droplist();">
<a href="#" onclick="droplist();">mikimaus <img src="pics/expand-white.png" alt="ex" /></a>
</div>
</div>
<div class="both">
</div>
<div class="droplist-wrap">
<div class="droplist" id="droplist">
<div class="a"><a href="#">Публичный профиль</a></div>
<div class="a"><a href="#">Настройки</a></div>
<div class="a"><a href="#">Выйти</a></div>
</div>
</div>
</div>
</div>
<div class="right">
</div>
<div class="both">
</div>
</header>
<!--Submenu-->
<div class="sub-menu">
<div class="left">
libreoffice
</div>
</div>
<div class="both">
</div>
<!--Page-->
<article>
<!--Single page content-->
<div class="all bigpadding">
<div class="notify blue">
<div class="green">
<p>Build published</p>
</div>
<p>2012-01-27 17:28:05 UTC</p><div class="both"></div>
</div>
<h3>Основные данные</h3>
<div class="leftside width125">Container path</div>
<div class="leftside"><a href="#">http://dev-abf.rosalab.ru/downloads/warpc_personal/container/libreoffice-4600</a></div>
<div class="both"></div>
<div class="leftside width125">User</div>
<div class="leftside"><a href="#">warpc ()</a></div>
<div class="both"></div>
<a class="button tmargin10" href="#">Опубликовать</a>
<div class="hr"></div>
<h3>Основные данные</h3>
<div class="leftside width125">Platform</div>
<div class="leftside"><a href="#">mandriva2011</a></div>
<div class="both"></div>
<div class="leftside width125">Packet list repository</div>
<div class="leftside"><a href="#">warpc_personal</a></div>
<div class="both"></div>
<div class="leftside width125">Includes repository</div>
<div class="leftside">main</div>
<div class="both"></div>
<div class="leftside width125">Update type</div>
<div class="leftside">security</div>
<div class="both"></div>
<div class="leftside width125">Dependable build requires</div>
<div class="leftside">false</div>
<div class="both"></div>
<div class="leftside width125">Automated publishing</div>
<div class="leftside">true</div>
<div class="both"></div>
<div class="leftside width125">Version</div>
<div class="leftside">latest_mandriva2011</div>
<div class="both"></div>
<div class="leftside width125">Architecture</div>
<div class="leftside">i586</div>
<div class="both"></div>
<div class="leftside width125">Recurrent</div>
<div class="leftside">false</div>
<div class="both"></div>
<div class="hr"></div>
<h3>Build items</h3>
<h4 class="nomargin">Item #0</h4>
<table class="tablesorter width565" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>Name</th>
<th>Version</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr class="success">
<td>libreoffice</td>
<td>latest_mandriva2011</td>
<td>Build complete</td>
</tr>
</tbody>
</table>
<div class="both"></div>
</div>
<div class="both">
</div>
</article>
</div>
<!--Footer-->
<footer>
<ul>
<li>
ROSA Лаб. © 2012 <img src="pics/square.png" alt="_" />
</li>
<li>
<img src="pics/flag.png" alt="rosa" /> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="#">О компании</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="#">Контакты</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="#">Условия использования</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="#">Конфиденциальность</a> <img src="pics/square.png" alt="_" />
</li>
<li>
<a href="#">Безопасность</a>
</li>
</ul>
</footer>
</body>
</html>

View File

@ -276,7 +276,7 @@ header div.droplist a:hover{
}
.sub-menu nav { /*Äëÿ ïîäìåíþ áåç íàçâàíèÿ*/
.sub-menu nav { /*<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
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;
}

View File

@ -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