Skip to content

Commit

Permalink
feat(templates): add edit button to reference list template
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Aug 26, 2024
1 parent a64fde3 commit 047daec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
<li class="list-group-item justify-content-between align-items-center d-flex">
{% if request.user.is_authenticated %}
<a href="{{ reference.get_absolute_url }}">{{ reference }} ({{ reference.id }})</a>
<div>
<a href="{% url 'apis_bibsonomy:referenceupdate' reference.id %}" class="text-warning"><span class="material-symbols-outlined">edit</span></a>
<a href="{% url "apis_bibsonomy:referencedelete" reference.id %}?redirect={{ request.path }}"
hx-delete="{% url "apis_bibsonomy:reference-detail" reference.id %}"
hx-confirm="Are your sure you want to delete reference {{ reference }} for {{ reference.referenced_object }}"
hx-target="closest li"
hx-swap="outerHTML swap:1s">Delete</a>
</div>
{% else %}
{{ reference }}
{% endif %}
Expand Down

0 comments on commit 047daec

Please sign in to comment.