mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-09-13 13:22:03 +02:00
feat(ui:filter): add quick clear button to filter button
This commit is contained in:
@@ -52,11 +52,12 @@
|
||||
{# Main control bar with filter, search, and ordering #}
|
||||
<div class="join w-full">
|
||||
|
||||
<button class="btn btn-secondary join-item relative z-1" type="button"
|
||||
@click="filterOpen = !filterOpen"
|
||||
:aria-expanded="filterOpen" id="filter-button"
|
||||
title="{% translate 'Filter transactions' %}"
|
||||
_="on change from #filter-container
|
||||
<div class="relative join-item z-10">
|
||||
<button class="btn btn-secondary join-item relative z-1" type="button"
|
||||
@click="filterOpen = !filterOpen"
|
||||
:aria-expanded="filterOpen" id="filter-button"
|
||||
title="{% translate 'Filter transactions' %}"
|
||||
_="on change from #filter-container
|
||||
-- Check if any filter has a non-default value
|
||||
set hasActiveFilter to false
|
||||
|
||||
@@ -156,9 +157,10 @@
|
||||
else
|
||||
add .hidden to #filter-active-indicator
|
||||
end">
|
||||
<i class="fa-solid fa-filter fa-fw"></i>
|
||||
<span id="filter-active-indicator" class="absolute -top-1 -right-1 w-3 h-3 bg-error rounded-full {% if not filter_is_active %}hidden {% endif %}z-10"></span>
|
||||
</button>
|
||||
<i class="fa-solid fa-filter fa-fw"></i>
|
||||
</button>
|
||||
{% include "transactions/fragments/filter_active_indicator.html" %}
|
||||
</div>
|
||||
|
||||
{# Search box #}
|
||||
<label for="quick-search" class="hidden">
|
||||
@@ -226,7 +228,7 @@
|
||||
{% include "transactions/fragments/filter_form.html" %}
|
||||
|
||||
<div class="text-right">
|
||||
<a class="btn btn-outline btn-error btn-sm w-fit"
|
||||
<a id="filter-clear" class="btn btn-outline btn-error btn-sm w-fit"
|
||||
href="{{ request.path }}"
|
||||
hx-get="{% url 'transaction_filter_clear' %}"
|
||||
hx-target="#filter"
|
||||
|
||||
Reference in New Issue
Block a user