feat(FastAPI): add /pkgbase/{name}/adopt (post)

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-07 22:01:04 -07:00
parent 72d6016da4
commit 305d077973
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 65 additions and 4 deletions

View file

@ -119,12 +119,23 @@
</a>
</li>
{% endif %}
{% if request.user.has_credential("CRED_PKGBASE_DISOWN", approved=[pkgbase.Maintainer]) %}
{% if not result.Maintainer %}
<li>
<a href="/pkgbase/{{ result.Name }}/disown/">
{{ "Disown Package" | tr }}
</a>
<form action="/pkgbase/{{ result.Name }}/adopt" method="post">
<input type="submit"
class="button text-button"
value="{{ 'Adopt Package' | tr }}"
/>
</form>
</li>
{% else %}
{% if request.user.has_credential("CRED_PKGBASE_DISOWN", approved=[pkgbase.Maintainer]) %}
<li>
<a href="/pkgbase/{{ result.Name }}/disown/">
{{ "Disown Package" | tr }}
</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>