Skip to content

Commit

Permalink
fixing delete not working in new menu format
Browse files Browse the repository at this point in the history
  • Loading branch information
acholyn committed Jun 18, 2024
1 parent 143be32 commit 24786bd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/rard/templates/research/partials/render_locked_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

</div>
<div>
<form novalidate enctype="multipart/form-data" autocomplete='off' action='{{ request.path }}' class="form"
method='POST'>
{% csrf_token %}
{% if object.locked_by == request.user %}
<div class="dropdown show">
Expand All @@ -19,8 +17,7 @@
</a>

<div class="dropdown-menu text-center p-2" aria-labelledby="dropdownMenuLink">
<form novalidate class='form-group' action='{% if is_testimonium %}{% url "testimonium:delete" testimonium.pk %} {% elif is_work %}{% url "work:delete" work.pk %} {% elif is_antiquarian %}{% url "antiquarian:delete" antiquarian.pk %}{% elif is_anonymousfragment %}{% url "anonymous_fragment:delete" object.pk %}{% elif is_fragment %}{% url "fragment:delete" object.pk %}
{% endif %}'
<form novalidate class='form-group mb-0' action='{% if is_testimonium %}{% url "testimonium:delete" object.pk %} {% elif is_work %}{% url "work:delete" object.pk %} {% elif is_antiquarian %}{% url "antiquarian:delete" object.pk %}{% elif is_anonymousfragment %}{% url "anonymous_fragment:delete" object.pk %}{% elif is_fragment %}{% url "fragment:delete" object.pk %}{% endif %}'
method='POST'>
{% csrf_token %}
<button type='submit' class='btn btn-link text-danger {% if object.mentioned_in.all %}confirm-delete-mentions {% else %} confirm-delete {% endif %}'
Expand Down Expand Up @@ -88,6 +85,9 @@
</div>
</div>
{% else %}
<form novalidate enctype="multipart/form-data" autocomplete='off' action='{{ request.path }}' class="form"
method='POST'>
{% csrf_token %}
{% if object.is_locked %}
<button type='submit' class='btn btn-warning btn-sm' name='request'>Request Item</button>
{% if request.user.can_break_locks %}
Expand All @@ -108,9 +108,8 @@
</div>
</div>
{% endif %}

</form>
{% endif %}
</form>
</div>
</div>
{% with user_lock_request=request.user|lock_request:object %}
Expand Down

0 comments on commit 24786bd

Please sign in to comment.