Fix delete record JS mess

This commit is contained in:
2024-11-11 17:21:00 +01:00
parent 0a0f553510
commit adee0f6d0f
5 changed files with 49 additions and 19 deletions

View File

@@ -54,7 +54,11 @@
{% for record in records %}
<tr>
<td><a href="{{ path('app_bibliography', {'id' : record.id}) }}">{{ record.id }}</a></td>
<td><a href="{{ path('app_bibliography', {'id' : record.id}) }}">{{ record.citation }}</a></td>
<td>
<a data-delete-record-target="name" href="{{ path('app_bibliography', {'id' : record.id}) }}">
{{ record.citation }}
</a>
</td>
<td>{{ record.status }}</td>
<td>{{ record.owner }}</td>
<td style="max-width: 350px;">{{ record.reference }}</td>
@@ -69,13 +73,13 @@
<i class="fa fa-edit"></i>
</span>
</button>
<a href="{{ path('app_bibliography_del', {'id' : record.id}) }}"
<button data-url="{{ path('app_bibliography_del', {'id' : record.id}) }}"
class="button is-small is-danger" title="Delete record"
data-delete-record-target="path" data-action="click->delete-record#show">
data-delete-record-target="path" data-action="click->delete-record#warn">
<span class="icon">
<i class="fa fa-trash"></i>
</span>
</a>
</button>
</div>
</td>
</tr>
@@ -92,7 +96,7 @@
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
<p class="is-size-5">This record will be permanently deleted. Proceed?</p>
<p class="is-size-5" data-delete-record-target="message"></p>
</section>
<footer class="modal-card-foot">
<div class="buttons is-right">