Add ability for users to remove themselves as maintainers

This commit is contained in:
rubenwardy
2020-07-08 23:42:30 +01:00
parent d00428eb7e
commit 8dcbcd8b62
4 changed files with 35 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
<p>
{{ _("Maintainers are given write access to the package.") }}
{{ _("Depending on their rank, they will be able to edit the package, create releases and screenshots, and read private threads.") }}
{{ _("Maintainers cannot add or remove other maintainers, but can remove themselves.") }}
</p>
<form method="POST" action="" class="tableform">

View File

@@ -272,6 +272,13 @@
{{ user.display_name }}
</a>
{% endfor %}
{% if current_user in package.maintainers and not package.checkPerm(current_user, "EDIT_MAINTAINERS") %}
<form class="mt-2" method="post" action="{{ package.getRemoveSelfMaintainerURL() }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input class="btn btn-sm btn-link p-0" type="submit" value="{{ _("Remove myself") }}" />
</form>
{% endif %}
</td>
</tr>
</table>