Make hooks/callbacks inherit type

This commit is contained in:
2022-10-16 14:14:53 +01:00
parent 3af63c5ef6
commit 97d12b0fab
14 changed files with 102 additions and 64 deletions

View File

@@ -0,0 +1 @@
<button class="modal-close is-large" aria-label="close"></button>

View File

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

View File

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

View File

@@ -20,9 +20,9 @@
<div class="buttons">
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'hook_action' hook_id=item.id %}"
hx-get="{% url 'hook_action' type=type hook_id=item.id %}"
hx-trigger="click"
hx-target="#modals-here"
hx-target="#{{ type }}s-here"
class="button is-info">
<span class="icon-text">
<span class="icon">
@@ -32,7 +32,7 @@
</button>
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-delete="{% url 'hook_action' hook_id=item.id %}"
hx-delete="{% url 'hook_action' type=type hook_id=item.id %}"
hx-trigger="click"
hx-target="#hooks-table"
class="button is-danger">
@@ -42,15 +42,30 @@
</span>
</span>
</button>
<a href="{% url 'callbacks' type='{{ type }}' hook_id=item.id %}"><button
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-eye"></i>
{% if type == 'page' %}
<a href="{% url 'callbacks' type=type hook_id=item.id %}"><button
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-eye"></i>
</span>
</span>
</span>
</button>
</a>
</button>
</a>
{% else %}
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-get="{% url 'callbacks' type=type hook_id=item.id %}"
hx-trigger="click"
hx-target="#{{ type }}s-here"
class="button is-success">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-eye"></i>
</span>
</span>
</button>
{% endif %}
</div>
</td>
</tr>