summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-05-22 12:52:42 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-05-22 12:52:42 +0000
commita8d18ae31537abe658979fbdddadf34bd166f5e6 (patch)
tree6e7f4a186e46b13bc07a4ba66af5182225835650
parent3165926a539379901c5735ccfec84f5d0c389965 (diff)
parentf2ea06f8a0b0d9ba20756c169373d6db8569e370 (diff)
downloadlorry-controller-a8d18ae31537abe658979fbdddadf34bd166f5e6.tar.gz
Merge remote-tracking branch 'origin/baserock/liw/lc-static-html-without-links'
Reviewed-by: Daniel Silverstone Reviewed-by: Sam Thursfield
-rw-r--r--lorrycontroller/status.py5
-rw-r--r--templates/status.tpl15
2 files changed, 18 insertions, 2 deletions
diff --git a/lorrycontroller/status.py b/lorrycontroller/status.py
index 5e011d5..b0a3807 100644
--- a/lorrycontroller/status.py
+++ b/lorrycontroller/status.py
@@ -37,6 +37,7 @@ class StatusRenderer(object):
'troves': self.get_troves(statedb),
'warning_msg': '',
'max_jobs': self.get_max_jobs(statedb),
+ 'links': True,
}
status.update(self.get_free_disk_space(work_directory))
return status
@@ -45,7 +46,9 @@ class StatusRenderer(object):
return bottle.template(template, **status)
def write_status_as_html(self, template, status, filename):
- html = self.render_status_as_html(template, status)
+ modified_status = dict(status)
+ modified_status['links'] = False
+ html = self.render_status_as_html(template, modified_status)
try:
with open(filename, 'w') as f:
f.write(html)
diff --git a/templates/status.tpl b/templates/status.tpl
index eef9e95..9201f04 100644
--- a/templates/status.tpl
+++ b/templates/status.tpl
@@ -65,17 +65,26 @@
</tr>
% for spec in run_queue:
% if spec['running_job'] is not None:
+% if links:
<tr>
<td><a href="/1.0/job-html/{{spec['running_job']}}">{{spec['running_job']}}</a></td>
<td><a href="/1.0/lorry-html/{{spec['path']}}">{{spec['path']}}</a></td>
</tr>
+% else:
+<tr>
+<td>{{spec['running_job']}}</td>
+<td>{{spec['path']}}</td>
+</tr>
+% end
% end
% end
</table>
% end
+% if links:
<p>See separate list of <a href="/1.0/list-jobs-html">all jobs that
have ever been started</a>.</p>
+% end
<h2>Run-queue</h2>
@@ -93,10 +102,14 @@
% fields = obj[name]
<tr>
<td>{{i+1}}</td>
+% if links:
<td><a href="/1.0/lorry-html/{{spec['path']}}">{{spec['path']}}</a></td>
+% else:
+<td>{{spec['path']}}</td>
+% end
<td>{{spec['interval_nice']}}</td>
<td>{{spec['due_nice']}}</td>
-% if spec['running_job']:
+% if spec['running_job'] and links:
<td><a href="/1.0/job-html/{{spec['running_job']}}">{{spec['running_job']}}</a></td>
% else:
<td></td>