2023-02-11 14:52:00 +00:00
|
|
|
{% load cache %}
|
2023-02-10 20:49:35 +00:00
|
|
|
{% include 'mixins/partials/notify.html' %}
|
2023-02-15 07:20:53 +00:00
|
|
|
{% cache 600 objects_profit request.user.id object_list type %}
|
2023-02-11 14:52:00 +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, every 3s"
|
|
|
|
hx-get="{{ list_url }}">
|
|
|
|
<thead>
|
|
|
|
<th>id</th>
|
|
|
|
<th>name</th>
|
|
|
|
<th>P/L</th>
|
|
|
|
<th>trade</th>
|
|
|
|
<th>balance</th>
|
|
|
|
<th>currency</th>
|
|
|
|
</thead>
|
|
|
|
{% for item in object_list %}
|
|
|
|
<tr class="
|
|
|
|
{% if item.pl > 0 %}has-background-success-light
|
|
|
|
{% elif item.pl < 0 %}has-background-danger-light
|
|
|
|
{% endif %}">
|
|
|
|
<td>{{ item.account.id }}</td>
|
|
|
|
<td>{{ item.account.name }}</td>
|
|
|
|
<td>{{ item.pl }}</td>
|
|
|
|
<td>{{ item.unrealizedPL }}</td>
|
|
|
|
<td>{{ item.balance }}</td>
|
|
|
|
<td>{{ item.currency }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2022-11-29 07:20:39 +00:00
|
|
|
|
2023-02-11 14:52:00 +00:00
|
|
|
</table>
|
|
|
|
{% endcache %}
|