Implement viewing transactions for an account
This commit is contained in:
57
core/templates/partials/banks-transactions-list.html
Normal file
57
core/templates/partials/banks-transactions-list.html
Normal file
@@ -0,0 +1,57 @@
|
||||
{% 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 #}
|
||||
<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>
|
||||
</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"
|
||||
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>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
{# endcache #}
|
||||
Reference in New Issue
Block a user