mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
95 lines
3.8 KiB
HTML
95 lines
3.8 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 %}
|
|
<c-msg.empty
|
|
title="{% translate 'No transactions this month' %}"
|
|
subtitle="{% translate "Try adding one" %}"></c-msg.empty>
|
|
{% 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-regular fa-square-check tw-text-green-400"></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-regular fa-square 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>
|