summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Müller <uves@spline.de>2013-09-26 11:00:08 +0200
committerroot <root@vm-staticweb.spline.inf.fu-berlin.de>2013-09-26 11:00:51 +0200
commit51166271ff79acb2f15f6060505f65de688adf9d (patch)
treedf3ebf54c1fe368fbe46b556d7e2ced7f4092684
parent9159492e38a46a36a861600427f0589f2c4ec180 (diff)
downloadwww-51166271ff79acb2f15f6060505f65de688adf9d.tar.gz
www-51166271ff79acb2f15f6060505f65de688adf9d.tar.bz2
www-51166271ff79acb2f15f6060505f65de688adf9d.zip
templates: increase stability against malformed templates
-rw-r--r--templates/host.html9
-rw-r--r--templates/index.html2
2 files changed, 8 insertions, 3 deletions
diff --git a/templates/host.html b/templates/host.html
index bf30fd2..9fa1b82 100644
--- a/templates/host.html
+++ b/templates/host.html
@@ -55,7 +55,9 @@
</dl>
</div>
+
<div class="tab-pane row" id="interfaces">
+ {% if addresses %}
{% for group in addresses | select_with_attribute('vserver', False) | groupby('interface') %}
<div class="span6">
<h3>{{ group.grouper }}</h3>
@@ -70,6 +72,7 @@
{% else %}
<p class="centering">no network interfaces</p>
{% endfor %}
+ {% endif %}
</div>
<div class="tab-pane" id="ports">
@@ -83,6 +86,7 @@
</tr>
</thead>
<tbody>
+ {% set ports = ports or [] %}
{% for port in ports %}
<tr>
<td>{{port['port']}}</td>
@@ -97,8 +101,8 @@
</table>
</div>
- {% if services is defined %}
<div class="tab-pane" id="services">
+ {% if services is defined %}
<table id="servicetable" class="table table-striped table-hover tablesorter">
<thead>
<tr>
@@ -135,9 +139,8 @@
{% endfor %}
</tbody>
</table>
+ {% endif %}
</div>
- {% endif %}
-
</div>
<script>
diff --git a/templates/index.html b/templates/index.html
index a5c9d7e..36d83e4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -43,9 +43,11 @@
</p>
<ul class="ips inline">
+ {% if host['addresses'] %}
{% for ip in host['addresses'] | select_with_attribute('vserver', False) | sort(attribute='address') %}
<li>{{ip['address']}}</li>
{% endfor %}
+ {% endif %}
</ul>
</div>
</li>