Add all model fields to callbacks

This commit is contained in:
2022-10-16 14:37:49 +01:00
parent 97d12b0fab
commit 5a7332eb96
9 changed files with 66 additions and 20 deletions

View File

@@ -1,3 +1,3 @@
<i
class="fa-solid fa-xmark has-text-grey-light float-right"
onclick='grid.removeWidget("widget-{{ unique }}");'></i>
class="fa-solid fa-xmark has-text-grey-light float-right"
onclick='grid.removeWidget("widget-{{ unique }}");'></i>

View File

@@ -1,3 +1,3 @@
<i
class="fa-solid fa-xmark has-text-grey-light float-right"
data-script="on click remove the closest <nav/>"></i>
class="fa-solid fa-xmark has-text-grey-light float-right"
data-script="on click remove the closest <nav/>"></i>

View File

@@ -6,9 +6,9 @@
<form
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
{% if hook_id is not None %}
hx-put="{% url 'hook_action' hook_id %}"
hx-put="{% url 'hook_action' type=type hook_id=hook_id %}"
{% else %}
hx-put="{% url 'hook_action' %}"
hx-put="{% url 'hook_action' type=type %}"
{% endif %}
hx-target="#hooks-table"
hx-swap="outerHTML">

View File

@@ -6,6 +6,14 @@
<th>hook id</th>
<th>hook name</th>
<th>title</th>
<th>message</th>
<th>period</th>
<th>sent</th>
<th>trade</th>
<th>exchange</th>
<th>item</th>
<th>currency</th>
<th>contract</th>
<th>actions</th>
</thead>
{% for item in items %}
@@ -15,12 +23,21 @@
<td>
<a
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'hook_action' hook_id=item.hook.id %}"
hx-get="{% url 'hook_action' type=type hook_id=item.hook.id %}"
hx-trigger="click"
hx-target="#modals-here">{{ item.hook.name }}
</a>
</td>
<td><pre>{{ item.title }}</pre></td>
<td>{{ item.title }}</td>
<td>{{ item.message }}</td>
<td>{{ item.period }}</td>
<td>{{ item.timestamp_sent }}</td>
<td>{{ item.timestamp_trade }}</td>
<td>{{ item.market_exchange }}</td>
<td>{{ item.market_item }}</td>
<td>{{ item.market_currency }}</td>
<td>{{ item.market_contract }}</td>
<td>
<div class="buttons">