mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
101 lines
4.0 KiB
HTML
101 lines
4.0 KiB
HTML
{% load natural %}
|
|
{% load i18n %}
|
|
{% regroup transactions by date|customnaturaldate as transactions_by_date %}
|
|
|
|
<div id="transactions-list"
|
|
_="on change or click
|
|
if no <input[type='checkbox']:checked/> in me
|
|
add .tw-hidden to #actions-bar
|
|
else
|
|
remove .tw-hidden from #actions-bar
|
|
end
|
|
end">
|
|
{% for x in transactions_by_date %}
|
|
<div>
|
|
<div class="mt-3 mb-1 w-100 tw-text-base border-bottom bg-body">
|
|
<a class="text-decoration-none d-inline-block w-100"
|
|
role="button"
|
|
data-bs-toggle="collapse"
|
|
data-bs-target="#{{ x.grouper|slugify }}"
|
|
id="#{{ x.grouper|slugify }}-collapsible"
|
|
aria-expanded="true"
|
|
aria-controls="collapseExample">
|
|
{{ x.grouper }}
|
|
</a>
|
|
</div>
|
|
<div class="collapse show" id="{{ x.grouper|slugify }}">
|
|
<div class="d-flex flex-column">
|
|
{% for transaction in x.list %}
|
|
<c-transaction.item
|
|
:transaction="transaction"></c-transaction.item>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% empty %}
|
|
<div class="row p-5">
|
|
<div class="col p-5">
|
|
<div class="text-center">
|
|
<i class="fa-solid fa-circle-xmark tw-text-6xl"></i>
|
|
<p class="lead mt-4 mb-0">{% translate "No transactions this month" %}</p>
|
|
<p class="tw-text-gray-500">{% translate "Try adding one" %}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
<!-- Floating bar -->
|
|
<div class="tw-sticky tw-bottom-4 tw-left-0 tw-right-0 tw-z-50 tw-hidden mx-auto tw-w-fit" id="actions-bar">
|
|
<div class="card slide-in-left">
|
|
<div class="card-body p-2">
|
|
{% spaceless %}
|
|
<div class="btn-group" role="group">
|
|
<button class="btn btn-secondary btn-sm"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-title="{% translate 'Select All' %}"
|
|
_="on click set <#transactions-list input[type='checkbox']/>'s checked to true then call me.blur()">
|
|
<i class="fa-solid fa-check-double"></i>
|
|
</button>
|
|
<button class="btn btn-secondary btn-sm"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-title="{% translate 'Unselect All' %}"
|
|
_="on click set <#transactions-list input[type='checkbox']/>'s checked to false then call me.blur()">
|
|
<i class="fa-solid fa-xmark tw-text-red-400"></i>
|
|
</button>
|
|
</div>
|
|
<div class="vr mx-3 tw-align-middle"></div>
|
|
<div class="btn-group me-3" role="group">
|
|
<button class="btn btn-secondary btn-sm"
|
|
hx-get="{% url 'transactions_bulk_pay' %}"
|
|
hx-include=".transaction"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-title="{% translate 'Mark as paid' %}">
|
|
<i class="fa-regular fa-circle-check tw-text-green-400"></i>
|
|
</button>
|
|
<button class="btn btn-secondary btn-sm"
|
|
hx-get="{% url 'transactions_bulk_unpay' %}"
|
|
hx-include=".transaction"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-title="{% translate 'Mark as unpaid' %}">
|
|
<i class="fa-regular fa-circle tw-text-red-400"></i>
|
|
</button>
|
|
</div>
|
|
<button class="btn btn-secondary btn-sm"
|
|
hx-get="{% url 'transactions_bulk_delete' %}"
|
|
hx-include=".transaction"
|
|
hx-trigger="confirmed"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-title="{% translate 'Delete' %}"
|
|
data-bypass-on-ctrl="true"
|
|
data-title="{% translate "Are you sure?" %}"
|
|
data-text="{% translate "You won't be able to revert this!" %}"
|
|
data-confirm-text="{% translate "Yes, delete them!" %}"
|
|
_="install prompt_swal">
|
|
<i class="fa-solid fa-trash text-danger"></i>
|
|
</button>
|
|
{% endspaceless %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|