* Some jQuery / CSS hackery.

This commit is contained in:
Eelco Dolstra 2008-10-28 15:34:29 +00:00
parent 9f7403765c
commit 08798f3c07
6 changed files with 90 additions and 12 deletions

View file

@ -36,6 +36,14 @@ sub index :Path :Args(0) {
} }
sub job :Local {
my ( $self, $c, $jobName ) = @_;
$c->stash->{template} = 'job.tt';
$c->stash->{jobName} = $jobName;
$c->stash->{builds} = [$c->model('DB::Builds')->search({name => $jobName}, {order_by => "timestamp DESC"})];
}
sub default :Path { sub default :Path {
my ( $self, $c ) = @_; my ( $self, $c ) = @_;
error($c, "Page not found."); error($c, "Page not found.");

View file

@ -150,4 +150,30 @@ span.error-msg {
pre.buildlog { pre.buildlog {
border: 1px solid black; border: 1px solid black;
padding: 0.3em; padding: 0.3em;
} }
/* Sortable tables */
table.tablesorter {
text-align: left;
}
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: #ffe000;
}

View file

@ -1,24 +1,31 @@
[% WRAPPER layout.tt title="Hydra Overview" %] [% WRAPPER layout.tt title="Hydra Overview" %]
[% USE date %]
<h1>Job status</h1> <h1>Job status</h1>
<table> <table class="tablesorter">
<tr><th></th><th>Id</th><th>Attribute name</th><th>Timestamp</th><th>Description</th></tr> <thead>
[% FOREACH build IN latestBuilds -%] <tr><th></th><th>Id</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
[% INCLUDE "short-build-info.tt" %] </thead>
[% END -%] <tbody>
[% FOREACH build IN latestBuilds -%]
[% INCLUDE "short-build-info.tt" %]
[% END -%]
</tbody>
</table> </table>
<h1>All builds</h1> <h1>All builds</h1>
<p>Number of builds: [% allBuilds.size %]</p> <p>Number of builds: [% allBuilds.size %]</p>
<table> <table class="tablesorter">
<tr><th></th><th>Id</th><th>Attribute name</th><th>Timestamp</th><th>Description</th></tr> <thead>
[% FOREACH build IN allBuilds -%] <tr><th></th><th>#</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
[% INCLUDE "short-build-info.tt" %] </thead>
[% END -%] <tbody>
[% FOREACH build IN allBuilds -%]
[% INCLUDE "short-build-info.tt" %]
[% END -%]
</tbody>
</table> </table>
[% END %] [% END %]

View file

@ -0,0 +1,12 @@
[% WRAPPER layout.tt title="Hydra Overview" %]
<h1>All builds for job <tt>[% jobName %]</tt></h1>
<table>
<tr><th></th><th>Id</th><th>Job</th><th>Timestamp</th><th>Description</th></tr>
[% FOREACH build IN builds -%]
[% INCLUDE "short-build-info.tt" %]
[% END -%]
</table>
[% END %]

View file

@ -8,6 +8,16 @@
<head> <head>
<title>[% title %]</title> <title>[% title %]</title>
<link rel="stylesheet" href="/hydra.css" type="text/css" /> <link rel="stylesheet" href="/hydra.css" type="text/css" />
<script type="text/javascript" src="/static/js/tablesorter/jquery-latest.js"></script>
<script type="text/javascript" src="/static/js/tablesorter/jquery.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(
function()
{
$("table.tablesorter").tablesorter();
}
);
</script>
</head> </head>
<body> <body>

View file

@ -0,0 +1,15 @@
[% USE date %]
<tr>
<td>
[% IF build.buildstatus == 0 %]
<img src="/static/images/success.gif" />
[% ELSE %]
<img src="/static/images/failure.gif" />
[% END %]
</td>
<td><a href="[% c.uri_for('/build' build.id) %]">[% build.id %]</a></td>
<td><a href="[% c.uri_for('/job' build.name) %]"><tt>[% build.name %]</tt></a></td>
<td>[% date.format(build.timestamp, '%Y-%m-%d %H:%M:%S') %]</td>
<td>[% build.description %]</td>
</tr>