Add ability to delete collections

This commit is contained in:
rubenwardy
2023-08-14 22:17:29 +01:00
parent 4a0653bcfd
commit af4f03d298
4 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}
{{ _('Delete collection "%(title)s" by %(author)s', title=collection.title, author=collection.author.username) }}
{% endblock %}
{% block content %}
<form method="POST" action="" class="card box_grey">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<h3 class="card-header">{{ self.title() }}</h3>
<div class="card-body">
<p>{{ _("Deleting is permanent") }}</p>
<a class="btn btn-secondary mr-3" href="{{ collection.get_url('collections.create_edit') }}">{{ _("Cancel") }}</a>
<input type="submit" value="{{ _('Delete') }}" class="btn btn-danger" />
</div>
</form>
{% endblock %}

View File

@@ -28,6 +28,9 @@
</form>
{% endif %}
{% if collection.check_perm(current_user, "EDIT_COLLECTION") %}
<a class="btn btn-danger ml-2" href="{{ collection.get_url('collections.delete') }}">
{{ _("Delete") }}
</a>
<a class="btn btn-primary ml-2" href="{{ collection.get_url('collections.create_edit') }}">
{{ _("Edit") }}
</a>