feat: add soft search to config pages

This commit is contained in:
Herculino Trotta
2024-12-01 12:15:56 -03:00
parent 4f14782f12
commit 3bcac31495
13 changed files with 373 additions and 329 deletions
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if account_groups %} {% if account_groups %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -58,3 +60,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
+6 -1
View File
@@ -14,13 +14,16 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if accounts %} {% if accounts %}
<c-config.search></c-config.search>
<table class="table table-hover text-nowrap"> <table class="table table-hover text-nowrap">
<thead> <thead>
<tr> <tr>
<th scope="col" class="col-auto"></th> <th scope="col" class="col-auto"></th>
<th scope="col" class="col">{% translate 'Name' %}</th> <th scope="col" class="col">{% translate 'Name' %}</th>
<th scope="col" class="col">{% translate 'Group' %}</th>
<th scope="col" class="col">{% translate 'Currency' %}</th> <th scope="col" class="col">{% translate 'Currency' %}</th>
<th scope="col" class="col">{% translate 'Exchange Currency' %}</th> <th scope="col" class="col">{% translate 'Exchange Currency' %}</th>
<th scope="col" class="col">{% translate 'Is Asset' %}</th> <th scope="col" class="col">{% translate 'Is Asset' %}</th>
@@ -53,6 +56,7 @@
</div> </div>
</td> </td>
<td class="col">{{ account.name }}</td> <td class="col">{{ account.name }}</td>
<td class="col">{{ account.group.name }}</td>
<td class="col">{{ account.currency }} ({{ account.currency.code }})</td> <td class="col">{{ account.currency }} ({{ account.currency.code }})</td>
<td class="col">{% if account.exchange_currency %}{{ account.exchange_currency }} ( <td class="col">{% if account.exchange_currency %}{{ account.exchange_currency }} (
{{ account.exchange_currency.code }}){% else %}-{% endif %}</td> {{ account.exchange_currency.code }}){% else %}-{% endif %}</td>
@@ -67,3 +71,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
+4 -1
View File
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if categories %} {% if categories %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -62,3 +64,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
+11
View File
@@ -0,0 +1,11 @@
{% load i18n %}
<div id="search" class="mb-3">
<label class="w-100">
<input type="search"
class="form-control"
placeholder="{% translate 'Search' %}"
_="on input or search
show < tbody>tr /> in <table/>
when its textContent.toLowerCase() contains my value.toLowerCase()"/>
</label>
</div>
+4 -1
View File
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if currencies %} {% if currencies %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -60,3 +62,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
+4 -1
View File
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if entities %} {% if entities %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -58,3 +60,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
@@ -36,7 +36,9 @@
</ul> </ul>
</div> </div>
<div class="card">
<div id="exchange-rates-table" class="show-loading"></div> <div id="exchange-rates-table" class="show-loading"></div>
</div>
</div> </div>
</div> </div>
@@ -26,7 +26,9 @@
</ul> </ul>
</div> </div>
<div class="card-body">
<div id="installment-plans-table"></div> <div id="installment-plans-table"></div>
</div>
</div> </div>
</div> </div>
@@ -1,11 +1,13 @@
{% load currency_display %} {% load currency_display %}
{% load i18n %} {% load i18n %}
{% if active %} {% if active %}
<div class="card-body show-loading" hx-get="{% url 'active_installment_plans_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML"> <div class="show-loading" hx-get="{% url 'active_installment_plans_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
{% else %} {% else %}
<div class="card-body show-loading" hx-get="{% url 'finished_installment_plans_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML"> <div class="show-loading" hx-get="{% url 'finished_installment_plans_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
{% endif %} {% endif %}
{% if installment_plans %} {% if installment_plans %}
<c-config.search></c-config.search>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover align-middle"> <table class="table table-hover align-middle">
<thead> <thead>
@@ -29,7 +29,9 @@
</ul> </ul>
</div> </div>
<div class="card-body">
<div id="recurring-transactions-table"></div> <div id="recurring-transactions-table"></div>
</div>
</div> </div>
</div> </div>
@@ -1,13 +1,15 @@
{% load currency_display %} {% load currency_display %}
{% load i18n %} {% load i18n %}
{% if status == "active" %} {% if status == "active" %}
<div class="card-body show-loading" hx-get="{% url 'active_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML"> <div class="show-loading" hx-get="{% url 'active_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
{% elif status == 'paused' %} {% elif status == 'paused' %}
<div class="card-body show-loading" hx-get="{% url 'paused_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML"> <div class="show-loading" hx-get="{% url 'paused_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
{% elif status == 'finished' %} {% elif status == 'finished' %}
<div class="card-body show-loading" hx-get="{% url 'finished_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML"> <div class="show-loading" hx-get="{% url 'finished_recurring_transaction_list' %}" hx-trigger="updated from:window" hx-swap="outerHTML">
{% endif %} {% endif %}
{% if recurring_transactions %} {% if recurring_transactions %}
<c-config.search></c-config.search>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover align-middle"> <table class="table table-hover align-middle">
<thead> <thead>
+4 -1
View File
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if transaction_rules %} {% if transaction_rules %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -71,3 +73,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
+4 -1
View File
@@ -14,8 +14,10 @@
{% endspaceless %} {% endspaceless %}
</div> </div>
<div class="border p-3 rounded-3 table-responsive"> <div class="card">
<div class="card-body table-responsive">
{% if tags %} {% if tags %}
<c-config.search></c-config.search>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
@@ -58,3 +60,4 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>