mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(FastAPI): add /pkgbase/{name}/comaintainers (get, post)
Changes from PHP: - Form action now points to `/pkgbase/{name}/comaintainers`. - When an error occurs, users are sent back to `/pkgbase/{name}/comaintainers` with an error at the top of the page. (PHP used to send people to /pkgbase/, which ended up at a blank search page). Closes: https://gitlab.archlinux.org/archlinux/aurweb/-/issues/51 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
2efd254974
commit
4d191b51f9
4 changed files with 295 additions and 2 deletions
|
@ -117,9 +117,9 @@
|
|||
|
||||
{% endif %}
|
||||
</form>
|
||||
{% if is_maintainer %}
|
||||
{% if request.user.has_credential('CRED_PKGBASE_EDIT_COMAINTAINERS', approved=[pkgbase.Maintainer]) %}
|
||||
<li>
|
||||
<a href="/pkgbase/{{ result.Name }}/comaintainers/">
|
||||
<a href="/pkgbase/{{ pkgbase.Name }}/comaintainers/">
|
||||
{{ "Manage Co-Maintainers" | tr }}
|
||||
</a>
|
||||
</li>
|
||||
|
|
40
templates/pkgbase/comaintainers.html
Normal file
40
templates/pkgbase/comaintainers.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
{% 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>{{ "Manage Co-maintainers" | tr }}:</h2>
|
||||
<p>
|
||||
{{
|
||||
"Use this form to add co-maintainers for %s%s%s "
|
||||
"(one user name per line):"
|
||||
| tr | format("<strong>", pkgbase.Name, "</strong>")
|
||||
| safe
|
||||
}}
|
||||
</p>
|
||||
|
||||
<form action="/pkgbase/{{ pkgbase.Name }}/comaintainers" method="post">
|
||||
<fieldset>
|
||||
<p>
|
||||
<label for="id_users">{{ "Users" | tr }}:</label>
|
||||
<textarea id="id_users" name="users"
|
||||
rows="5" cols="50">{{ "\n".join(comaintainers) }}</textarea>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<button class="button" type="submit">
|
||||
{{ "Save" | tr }}
|
||||
</button>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue