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 %}
|
2022-01-10 22:55:10 +00:00
|
|
|
<h3>{% trans "User Actions" %}</h3>
|
2021-06-14 18:35:06 +00:00
|
|
|
|
2022-01-10 22:55:10 +00:00
|
|
|
<div class="box">
|
|
|
|
<div class="is-flex">
|
|
|
|
{% if user.is_active %}
|
|
|
|
<p class="mr-1">
|
|
|
|
<a class="button" href="{% url 'direct-messages-user' user.username %}">{% trans "Send direct message" %}</a>
|
|
|
|
</p>
|
|
|
|
{% endif %}
|
2021-09-08 23:47:12 +00:00
|
|
|
|
2022-01-10 22:55:10 +00:00
|
|
|
{% if user.is_active or user.deactivation_reason == "pending" %}
|
|
|
|
<form name="suspend" method="post" action="{% url 'settings-report-suspend' user.id %}" class="mr-1">
|
|
|
|
{% csrf_token %}
|
|
|
|
<button type="submit" class="button is-danger is-light">{% trans "Suspend user" %}</button>
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<form name="unsuspend" method="post" action="{% url 'settings-report-unsuspend' user.id %}" class="mr-1">
|
|
|
|
{% csrf_token %}
|
|
|
|
<button class="button">{% trans "Un-suspend user" %}</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% 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>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-09-08 23:47:12 +00:00
|
|
|
|
2021-09-09 00:21:45 +00:00
|
|
|
{% if user.local %}
|
|
|
|
<div>
|
2022-01-10 22:55:10 +00:00
|
|
|
{% include "settings/users/delete_user_form.html" with controls_text="delete_user" class="mt-2 mb-2" %}
|
2021-09-09 00:21:45 +00:00
|
|
|
</div>
|
2021-09-08 23:47:12 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2022-01-10 22:55:10 +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">
|
|
|
|
<select name="groups" id="id_user_group" aria-describedby="desc_user_group">
|
|
|
|
{% for value, name in group_form.fields.groups.choices %}
|
|
|
|
<option value="{{ value }}" {% if name == group.name %}selected{% endif %}>
|
|
|
|
{{ name|title }}
|
|
|
|
</option>
|
|
|
|
{% endfor %}
|
|
|
|
<option value="" {% if not group %}selected{% endif %}>
|
|
|
|
User
|
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2021-11-29 22:26:43 +00:00
|
|
|
|
2022-01-10 22:55:10 +00:00
|
|
|
{% include 'snippets/form_errors.html' with errors_list=group_form.groups.errors id="desc_user_group" %}
|
|
|
|
{% endwith %}
|
|
|
|
<button class="button">
|
|
|
|
{% trans "Save" %}
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-04-20 00:16:14 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-06-14 18:35:06 +00:00
|
|
|
|
|
|
|
{% endif %}
|
2021-04-19 22:19:55 +00:00
|
|
|
</div>
|