mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
81 lines
3.6 KiB
HTML
81 lines
3.6 KiB
HTML
{% load i18n %}
|
|
<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"
|
|
_="on change from #transactions-list or htmx:afterSettle
|
|
if no <input[type='checkbox']:checked/> in #transactions-list
|
|
add .tw-hidden to #actions-bar
|
|
else
|
|
remove .tw-hidden from #actions-bar
|
|
then trigger selected_transactions_updated
|
|
end
|
|
end">
|
|
<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() then trigger change">
|
|
<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() then trigger change">
|
|
<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>
|
|
<div class="vr mx-3 tw-align-middle"></div>
|
|
<span _="on selected_transactions_updated from #actions-bar
|
|
set total to 0.0
|
|
for amt in <.transaction:has(input[name='transactions']:checked) .main-amount .amount/>
|
|
set amountValue to parseFloat(amt.getAttribute('data-amount'))
|
|
if not isNaN(amountValue)
|
|
set total to total + amountValue
|
|
end
|
|
end
|
|
put total.toLocaleString() into me
|
|
end
|
|
on click
|
|
set original_value to my innerText
|
|
writeText(my innerText) on navigator.clipboard
|
|
put '{% translate "copied!" %}' into me
|
|
wait 1s
|
|
put original_value into me
|
|
end"
|
|
class="" role="button"></span>
|
|
{% endspaceless %}
|
|
</div>
|
|
</div>
|
|
</div>
|