Geoffrey-Django/GeoffreyApp/templates/GeoffreyApp/location_table.html

36 lines
1.0 KiB
HTML

<table id="loc_table" class="table table-hover link-table">
<thead class="bg-dark">
<tr>
<th>Location Name</th>
<th>Position</th>
<th>Tunnel</th>
{% if show_owner %}
<th>Owner</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for loc in loc_list %}
<tr>
<td><a href="{{ loc.link }}">{{ loc.name }}</a></td>
<td>{{ loc.position }}</td>
<td>{% if loc.tunnel %} {{ loc.tunnel.tunnel_str }}{% else %}n/a{% endif %}</td>
{% if show_owner %}
<td>
<a href="{{ loc.owner.first.link }}">{{ loc.owner.first }}</a>
{% for owner in loc.owner.all|slice:"1:3" %},
<a href="{{ owner.link }}">{{ owner }}</a>
{% endfor %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<script>
$(document).ready(function () {
$('#loc_table').DataTable();
});
</script>