Add package soft deletion

This commit is contained in:
rubenwardy
2018-05-25 18:28:24 +01:00
parent f93394df75
commit 8cf5c7204f
12 changed files with 120 additions and 16 deletions

View File

@@ -19,7 +19,22 @@
<option value="importusers" selected>Create users from mod list</option>
<option value="importscreenshots">Import screenshots from VCS</option>
</select>
<input type="submit" value="Start" />
<input type="submit" value="Perform" />
</form>
</div>
<div class="box box_grey">
<h2>Restore Package</h2>
<form method="post" action="" class="box-body">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="action" value="restore" />
<select name="package">
{% for p in deleted_packages %}
<option value={{ p.id }}>{{ p.id}}) {{ p.title }} by {{ p.author.display_name }}</option>
{% endfor %}
</select>
<input type="submit" value="Restore" />
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block title %}
Delete | {{ package.title }}
{% endblock %}
{% block content %}
<form method="POST" action="" class="box box_grey ">
<h3>Delete Package</h3>
<div class="box-body">
<p>This action can be undone by the admin, but he'll be very annoyed!</p>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" value="Delete" class="button-danger" />
</div>
</form>
{% endblock %}

View File

@@ -91,6 +91,9 @@
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
<li><a href="{{ package.getCreateReleaseURL() }}">Create Release</a></li>
{% endif %}
{% if package.checkPerm(current_user, "DELETE_PACKAGE") %}
<li><a href="{{ package.getDeleteURL() }}">Delete</a></li>
{% endif %}
</ul>
</div>
</aside>