Dedupe generic search logic

This commit is contained in:
2020-05-25 22:47:25 +01:00
parent d070f97696
commit 177c37ffbc
5 changed files with 35 additions and 102 deletions

View File

@@ -5,7 +5,7 @@
<form class="form-inline pr-3">
{% csrf_token %}
<div class="input-group pull-right">
<input type="search" name="query" placeholder="Search" value="{{ request.GET.query }}"
<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-primary" id="id_search">Search</button></span>
</div>
@@ -31,9 +31,9 @@
</thead>
<tbody>
{% for object in object_list %}
<tr>
<tr id="row_item">
<th scope="row" class="align-middle">{{ object.pk }}</th>
<td class="align-middle">{{ object.name }}</td>
<td class="align-middle" id="cell_name">{{ object.name }}</td>
<td class="align-middle">{{ object.email }}</td>
<td class="align-middle">{% if object.phone %}<a href="tel:{{ object.phone }}">{%endif%}{{ object.phone }}{% if object.phone %}</a>{%endif%}</td>
<td class="align-middle">{{ object.notes|yesno|capfirst }}</td>