2021-04-19 22:19:55 +00:00
|
|
|
{% load i18n %}
|
|
|
|
<div class="block content">
|
2021-09-09 00:21:45 +00:00
|
|
|
{% if not user.is_active and user.deactivation_reason == "self_deletion" or user.deactivation_reason == "moderator_deletion" %}
|
2021-06-14 18:35:06 +00:00
|
|
|
<div class="notification is-danger">
|
|
|
|
{% trans "Permanently deleted" %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
2021-04-19 22:19:55 +00:00
|
|
|
<h3>{% trans "Actions" %}</h3>
|
2021-06-14 18:35:06 +00:00
|
|
|
|
2021-04-19 22:19:55 +00:00
|
|
|
<div class="is-flex">
|
2021-09-08 23:47:12 +00:00
|
|
|
{% if user.is_active %}
|
2021-04-19 22:19:55 +00:00
|
|
|
<p class="mr-1">
|
|
|
|
<a class="button" href="{% url 'direct-messages-user' user.username %}">{% trans "Send direct message" %}</a>
|
|
|
|
</p>
|
2021-09-08 23:47:12 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if user.is_active or user.deactivation_reason == "pending" %}
|
2021-09-09 00:21:45 +00:00
|
|
|
<form name="suspend" method="post" action="{% url 'settings-report-suspend' user.id %}" class="mr-1">
|
2021-04-19 22:19:55 +00:00
|
|
|
{% csrf_token %}
|
2021-04-19 22:51:39 +00:00
|
|
|
<button type="submit" class="button is-danger is-light">{% trans "Suspend user" %}</button>
|
2021-09-08 23:47:12 +00:00
|
|
|
</form>
|
|
|
|
{% else %}
|
2021-09-09 00:21:45 +00:00
|
|
|
<form name="unsuspend" method="post" action="{% url 'settings-report-unsuspend' user.id %}" class="mr-1">
|
2021-09-08 23:47:12 +00:00
|
|
|
{% csrf_token %}
|
2021-04-19 22:51:39 +00:00
|
|
|
<button class="button">{% trans "Un-suspend user" %}</button>
|
2021-04-19 22:19:55 +00:00
|
|
|
</form>
|
2021-09-09 00:21:45 +00:00
|
|
|
{% endif %}
|
2021-09-08 23:47:12 +00:00
|
|
|
|
2021-09-09 00:21:45 +00:00
|
|
|
{% if user.local %}
|
|
|
|
<div>
|
|
|
|
{% trans "Permanently delete user" as button_text %}
|
|
|
|
{% include "snippets/toggle/open_button.html" with controls_text="delete_user" text=button_text class="is-danger is-light" %}
|
|
|
|
</div>
|
2021-09-08 23:47:12 +00:00
|
|
|
{% endif %}
|
2021-09-09 00:21:45 +00:00
|
|
|
</div>
|
2021-09-08 23:47:12 +00:00
|
|
|
|
2021-09-09 00:21:45 +00:00
|
|
|
{% if user.local %}
|
|
|
|
<div>
|
2021-09-28 19:46:38 +00:00
|
|
|
{% include "settings/users/delete_user_form.html" with controls_text="delete_user" class="mt-2 mb-2" %}
|
2021-04-19 22:19:55 +00:00
|
|
|
</div>
|
2021-09-09 00:21:45 +00:00
|
|
|
{% endif %}
|
2021-06-14 18:35:06 +00:00
|
|
|
|
2021-04-20 00:16:14 +00:00
|
|
|
{% if user.local %}
|
|
|
|
<div>
|
|
|
|
<form name="permission" method="post" action="{% url 'settings-user' user.id %}">
|
|
|
|
{% csrf_token %}
|
|
|
|
<label class="label" for="id_user_group">{% trans "Access level:" %}</label>
|
|
|
|
{% if group_form.non_field_errors %}
|
|
|
|
{{ group_form.non_field_errors }}
|
|
|
|
{% endif %}
|
|
|
|
{% with group=user.groups.first %}
|
|
|
|
<div class="select">
|
2021-11-29 22:26:43 +00:00
|
|
|
<select name="groups" id="id_user_group" aria-describedby="desc_user_group">
|
2021-04-20 00:16:14 +00:00
|
|
|
{% for value, name in group_form.fields.groups.choices %}
|
2021-11-29 22:26:43 +00:00
|
|
|
<option value="{{ value }}" {% if name == group.name %}selected{% endif %}>
|
|
|
|
{{ name|title }}
|
|
|
|
</option>
|
2021-04-20 00:16:14 +00:00
|
|
|
{% endfor %}
|
2021-11-29 22:26:43 +00:00
|
|
|
<option value="" {% if not group %}selected{% endif %}>
|
|
|
|
User
|
|
|
|
</option>
|
2021-04-20 00:16:14 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
2021-11-29 22:26:43 +00:00
|
|
|
|
|
|
|
{% include 'snippets/form_errors.html' with errors_list=group_form.groups.errors id="desc_user_group" %}
|
2021-04-20 00:16:14 +00:00
|
|
|
{% endwith %}
|
2021-11-29 22:26:43 +00:00
|
|
|
<button class="button">
|
|
|
|
{% trans "Save" %}
|
|
|
|
</button>
|
2021-04-20 00:16:14 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-06-14 18:35:06 +00:00
|
|
|
|
|
|
|
{% endif %}
|
2021-04-19 22:19:55 +00:00
|
|
|
</div>
|