Browse Source

Only show listing table if we have matches

pm2
Luke Childs 8 years ago
parent
commit
11867f0e5a
  1. 52
      views/listing.html

52
views/listing.html

@ -6,30 +6,34 @@
<h2>{{ error.statusMessage }}</h2> <h2>{{ error.statusMessage }}</h2>
{% else %} {% else %}
<h2>{{ title }}</h2> <h2>{{ title }}</h2>
<table> {% if nodes.length %}
<thead> <table>
<tr> <thead>
<th>Nickname</th> <tr>
<th>Bandwidth</th> <th>Nickname</th>
<th>Uptime</th> <th>Bandwidth</th>
<th>Country</th> <th>Uptime</th>
<th>Flags</th> <th>Country</th>
<th>Type</th> <th>Flags</th>
</tr> <th>Type</th>
</thead> </tr>
<tbody> </thead>
{% for node in nodes %} <tbody>
<tr> {% for node in nodes %}
<td><a href="/node/{{ node.fingerprint if node.fingerprint else node.hashed_fingerprint }}">{{ node.nickname }}</a></td> <tr>
<td>{{ node | bandwidth }}</td> <td><a href="/node/{{ node.fingerprint if node.fingerprint else node.hashed_fingerprint }}">{{ node.nickname }}</a></td>
<td>{{ node | uptime }}</td> <td>{{ node | bandwidth }}</td>
<td>{{ node.country_name }}</td> <td>{{ node | uptime }}</td>
<td>{{ node.flags | join(', ') }}</td> <td>{{ node.country_name }}</td>
<td>{{ node.type | title }}</td> <td>{{ node.flags | join(', ') }}</td>
</tr> <td>{{ node.type | title }}</td>
{% endfor %} </tr>
</tbody> {% endfor %}
</table> </tbody>
</table>
{% else %}
<h3>No matches</h3>
{% endif %}
{% if req.query.s %} {% if req.query.s %}
<section class="pagination"> <section class="pagination">
{% if req.query.p > 1 %} {% if req.query.p > 1 %}

Loading…
Cancel
Save