Implement managing hooks
This commit is contained in:
28
core/templates/modals/add-hook.html
Normal file
28
core/templates/modals/add-hook.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{% extends 'wm/modal.html' %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% load crispy_forms_bulma_field %}
|
||||
{% block modal_content %}
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-put="{% url 'add-hook' %}"
|
||||
hx-target="#hooks-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>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
core/templates/partials/hook-list.html
Normal file
32
core/templates/partials/hook-list.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% include 'partials/notify.html' %}
|
||||
|
||||
<table class="table is-fullwidth is-hoverable" id="hooks-table">
|
||||
<thead>
|
||||
<th>user</th>
|
||||
<th>hook</th>
|
||||
<th>received hooks</th>
|
||||
<th>actions</th>
|
||||
</thead>
|
||||
{% for item in hooks %}
|
||||
<tr>
|
||||
<td>{{ item.user }}</td>
|
||||
<td>{{ item.hook }}</td>
|
||||
<td>{{ item.received }}</td>
|
||||
<td>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="#"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="buttons">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="#"
|
||||
hx-get="{% url 'add-hook' %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
@@ -15,33 +15,6 @@
|
||||
</div>
|
||||
|
||||
{% include 'partials/notify.html' %}
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
<thead>
|
||||
<th>user</th>
|
||||
<th>hook</th>
|
||||
<th>received hooks</th>
|
||||
<th>actions</th>
|
||||
</thead>
|
||||
{% for item in hooks %}
|
||||
<tr>
|
||||
<td>{{ item.user }}</td>
|
||||
<td>{{ item.hook }}</td>
|
||||
<td>{{ item.received }}</td>
|
||||
<td>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="#"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</span>
|
||||
<span>Hook</span>
|
||||
</span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% include 'partials/hook-list.html' %}
|
||||
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user