From 17d30cd1790d2c1b46c833056387186253cac441 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 12 Apr 2012 20:12:07 +0200 Subject: [PATCH] Using twitter bootstrap for more consistent looks for Hydra --- src/root/Makefile.am | 6 +- src/root/admin.tt | 18 --- src/root/build.tt | 50 +++---- src/root/channel-contents.tt | 2 +- src/root/clone-build.tt | 2 +- src/root/common.tt | 20 ++- src/root/edit-view.tt | 2 +- src/root/errors.tt | 4 +- src/root/job.tt | 34 ++--- src/root/jobset-evals.tt | 11 +- src/root/jobset.tt | 51 +++---- src/root/layout.tt | 62 ++++++--- src/root/machines.tt | 2 +- src/root/navbar.tt | 96 ------------- src/root/news.tt | 2 +- src/root/overview.tt | 16 +-- src/root/product-list.tt | 9 +- src/root/project.tt | 77 +++++------ src/root/releases.tt | 2 +- src/root/static/css/hydra.css | 252 +--------------------------------- src/root/topbar.tt | 146 +++++++++++++++++--- src/root/users.tt | 2 +- src/root/view.tt | 9 +- 23 files changed, 312 insertions(+), 563 deletions(-) diff --git a/src/root/Makefile.am b/src/root/Makefile.am index 87a15fde..7dbda042 100644 --- a/src/root/Makefile.am +++ b/src/root/Makefile.am @@ -6,8 +6,9 @@ STATIC = \ FLOT = flot-0.6.zip TABLESORTER = jquery.tablesorter.zip JQUERY = jquery-ui-1.8.5.custom.zip +BOOTSTRAP = bootstrap.zip -ZIPS = $(FLOT) $(TABLESORTER) $(JQUERY) +ZIPS = $(FLOT) $(TABLESORTER) $(JQUERY) $(BOOTSTRAP) EXTRA_DIST = $(TEMPLATES) $(STATIC) $(ZIPS) @@ -17,6 +18,7 @@ nobase_hydra_DATA = $(EXTRA_DIST) all: mkdir -p $(srcdir)/static/js unzip -u -d $(srcdir)/static/js/jquery $(JQUERY) + unzip -u -d $(srcdir)/static $(BOOTSTRAP) rm -rf $(srcdir)/static/js/tablesorter unzip -u -d $(srcdir)/static/js $(TABLESORTER) unzip -u -d $(srcdir)/static/js $(FLOT) @@ -24,3 +26,5 @@ all: install-data-local: $(ZIPS) mkdir -p $(hydradir)/static/js cp -prvd $(srcdir)/static/js/* $(hydradir)/static/js + mkdir -p $(hydradir)/static/bootstrap + cp -prvd $(srcdir)/static/bootstrap/* $(hydradir)/static/bootstrap diff --git a/src/root/admin.tt b/src/root/admin.tt index fc61ec0b..f022251a 100644 --- a/src/root/admin.tt +++ b/src/root/admin.tt @@ -3,24 +3,6 @@

Admin

- -

Status

[% FOREACH m IN machines %] diff --git a/src/root/build.tt b/src/root/build.tt index 0abc96f5..8672582a 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -11,7 +11,7 @@ [% BLOCK renderBuildSteps %]

[% type %] build steps

- +
@@ -82,17 +82,17 @@

[% flashMsg %]

[% END %] -
-
NrWhatDurationMachineStatus
@@ -188,7 +188,7 @@ [% IF prevSuccessfulBuild %]

Changes


-
+
[% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %] @@ -201,9 +201,9 @@ - - [% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %][% END %] - + + [% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %][% END %] + @@ -226,7 +226,7 @@
[% HTML.escape(logtext) -%]
[% END %] -
+

Information

@@ -396,11 +396,11 @@ [% END %]
Last successful build [% INCLUDE renderDateTime timestamp = prevSuccessfulBuild.timestamp %]
[% INCLUDE renderBuildStatusIcon build=prevSuccessfulBuild size=32 %] [% INCLUDE renderFullBuildLink build=prevSuccessfulBuild %][% INCLUDE renderBuildStatusIcon build=firstBrokenBuild size=32 %] [% INCLUDE renderFullBuildLink build=firstBrokenBuild %][% INCLUDE renderBuildStatusIcon build=build size=32 %] [% INCLUDE renderFullBuildLink build=build %][% INCLUDE renderBuildStatusIcon build=prevSuccessfulBuild size=32 %] [% INCLUDE renderFullBuildLink build=prevSuccessfulBuild, hideProjectName=1, hideJobsetName=1 %][% INCLUDE renderBuildStatusIcon build=firstBrokenBuild size=32 %] [% INCLUDE renderFullBuildLink build=firstBrokenBuild, hideProjectName=1, hideJobsetName=1 %][% INCLUDE renderBuildStatusIcon build=build size=32 %] [% INCLUDE renderFullBuildLink build=build, hideProjectName=1, hideJobsetName=1 %]
-
+

Build inputs

- +
@@ -428,14 +428,14 @@

[% IF prevBuild %] -

Changes since previous build : [% INCLUDE renderFullBuildLink build=prevBuild %]

+

Changes since previous build : [% INCLUDE renderFullBuildLink build=prevBuild, hideProjectName=1, hideJobsetName=1 %]

[% INCLUDE renderInputDiff build2=build , build1=prevBuild %] [% END %] [% IF relatedbuilds %] -
+

Related builds

The following builds are part of the same jobset evaluation that produced this build.

[% INCLUDE renderBuildList builds=relatedbuilds hideProjectName=1 hideJobsetName=1 %] @@ -443,20 +443,20 @@ [% END %] [% IF build.buildsteps %] -
+
[% INCLUDE renderBuildSteps type="All" %]
[% END %] [% IF build.dependents %] -
+

Used by

The following builds have used this build as an input:

-
NameTypeValueRevisionStore path
+
@@ -474,7 +474,7 @@ [% END %] [% IF prevBuilds %] -
+

Build time history (in seconds)

@@ -629,7 +629,7 @@
diff --git a/src/root/channel-contents.tt b/src/root/channel-contents.tt index eee6ddd3..911c4767 100644 --- a/src/root/channel-contents.tt +++ b/src/root/channel-contents.tt @@ -34,7 +34,7 @@ install the package simply by clicking on the packages below.

This channel contains the following packages.

-
BuildInput nameSystemTimestamp
+
diff --git a/src/root/clone-build.tt b/src/root/clone-build.tt index 3d6af138..e44da753 100644 --- a/src/root/clone-build.tt +++ b/src/root/clone-build.tt @@ -21,7 +21,7 @@

Build inputs

-
+
diff --git a/src/root/common.tt b/src/root/common.tt index 3ab941cf..266085e0 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -61,7 +61,7 @@ [%- BLOCK renderBuildListHeader -%] -
NameTypeValue
+
[%- IF !hideResultInfo -%] @@ -186,6 +186,9 @@ [% IF uri %] uri) %][% IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END %]>[% content %][% ELSE; content; END -%] [% END -%] +[% BLOCK maybeButton -%] + [% IF uri %] uri) %][% IF confirmmsg %]onclick="javascript:return confirm('[% confirmmsg %]')"[% END %]>[% content %][% ELSE; content; END -%] +[% END -%] [% BLOCK renderSelection %] [% IF edit %] @@ -321,7 +324,7 @@ [% END %] [% BLOCK renderInputDiff; %] -
+
[% IF !nestedDiff %] [% END %] @@ -366,7 +369,7 @@ [% END %] [% BLOCK hydraStatus %] -
InputChanges
+
@@ -388,8 +391,16 @@ [% BLOCK renderPager %] + + [% END %] diff --git a/src/root/edit-view.tt b/src/root/edit-view.tt index efbe3539..98439ee0 100644 --- a/src/root/edit-view.tt +++ b/src/root/edit-view.tt @@ -34,7 +34,7 @@
MachineJobTypeBuildStepWhatSince
- +
diff --git a/src/root/errors.tt b/src/root/errors.tt index 0a145213..0333d154 100644 --- a/src/root/errors.tt +++ b/src/root/errors.tt @@ -15,7 +15,7 @@ that don’t build.

Evaluation errors in jobsets

-
+
@@ -41,7 +41,7 @@ that don’t build.

Evaluation errors in jobs

-
Name
+
diff --git a/src/root/job.tt b/src/root/job.tt index dee03602..cac8fa02 100644 --- a/src/root/job.tt +++ b/src/root/job.tt @@ -2,22 +2,13 @@ [% PROCESS common.tt %] [% hideProjectName=1 hideJobsetName=1 hideJobName=1 %] - -

Job [% INCLUDE renderLink - uri = c.uri_for(c.controller('Project').action_for('view'), [project.name]) - title = project.name %]:[% INCLUDE renderLink - uri = c.uri_for(c.controller('Jobset').action_for('index'), [project.name, jobset.name]) - title = jobset.name %]:[% job.name %]

- - -
-
    -
  • Status
  • -
  • Channels
  • -
  • Latest builds
  • - + -
    +
    +
    [% IF currentBuilds.size != 0 %]

    Latest builds (latest evaluation)

    [% INCLUDE renderBuildList builds=currentBuilds showStatusChange=0 %] @@ -31,7 +22,7 @@ [% INCLUDE renderBuildList builds=lastBuilds showStatusChange=0 %] [% END %]
    -
    +

    This job provides the following Nix channel:

      @@ -42,7 +33,7 @@
    -
    +
    - [%# -
    - [% INCLUDE showBuildStats % ] -
    - %]
    diff --git a/src/root/jobset-evals.tt b/src/root/jobset-evals.tt index 1ba812c9..180b57cf 100644 --- a/src/root/jobset-evals.tt +++ b/src/root/jobset-evals.tt @@ -12,7 +12,7 @@ [% INCLUDE renderPager %] -
Name
+
@@ -26,17 +26,18 @@ diff --git a/src/root/jobset.tt b/src/root/jobset.tt index c1af7992..0d4faa35 100644 --- a/src/root/jobset.tt +++ b/src/root/jobset.tt @@ -8,10 +8,6 @@ [% IF create %]

New Jobset in Project [% project.name %]

-[% ELSE %] -

Jobset [% INCLUDE renderLink - uri = c.uri_for(c.controller('Project').action_for('view'), [project.name]) - title = project.name %]:[% jobset.name %]

[% END %] @@ -56,7 +52,7 @@ [% BLOCK renderInputs %]

Inputs

-
#[% eval.id %]  [% INCLUDE renderDateTime timestamp = eval.timestamp %]  - [% eval.get_column('nrSucceeded') %] / [% eval.get_column('nrBuilds') %] + [% eval.get_column('nrSucceeded') %] + [% eval.get_column('nrBuilds') - eval.get_column('nrSucceeded') - eval.get_column('nrScheduled') %] [% IF eval.get_column('nrScheduled') > 0 %] -
[% eval.get_column('nrScheduled') %] scheduled + [% eval.get_column('nrScheduled') %] [% END %]
[% diff = eval.get_column('nrSucceeded') - next.get_column('nrSucceeded'); IF diff > 0 %] - +[% diff %] + +[% diff %] [% ELSIF diff < 0 && eval.get_column('nrScheduled') == 0 %] - [% diff %] + [% diff %] [% END %]
+
@@ -75,20 +71,19 @@ [% END %] -
-
Input nameTypeValues
There are evaluation errors!
[% IF edit %] diff --git a/src/root/layout.tt b/src/root/layout.tt index f02fbc4a..c592fd64 100644 --- a/src/root/layout.tt +++ b/src/root/layout.tt @@ -10,21 +10,29 @@ Hydra - [% title %] - - - - - - - + + + + + + + + + + - diff --git a/src/root/project.tt b/src/root/project.tt index 31d7d8cd..79bdcc16 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -1,33 +1,27 @@ [% WRAPPER layout.tt title=(edit ? (create ? "New Project" : "Editing Project ‘$project.name’") : "Project ‘$project.name’") %] [% PROCESS common.tt %] -[% IF create %] -

New Project

-[% ELSE %] -

Project [% project.name %]

-[% END %] - -
-
    + +
    + [% IF !edit %] -
    +

    Jobsets

    [% IF project.jobsets.size > 0 %]

    This project has the following jobsets:

    - +
    @@ -60,32 +54,36 @@ [% IF j.get_column('nrtotal') > 0 %] [% successrate = ( j.get_column('nrsucceeded') / j.get_column('nrtotal') )*100 %] [% IF j.get_column('nrscheduled') > 0 %] - [% class = '' %] + [% class = 'label' %] [% ELSIF successrate < 25 %] - [% class = 'red' %] + [% class = 'label label-important' %] [% ELSIF successrate < 75 %] - [% class = 'orange' %] + [% class = 'label label-warning' %] [% ELSIF successrate <= 100 %] - [% class = 'green' %] + [% class = 'label label-success' %] [% END %] [% END %] - + - [% IF c.check_user_roles('admin') %] - [% END%] @@ -99,17 +97,16 @@ [% END %] -

    [Create a new jobset]

    [% END %] -
    +
    [% IF edit %]
    [% END %] -

    Information[% IF !edit %] [Edit][% END %]

    +

    Information

    -
    [% successrate FILTER format('%d') %]%
    +
    + [% successrate FILTER format('%d') %]% + + [% IF j.get_column('nrsucceeded') > 0 %] + [% j.get_column('nrsucceeded') %] + [% END %] + [% IF j.get_column('nrfailed') > 0 %] + [% j.get_column('nrfailed') %] + [% END %] [% IF j.get_column('nrscheduled') > 0 %] - [% j.get_column('nrscheduled') %] builds still running + [% j.get_column('nrscheduled') %] [% END %] -
    [% j.get_column('nrsucceeded') %]/[% j.get_column('nrtotal') %]
    -
    [ [% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('force_eval'), project.name, j.name) content = "Evaluate" confirmmsg = ("Are you sure you want to force evaluation of jobset " _ project.name _ ":" _ j.name _ "?") %] - | [% IF j.hidden %] - [% INCLUDE maybeLink uri = c.uri_for('/jobset' project.name j.name 'unhide') content = "Unhide" %] + [% INCLUDE maybeButton uri = c.uri_for(c.controller('Admin').action_for('force_eval'), project.name, j.name) content = "Evaluate" confirmmsg = ("Are you sure you want to force evaluation of jobset " _ project.name _ ":" _ j.name _ "?") %] + [% IF j.hidden %] + [% INCLUDE maybeButton uri = c.uri_for('/jobset' project.name j.name 'unhide') content = "Unhide" %] [% ELSE %] - [% INCLUDE maybeLink uri = c.uri_for('/jobset' project.name j.name 'hide') content = "Hide" %] + [% INCLUDE maybeButton uri = c.uri_for('/jobset' project.name j.name 'hide') content = "Hide" %] [% END %] - ]
    [% IF edit %] @@ -177,7 +174,7 @@ [% IF !edit %] -
    +

    Views

    @@ -203,7 +200,7 @@

    [Create a new view]

    -
    +

    Channels

    @@ -217,17 +214,13 @@
    - [%# -
    -

    Statistics

    - [% INCLUDE showBuildStats % ] -
    - %] [% END %]
    diff --git a/src/root/releases.tt b/src/root/releases.tt index 47213b91..9fe7061b 100644 --- a/src/root/releases.tt +++ b/src/root/releases.tt @@ -12,7 +12,7 @@

    This project has made the following releases:

    -
    +
    diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css index 2329cf29..5553a8e8 100644 --- a/src/root/static/css/hydra.css +++ b/src/root/static/css/hydra.css @@ -1,251 +1,7 @@ -body { - font-family: sans-serif; - background: white; - margin: 2em 1em 2em 1em; -} - -#logo img { - height: 6em; -} - -img { - border-style: none; -} - -a { text-decoration: none;} -a:link { color: #0048b3; } -a:visited { color: #002a6a; } -a.no-hover:hover { background: none; } -a:hover, a:visited:hover { text-decoration: underline;} -a.smallLink { - font-size: 60%; - vertical-align: top; -} -a#error-link { - color: red; +.logTreeToggle { + text-decoration: none; + font-family: monospace; + font-size: larger; } -table { - empty-cells: show; - border-collapse: collapse; - text-align: left; -} - -th, td { - border: 1px solid #dddddd; - vertical-align: top; -} - -th { - background-color: #E6EEEE; -} - -th.subheader { - background-color: #f0f0f8; - font-size: 120%; - text-align: center; - font-weight: normal; -} - -table.tablesorter:not(.clean) tr:nth-child(even) { - background-color: #efefef; -} - -table.tablesorter:not(.clean) tr:nth-child(odd) { - background-color: #ffffff; -} - -tr.clickable:hover { - background-color: #E6EEFF; - cursor: pointer; -} - -td.centered { - text-align: center; -} - -td.right { - text-align: right; -} - - -.layoutTable td, .layoutTable th { - border-style: none; -} - -table.tablesorter thead tr .header { - background-image: url(/static/js/tablesorter/themes/blue/bg.gif); - background-repeat: no-repeat; - background-position: center right; - cursor: pointer; -} - -table.tablesorter thead tr .headerSortUp { - background-image: url(/static/js/tablesorter/themes/blue/asc.gif); -} - -table.tablesorter thead tr .headerSortDown { - background-image: url(/static/js/tablesorter/themes/blue/desc.gif); -} - -table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { - background-color: #D6DDDD; -} - -table.tablesorter thead tr th { - padding-right: 1.5em; -} - -#generic-tabs li { - height : 30px; - font-size : 90%; -} -#generic-tabs div { - font-size : 90%; -} - -h1, h2, h3 { - font-weight: bold; - color: #002a70; -} - -ul.productList { - list-style: none; - padding-left: 1em; -} - -ul.productList li { - margin-top: 1em; -} - -.productDetails { - display: none; - margin-top: 1em; - margin-bottom: 1em; - margin-left: 3em; -} - -tr:nth-child(even).runningBuild { - background-color: #d8ffd8 !important; -} - -tr:nth-child(odd).runningBuild { - background-color: #e8ffe8 !important; -} - -.disabledBuild { - background-color: #ffc0c0 !important; -} - -.error-msg { - color: red; - white-space: pre-wrap; -} - -.error { - color: red; - font-weight: bold; -} - -pre { - margin-left: 1.5em; - margin-right: 1.5em; -} - -pre.buildlog { - border: 1px solid black; - padding: 0.3em; - white-space: pre-wrap; -} - -pre.taillog { - border: 3px solid darkblue; - padding: 0.3em; - white-space: pre-wrap; - background: black; - color: #ffffff; -} - -div.buildlog { - border: 1px solid black; - padding: 0.3em; -} - -.multiLineMsg { - padding: 0em; - margin: 0em; - white-space: pre-wrap; -} - -.template { - display: none; -} - -div.help { - border: solid black 1px; - padding-left: 1em; - padding-right: 1em; -} - -div.help pre { - padding-left: 1.5em; - color: #400000; -} - -th.releaseSetJobName { - font-size: 60%; - padding: 0 0 0 0; -} - -input.string { - font-family: sans-serif; - font-size: 100%; - background-color: #fffff0; - width: 20em; -} - -input.shortString { - width: 7em; -} - -input.longString { - width: 40em; -} - -textarea.longString { - width: 40em; -} - -select { - background-color: #fffff0; -} - -button { - background-color: #f0f0e0; -} - -form.inline { - display: inline; -} - -.red { - color: red; -} -.orange { - color: orange; -} -.green { - color: green; -} - -.newsbar { - background-color:#D9E3EA; - border:1px solid #999999; - float:right; - font-size:x-small; - margin:0 0 0.5em 0.5em; - overflow:hidden; - padding:0.5em; - width:30em; -} \ No newline at end of file diff --git a/src/root/topbar.tt b/src/root/topbar.tt index 8c768824..018bb529 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -1,3 +1,24 @@ + +[% BLOCK menuItem %] +
  • + [% title %] +
  • +[% END %] + +[% BLOCK makeLink -%] +[% INCLUDE makeLinkWrapped content="" -%] +[% END %] + +[% BLOCK makeSubMenu %] + +[% END %] + + [% BLOCK makeLinkWrapped %]
  • [% title %] @@ -9,30 +30,118 @@ [% INCLUDE makeLinkWrapped content="" -%] [% END %] -[% BLOCK makeSubMenu %] -
      - [% content %] -
    -
  • -[% END %] - - [% WRAPPER makeSubMenu title="Hydra" %] - [% INCLUDE makeLink - uri = c.uri_for(c.controller('Root').action_for('index')) - title = "Projects" %] + diff --git a/src/root/users.tt b/src/root/users.tt index f75796a9..01203245 100644 --- a/src/root/users.tt +++ b/src/root/users.tt @@ -3,7 +3,7 @@

    Users

    -
    Name
    +
    diff --git a/src/root/view.tt b/src/root/view.tt index 89d09d9d..cc314541 100644 --- a/src/root/view.tt +++ b/src/root/view.tt @@ -11,7 +11,7 @@

    Showing results [% (page - 1) * resultsPerPage + 1 %] - [% (page - 1) * resultsPerPage + results.size %] out of [% totalResults %].

    -
    Username
    +
    @@ -64,6 +64,12 @@
    + + + [% END %]