pluto/core/templates/partials/banks-transactions-list.html

70 lines
2.2 KiB
HTML
Raw Normal View History

{% load cache %}
{% load cachalot cache %}
{% get_last_invalidation 'core.Aggregator' as last %}
{% include 'mixins/partials/notify.html' %}
{# cache 600 objects_banks_transactions request.user.id object_list type last #}
2023-03-11 11:45:09 +00:00
<table
class="table is-fullwidth is-hoverable"
hx-target="#{{ context_object_name }}-table"
id="{{ context_object_name }}-table"
hx-swap="outerHTML"
hx-trigger="{{ context_object_name_singular }}Event from:body"
hx-get="{{ list_url }}">
<thead>
<th>id</th>
<th>ts</th>
<th>recipient</th>
<th>sender</th>
<th>amount</th>
<th>currency</th>
<th>reference</th>
2023-03-11 11:45:09 +00:00
<th>state</th>
</thead>
{% for item in object_list %}
<tr class="
{% if item.proprietaryBankTransactionCode == 'EXCHANGE' %}has-background-grey-light
{% elif item.amount < 0 %}has-background-danger-light
{% elif item.amount > 0 %}has-background-success-light
{% endif %}">
<td>
<a
class="has-text-grey"
2023-03-11 11:45:09 +00:00
onclick="window.prompt('Copy to clipboard: Ctrl+C, Enter', '{{ item.transaction_id }}');">
<span class="icon" data-tooltip="Copy to clipboard">
<i class="fa-solid fa-copy" aria-hidden="true"></i>
</span>
</a>
</td>
<td>{{ item.ts }}</td>
<td>
{{ item.creditorName }}
{% for item in item.creditorAccount.values %}
{{ item|default_if_none:"—" }}
{% endfor %}
</td>
<td>
{{ item.debtorName }}
{% for item in item.debtorAccount.values %}
{{ item|default_if_none:"—" }}
{% endfor %}
</td>
<td>{{ item.amount }}</td>
<td>{{ item.currency }}</td>
<td>{{ item.reference }}</td>
2023-03-11 11:45:09 +00:00
<td>
{% if item.state == 'pending' %}
<span class="icon has-text-warning" data-tooltip="Pending">
<i class="fa-solid fa-hourglass" aria-hidden="true"></i>
</span>
{% elif item.state == 'booked' %}
<span class="icon has-text-success" data-tooltip="Booked">
<i class="fa-solid fa-check" aria-hidden="true"></i>
</span>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{# endcache #}