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:
Kevin Morris 2021-09-16 19:42:09 -07:00
parent 2efd254974
commit 4d191b51f9
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
4 changed files with 295 additions and 2 deletions

View file

@ -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>