2022-12-08 07:20:46 +00:00
|
|
|
{% extends 'partials/generic-detail.html' %}
|
|
|
|
|
|
|
|
{% block tbody %}
|
|
|
|
{% for key, item in object.items %}
|
|
|
|
<tr>
|
|
|
|
{% if key == 'trade_ids' %}
|
|
|
|
<th>{{ key }}</th>
|
|
|
|
<td>
|
|
|
|
{% if item is not None %}
|
|
|
|
{% for trade_id in item %}
|
|
|
|
<button
|
|
|
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
2022-12-08 07:20:46 +00:00
|
|
|
hx-get="{% url 'trade_action' type=type trade_id=trade_id account_id=object.account_id %}"
|
2022-12-08 07:20:46 +00:00
|
|
|
hx-trigger="click"
|
|
|
|
hx-target="#modals-here"
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
class="button is-small {% if trade_id in valid_trade_ids %}is-primary{% else %}is-warning{% endif %}">
|
|
|
|
{{ trade_id }}
|
|
|
|
</button>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
{% else %}
|
|
|
|
<th>{{ key }}</th>
|
|
|
|
<td>
|
|
|
|
{% if item is not None %}
|
|
|
|
{{ item }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|