2021-04-19 22:19:55 +00:00
|
|
|
{% load i18n %}
|
|
|
|
<div class="block content">
|
|
|
|
<h3>{% trans "Actions" %}</h3>
|
|
|
|
<div class="is-flex">
|
|
|
|
<p class="mr-1">
|
|
|
|
<a class="button" href="{% url 'direct-messages-user' user.username %}">{% trans "Send direct message" %}</a>
|
|
|
|
</p>
|
2021-04-19 22:51:39 +00:00
|
|
|
<form name="suspend" method="post" action="{% url 'settings-report-suspend' user.id %}">
|
2021-04-19 22:19:55 +00:00
|
|
|
{% csrf_token %}
|
|
|
|
{% if user.is_active %}
|
2021-04-19 22:51:39 +00:00
|
|
|
<button type="submit" class="button is-danger is-light">{% trans "Suspend user" %}</button>
|
2021-04-19 22:19:55 +00:00
|
|
|
{% else %}
|
2021-04-19 22:51:39 +00:00
|
|
|
<button class="button">{% trans "Un-suspend user" %}</button>
|
2021-04-19 22:19:55 +00:00
|
|
|
{% endif %}
|
|
|
|
</form>
|
|
|
|
</div>
|
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">
|
|
|
|
<select name="groups" id="id_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>
|
|
|
|
{% for error in group_form.groups.errors %}
|
|
|
|
<p class="help is-danger">{{ error | escape }}</p>
|
|
|
|
{% endfor %}
|
|
|
|
{% endwith %}
|
|
|
|
<button class="button">{% trans "Save" %}</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-04-19 22:19:55 +00:00
|
|
|
</div>
|