31 lines
786 B
HTML
31 lines
786 B
HTML
{% include 'partials/notify.html' %}
|
|
|
|
<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>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.balance }}</td>
|
|
<td>{{ item.currency }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
|
|
</table>
|