hydra/src/root/jobset.tt
2013-02-22 11:37:35 +01:00

188 lines
5.7 KiB
Plaintext

[% WRAPPER layout.tt title="Jobset $project.name:$jobset.name" %]
[% PROCESS common.tt %]
[% BLOCK renderInput %]
<tr class="input [% extraClass %]" [% IF id %]id="[% id %]"[% END %]>
<td>
<tt>[% HTML.escape(input.name) %]</tt>
</td>
<td>
[% INCLUDE renderSelection curValue=input.type param="$baseName-type" options=inputTypes %]
</td>
<td class="inputalts" id="[% baseName %]">
[% FOREACH alt IN input.jobsetinputalts %]
<tt class="inputalt">
[% IF input.type == "string" %]
"[% HTML.escape(alt.value) %]"
[% ELSE %]
[% HTML.escape(alt.value) %]
[% END %]
</tt>
[% END %]
</td>
</tr>
[% END %]
[% BLOCK renderInputs %]
<h3>Inputs</h3>
<table class="tablesorter table table-striped table-condensed">
<thead>
<tr><th>Input name</th><th>Type</th><th>Values</th></tr>
</thead>
<tbody class="inputs">
[% FOREACH input IN jobset.jobsetinputs %]
[% INCLUDE renderInput input=input baseName="input-$input.name" %]
[% END %]
</tbody>
</table>
[% END %]
<ul class="nav nav-tabs">
<li class="active"><a href="#tabs-evaluations" data-toggle="tab">Evaluations</a></li>
[% IF jobset.errormsg %]
<li><a href="#tabs-errors" data-toggle="tab"><img src="/static/images/error_16.png" /> Evaluation errors</a></li>
[% END %]
<li><a href="#tabs-status" data-toggle="tab">Job status</a></li>
<li><a href="#tabs-jobs" data-toggle="tab">Jobs ([% activeJobs.size %])</a></li>
<li><a href="#tabs-setup" data-toggle="tab">Configuration</a></li>
</ul>
<div id="generic-tabs" class="tab-content">
<div id="tabs-evaluations" class="tab-pane active">
<table class="info-table">
<tr>
<th>Last checked:</th>
<td>
[% IF jobset.lastcheckedtime %]
[% INCLUDE renderDateTime timestamp = jobset.lastcheckedtime %][% IF jobset.errormsg %]<em>, with
evaluation errors!</em>[% ELSE %], <em>no evaluation errors</em>[% END %]
[% ELSE %]
<em>never</em>
[% END %]
</td>
</tr>
<tr>
<th>Last evaluation:</th>
<td>
[% IF latestEval %]
[% INCLUDE renderDateTime timestamp = latestEval.timestamp %]
[% ELSE %]
<em>never</em>
[% END %]
</td>
</tr>
</table>
<br/>
[% IF evals.size() > 0 %]
[% INCLUDE renderEvals linkToAll=c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name]) %]
[% END %]
</div>
<div id="tabs-status" class="tab-pane">
[% IF activeJobsStatus %]
<table class="table table-striped table-condensed">
<thead><tr><th>Job</th>[% FOREACH s IN systems %]<th>[% s.system %]</th>[% END %]</tr></thead>
<tbody>
[% odd = 0 %]
[% FOREACH j IN activeJobsStatus %]
<tr class="[% IF odd %] odd [% END; odd = !odd %]">
<td>[% INCLUDE renderJobName project=project.name jobset = jobset.name job = j.get_column('job') %]</td>
[% FOREACH s IN systems %]
[% system = s.system %]
[% systemStatus = j.get_column(system) %]
<td class="centered">
[% IF systemStatus != undef %]
<a href="[% c.uri_for('/build' j.get_column(system _ '-build') ) %]">
[% INCLUDE renderBuildStatusIcon buildstatus=systemStatus size=16 %]
</a>
[% END %]
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<h2>Status</h2>
<p>
[ <a href="[% c.uri_for('/jobset' project.name jobset.name 'with-status' ) %]">Show status overview</a> ]
</p>
[% END %]
</div>
[% IF jobset.errormsg %]
<div id="tabs-errors" class="tab-pane">
<p>Errors occurred at [% INCLUDE renderDateTime timestamp=jobset.errortime %].</p>
<pre class="alert alert-error">[% HTML.escape(jobset.errormsg) %]</pre>
</div>
[% END %]
<div id="tabs-setup" class="tab-pane">
<a class="btn pull-right" href="[% c.uri_for('/jobset' project.name jobset.name "edit") %]"><i class="icon-edit"></i> Edit</a>
<table class="info-table">
<tr>
<th>Description:</th>
<td>[% HTML.escape(jobset.description) %]</td>
</tr>
<tr>
<th>Nix expression:</th>
<td>
<tt>[% HTML.escape(jobset.nixexprpath) %]</tt> in input
<tt>[% HTML.escape(jobset.nixexprinput) %]</tt>
</td>
</tr>
<tr>
<th>Enabled:</th>
<td>[% jobset.enabled ? "Yes" : "No" %]</td>
</tr>
<tr>
<th>Enable email notification:</th>
<td>[% jobset.enableemail ? "Yes" : "No" %]</td>
</tr>
<tr>
<th>Email override:</th>
<td>[% HTML.escape(jobset.emailoverride) %]</td>
</tr>
<tr>
<th>Number of builds to keep:</th>
<td>[% jobset.keepnr %]</td>
</tr>
</table>
[% INCLUDE renderInputs %]
</div>
<div id="tabs-jobs" class="tab-pane">
<p>This jobset currently contains the following [% activeJobs.size %] jobs:
<blockquote>
[% IF activeJobs.size == 0 %]<em>(none)</em>[% END %]
[% FOREACH j IN activeJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
</blockquote>
</p>
<p>This jobset used to contain the following [% inactiveJobs.size %] jobs:
<blockquote>
[% IF inactiveJobs.size == 0 %]<em>(none)</em>[% END %]
[% FOREACH j IN inactiveJobs %][% INCLUDE renderJobName project=project.name jobset=jobset.name job=j %]<br/>[% END %]
</blockquote>
</p>
</div>
</div>
[% END %]