mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Plus cleaner template markup! More HTML-in-Python tho, which always feels a bit CSS-in-JS
68 lines
2.6 KiB
HTML
68 lines
2.6 KiB
HTML
{% load url_replace from filters %}
|
|
{% load orderby from filters %}
|
|
{% load paginator from filters %}
|
|
{% load linkornone from filters %}
|
|
<div class="row justify-content-end">
|
|
<form class="form-inline">
|
|
{% csrf_token %}
|
|
<div class="input-group">
|
|
<input type="search" name="q" placeholder="Search" value="{{ request.GET.q }}"
|
|
class="form-control"/>
|
|
<span class="input-group-append"><button type="submit" class="btn btn-info" id="id_search">Search</button></span>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="row justify-content-end py-3">
|
|
<a href="{% url create %}" class="btn btn-primary">New <span
|
|
class="fas fa-plus"></span></a>
|
|
</div>
|
|
<div class="row">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Name<a href="?{% orderby request 'orderBy' 'name' %}"><span class="caret"></span></a></td>
|
|
<th scope="col">Email</th>
|
|
<th scope="col">Phone</th>
|
|
<th scope="col">Notes</th>
|
|
{% if union_account %} {#TODO#}
|
|
<th scope="col">Union Account</th>
|
|
{% endif %}
|
|
<th scope="col">Quick Links</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for object in object_list %}
|
|
<tr id="row_item">
|
|
<th scope="row" class="align-middle" id="cell_name">{{ object.name }}</th>
|
|
<td class="align-middle">{{ object.email|linkornone:'mailto' }}</td>
|
|
<td class="align-middle">{{ object.phone|linkornone:'tel' }}</td>
|
|
<td class="align-middle">{{ object.notes|yesno|capfirst }}</td>
|
|
{% if union_account %}
|
|
<td>{{ object.union_account|yesno|capfirst }}</td>
|
|
{% endif %}
|
|
<td>
|
|
<div class="btn-group d-flex" role="group">
|
|
<a href="{% url detail object.pk %}" class="btn btn-primary btn-sm modal-href">
|
|
<i class="fas fa-eye"></i> View
|
|
</a>
|
|
<a href="{% url edit object.pk %}" class="btn btn-warning btn-sm"><i
|
|
class="fas fa-edit"></i> Edit</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr class="table-warning">
|
|
<td colspan="6" class="text-center">Nothing found</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% if is_paginated %}
|
|
<div class="row justify-content-center">
|
|
{% paginator %}
|
|
</div>
|
|
{% endif %}
|