Final work on #9583 for basic functionality

This commit is contained in:
Daniel Sheppard 2024-02-09 16:35:09 -06:00
parent 664a0eba6d
commit 50557c0f9d
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{% load form_helpers %} {% load form_helpers %}
{% if form_field %} {% if form_field %}
<div class="dropdown" style="display: inline;"> <div class="column-filter dropdown">
<a href="#" classs="btn dropdown-toggle" data-bs-toggle="dropdown" data-bs-auto-close="outside"> <a href="#" classs="btn dropdown-toggle" data-bs-toggle="dropdown" data-bs-auto-close="outside">
<i class="mdi mdi-filter-settings" style="font-size: 1.25rem;"> </i> <i class="mdi mdi-filter-settings" style="font-size: 1.25rem;"> </i>
</a> </a>

View File

@ -17,17 +17,21 @@
><i class="mdi mdi-close"></i></a> ><i class="mdi mdi-close"></i></a>
</div> </div>
{% endif %} {% endif %}
{% if table.filterset_form %}
{% include 'inc/table_header_filter_dropdown.html' with form_field=table.filterset_form|getfilterfield:column.name %}
{% endif %}
<a href="#" <a href="#"
hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}" hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"
hx-target="closest .htmx-container" hx-target="closest .htmx-container"
{% if not table.embedded %}hx-push-url="true"{% endif %} {% if not table.embedded %}hx-push-url="true"{% endif %}
>{{ column.header }}</a> >{{ column.header }}</a>
{% include 'inc/table_header_filter_dropdown.html' with form_field=table.filterset_form|getfilterfield:column.name %}
</th> </th>
{% else %} {% else %}
<th {{ column.attrs.th.as_html }}> <th {{ column.attrs.th.as_html }}>
{% if table.filterset_form %}
{% include 'inc/table_header_filter_dropdown.html' with form_field=table.filterset_form|getfilterfield:column.name %}
{% endif %}
{{ column.header }} {{ column.header }}
{% include 'inc/table_header_filter_dropdown.html' with form_field=table.filterset_form|getfilterfield:column.name %}
</th> </th>
{% endif %} {% endif %}
{% endfor %} {% endfor %}