83 lines
2.7 KiB
HTML
83 lines
2.7 KiB
HTML
{% load cache %}
|
|
{% load cachalot cache %}
|
|
{% get_last_invalidation 'core.Platform' as last %}
|
|
{% include 'mixins/partials/notify.html' %}
|
|
{# cache 600 objects_platform_trades request.user.id object_list type last #}
|
|
{% for platform_name, trade_map in object_list.items %}
|
|
<h2 class="title is-4">{{ platform_name }}</h2>
|
|
<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>ref</th>
|
|
<th>buyer</th>
|
|
<th>amount</th>
|
|
<th>crypto</th>
|
|
<th>provider</th>
|
|
<th>actions</th>
|
|
</thead>
|
|
{% for item in trade_map.values %}
|
|
<tr>
|
|
<td>
|
|
<a
|
|
class="has-text-grey"
|
|
onclick="window.prompt('Copy to clipboard: Ctrl+C, Enter', '{{ item.contact_id }}');">
|
|
<span class="icon" data-tooltip="Copy to clipboard">
|
|
<i class="fa-solid fa-copy" aria-hidden="true"></i>
|
|
</span>
|
|
</a>
|
|
</td>
|
|
<td>
|
|
<a
|
|
class="has-text-grey"
|
|
data-tooltip="Copy to clipboard"
|
|
onclick="window.prompt('Copy to clipboard: Ctrl+C, Enter', '{{ item.reference }}');">
|
|
<code>{{ item.reference }}</code>
|
|
</a>
|
|
</td>
|
|
<td>{{ item.buyer }}</td>
|
|
<td>{{ item.amount_fiat }} {{ item.currency }}</td>
|
|
<td>{{ item.amount_crypto }} XMR</td>
|
|
<td>{{ item.provider }}</td>
|
|
<td>
|
|
<div class="buttons">
|
|
<button
|
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
|
hx-get="{# url 'platform_update' type=type pk=item.id #}"
|
|
hx-trigger="click"
|
|
hx-target="#{{ type }}s-here"
|
|
hx-swap="innerHTML"
|
|
class="button">
|
|
<span class="icon-text">
|
|
<span class="icon">
|
|
<i class="fa-solid fa-pencil"></i>
|
|
</span>
|
|
</span>
|
|
</button>
|
|
<button
|
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
|
hx-delete="{# url 'platform_delete' type=type pk=item.id #}"
|
|
hx-trigger="click"
|
|
hx-target="#modals-here"
|
|
hx-swap="innerHTML"
|
|
hx-confirm="Are you sure you wish to delete {{ item.name }}?"
|
|
class="button">
|
|
<span class="icon-text">
|
|
<span class="icon">
|
|
<i class="fa-solid fa-xmark"></i>
|
|
</span>
|
|
</span>
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
|
|
</table>
|
|
{% endfor %}
|
|
{# endcache #} |