Implement CRUD for accounts and trades
This commit is contained in:
20
core/templates/window-content/accounts.html
Normal file
20
core/templates/window-content/accounts.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="buttons">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'account_action' type=type %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</span>
|
||||
<span>Account</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% include 'partials/notify.html' %}
|
||||
{% include 'partials/account-list.html' %}
|
||||
|
||||
|
||||
31
core/templates/window-content/add-account.html
Normal file
31
core/templates/window-content/add-account.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% include 'partials/notify.html' %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% load crispy_forms_bulma_field %}
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
{% if account_id is not None %}
|
||||
hx-put="{% url 'account_action' type=type account_id=account_id %}"
|
||||
{% else %}
|
||||
hx-put="{% url 'account_action' type=type %}"
|
||||
{% endif %}
|
||||
hx-target="#accounts-table"
|
||||
hx-swap="outerHTML">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button
|
||||
type="button"
|
||||
class="button is-light modal-close-button">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="button is-info modal-close-button">Submit</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
31
core/templates/window-content/add-trade.html
Normal file
31
core/templates/window-content/add-trade.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{% include 'partials/notify.html' %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% load crispy_forms_bulma_field %}
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
{% if trade_id is not None %}
|
||||
hx-put="{% url 'trade_action' type=type trade_id=trade_id %}"
|
||||
{% else %}
|
||||
hx-put="{% url 'trade_action' type=type %}"
|
||||
{% endif %}
|
||||
hx-target="#trades-table"
|
||||
hx-swap="outerHTML">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button
|
||||
type="button"
|
||||
class="button is-light modal-close-button">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="button is-info modal-close-button">Submit</button>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,6 +90,47 @@
|
||||
</button>
|
||||
<td>
|
||||
</tr>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
<tr>
|
||||
<td>Accounts</td>
|
||||
<td>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'accounts' type='modal' %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon" data-tooltip="Modal">
|
||||
<i class="fa-solid fa-window-maximize"></i>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'accounts' type='widget' %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#widgets-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon" data-tooltip="Widget">
|
||||
<i class="fa-solid fa-sidebar"></i>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'accounts' type='window' %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#windows-here"
|
||||
hx-swap="afterend"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon" data-tooltip="Window">
|
||||
<i class="fa-solid fa-window-restore"></i>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
<td>
|
||||
</tr>
|
||||
</div>
|
||||
</table>
|
||||
|
||||
20
core/templates/window-content/trades.html
Normal file
20
core/templates/window-content/trades.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<div class="buttons">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'trade_action' type=type %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</span>
|
||||
<span>Trade</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% include 'partials/notify.html' %}
|
||||
{% include 'partials/trade-list.html' %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user