Clean up object list view

This commit is contained in:
jeremystretch
2021-07-10 22:06:28 -04:00
parent 726b148aa9
commit 0f99e5fcaa
5 changed files with 146 additions and 147 deletions
+63 -61
View File
@@ -1,65 +1,67 @@
{% load form_helpers %}
{% load helpers %}
<div class="collapse" id="advanced-search-content">
<form action="." method="get">
<div class="card">
<h5 class="card-header">
Advanced Search
</h5>
<div class="card-body overflow-visible d-flex flex-wrap justify-content-between py-3">
{% for field in filter_form.hidden_fields %}
{{ field }}
{% endfor %}
{% if filter_form.field_groups %}
{% for group in filter_form.field_groups %}
<div class="col">
{% for name in group %}
{% with field=filter_form|get_item:name %}
{% if field|widget_type == 'checkboxinput' %}
<div class="form-check mb-3">
<label class="form-check-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
</div>
{% else %}
<div class="form-floating mb-3 mx-3">
{{ field }}
{{ field.label_tag }}
</div>
{% endif %}
{% endwith %}
{% endfor %}
</div>
{% endfor %}
{% else %}
{% for field in filter_form.visible_fields %}
<div class="col">
{% if field|widget_type == 'checkboxinput' %}
<div class="form-check mb-3">
<label class="form-check-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
</div>
{% else %}
<div class="form-floating mb-3">
{{ field }}
{{ field.label_tag }}
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
</div>
<div class="card-footer text-end noprint border-0">
<button type="button" class="btn btn-sm btn-outline-dark m-1" data-bs-toggle="collapse" data-bs-target="#advanced-search-content">
<i class="mdi mdi-close"></i> Close
</button>
<button type="button" class="btn btn-sm btn-outline-danger m-1" data-reset-select>
<i class="mdi mdi-backspace"></i> Reset
</button>
<button type="submit" class="btn btn-sm btn-primary m-1">
<i class="mdi mdi-magnify"></i> Search
</button>
</div>
</div>
</form>
<div id="advanced-search-content" class="collapse mb-3">
<div class="col col-md-12 noprint">
<form action="." method="get">
<div class="card">
<h5 class="card-header">
Advanced Search
</h5>
<div class="card-body overflow-visible d-flex flex-wrap justify-content-between py-3">
{% for field in filter_form.hidden_fields %}
{{ field }}
{% endfor %}
{% if filter_form.field_groups %}
{% for group in filter_form.field_groups %}
<div class="col">
{% for name in group %}
{% with field=filter_form|get_item:name %}
{% if field|widget_type == 'checkboxinput' %}
<div class="form-check mb-3">
<label class="form-check-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
</div>
{% else %}
<div class="form-floating mb-3 mx-3">
{{ field }}
{{ field.label_tag }}
</div>
{% endif %}
{% endwith %}
{% endfor %}
</div>
{% endfor %}
{% else %}
{% for field in filter_form.visible_fields %}
<div class="col">
{% if field|widget_type == 'checkboxinput' %}
<div class="form-check mb-3">
<label class="form-check-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
</div>
{% else %}
<div class="form-floating mb-3">
{{ field }}
{{ field.label_tag }}
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
</div>
<div class="card-footer text-end noprint border-0">
<button type="button" class="btn btn-sm btn-outline-dark m-1" data-bs-toggle="collapse" data-bs-target="#advanced-search-content">
<i class="mdi mdi-close"></i> Close
</button>
<button type="button" class="btn btn-sm btn-outline-danger m-1" data-reset-select>
<i class="mdi mdi-backspace"></i> Reset
</button>
<button type="submit" class="btn btn-sm btn-primary m-1">
<i class="mdi mdi-magnify"></i> Search
</button>
</div>
</div>
</form>
</div>
</div>
+1 -1
View File
@@ -1,6 +1,6 @@
{% load helpers %}
<div class="paginator float-end text-end my-3">
<div class="paginator float-end text-end">
{% if paginator.num_pages > 1 %}
<div class="btn-group btn-group-sm mb-3" role="group" aria-label="Pages">
{% if page.has_previous %}
-1
View File
@@ -1,7 +1,6 @@
{% load django_tables2 %}
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
<caption class="text-center small mt-3"></caption>
{% if table.show_header %}
<thead>
<tr>