Cat breeds
This commit is contained in:
@ -3,5 +3,52 @@
|
||||
|
||||
|
||||
{% block content %}
|
||||
{{ js_alert_work_in_progress() }}
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<form
|
||||
class="row g-3 align-items-center"
|
||||
>
|
||||
<div class="col-auto">
|
||||
<label class="form-label">Breed:</label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input
|
||||
type="text"
|
||||
name="breed"
|
||||
class="form-control"
|
||||
hx-get="{{ url("filter-list-filter") }}"
|
||||
hx-target="#cat-breeds-table"
|
||||
hx-trigger="keyup"
|
||||
hx-include="select[name='country']"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label class="form-label">Country:</label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<select
|
||||
name="country"
|
||||
class="form-select"
|
||||
hx-get="{{ url("filter-list-filter") }}"
|
||||
hx-target="#cat-breeds-table"
|
||||
hx-trigger="change"
|
||||
hx-include="input[name='breed']"
|
||||
>
|
||||
<option value="">
|
||||
- All -
|
||||
</option>
|
||||
{% for country in countries %}
|
||||
<option value="{{ country }}">
|
||||
{{ country }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% include "main/filter_list_content.html" %}
|
||||
{% endblock %}
|
||||
|
||||
22
project/main/templates/main/filter_list_content.html
Normal file
22
project/main/templates/main/filter_list_content.html
Normal file
@ -0,0 +1,22 @@
|
||||
<table class="table" id="cat-breeds-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Breed</th>
|
||||
<th>Country</th>
|
||||
<th>Origin</th>
|
||||
<th>Coat</th>
|
||||
<th>Pattern</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for breed in cat_breeds %}
|
||||
<tr>
|
||||
<td>{{ breed.name }}</td>
|
||||
<td>{{ breed.country }}</td>
|
||||
<td>{{ breed.origin }}</td>
|
||||
<td>{{ breed.coat }}</td>
|
||||
<td>{{ breed.pattern }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user