pluto/core/templates/partials/platform-trades.html

83 lines
2.7 KiB
HTML
Raw Normal View History

2023-03-10 00:23:05 +00:00
{% load cache %}
{% load cachalot cache %}
2023-03-18 10:48:07 +00:00
{% get_last_invalidation 'core.Trade' as last %}
2023-03-10 00:23:05 +00:00
{% 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>
2023-03-12 11:40:23 +00:00
<th>ref</th>
2023-03-10 00:23:05 +00:00
<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"
2023-03-12 12:52:34 +00:00
onclick="window.prompt('Copy to clipboard: Ctrl+C, Enter', '{{ item.contact_id }}');">
2023-03-10 00:23:05 +00:00
<span class="icon" data-tooltip="Copy to clipboard">
<i class="fa-solid fa-copy" aria-hidden="true"></i>
</span>
</a>
</td>
2023-03-12 11:40:23 +00:00
<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>
2023-03-12 12:52:34 +00:00
<td>{{ item.buyer }}</td>
<td>{{ item.amount_fiat }} {{ item.currency }}</td>
<td>{{ item.amount_crypto }} XMR</td>
<td>{{ item.provider }}</td>
2023-03-10 00:23:05 +00:00
<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 #}