mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): add /pkgbase/{name}/delete (get, post)
In addition, we've had to add cascade arguments to backref so sqlalchemy treats the relationships as proper cascades. Furthermore, our pkgbase actions template was not rendering actions properly based on TU credentials. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
4e7d2295da
commit
d38abd7832
3 changed files with 139 additions and 0 deletions
56
templates/packages/delete.html
Normal file
56
templates/packages/delete.html
Normal file
|
@ -0,0 +1,56 @@
|
|||
{% extends "partials/layout.html" %}
|
||||
|
||||
{% block pageContent %}
|
||||
|
||||
{% if errors %}
|
||||
<ul class="errorlist">
|
||||
{% for error in errors %}
|
||||
<li>{{ error | tr }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<div class="box">
|
||||
<h2>{{ "Delete Package" | tr }}: {{ pkgbase.Name }}</h2>
|
||||
|
||||
<p>
|
||||
{{
|
||||
"Use this form to delete the package base %s%s%s and "
|
||||
"the following packages from the AUR: "
|
||||
| tr | format("<strong>", pkgbase.Name, "</strong>") | safe
|
||||
}}
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
{% for package in pkgbase.packages.all() %}
|
||||
<li>{{ package.Name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
{{
|
||||
"Deletion of a package is permanent. "
|
||||
"Select the checkbox to confirm action." | tr
|
||||
}}
|
||||
</p>
|
||||
|
||||
<form action="/pkgbase/{{ pkgbase.Name }}/delete" method="post">
|
||||
<fieldset>
|
||||
<p>
|
||||
<label class="confirmation">
|
||||
<input type="checkbox" name="confirm" value="1" />
|
||||
{{ "Confirm package deletion" | tr }}
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input class="button"
|
||||
type="submit"
|
||||
value="{{ 'Delete' | tr }}"
|
||||
/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue