{% extends "base.html" %} {% load django_bootstrap5 %} {% load i18n %} {% load static %} {% block title %}{{ title }}{% endblock %} {% block page_heading %}{{ title }}{% endblock page_heading %} {% block content %} {# who the user is, what they manage, what they may use, then what more they may do #}
{% csrf_token %} {% bootstrap_form_errors user_form type="non_fields" %}

{% trans "Account" %}

{% if edited_user %}

{% trans "Last login" %}: {{ edited_user.last_login|date:"Y-m-d H:i"|default:_("never") }}

{% else %}

{% trans "What the user signs in with." %}

{% endif %}
{% bootstrap_field user_form.username %}
{% if edited_user %} {% trans "Password" %}
{% if edited_user.has_usable_password %}{% trans "Set" %}{% else %}{% trans "Not set" %}{% endif %} {% trans "Change password" %}
{% else %} {% bootstrap_field user_form.password %} {% endif %}
{% bootstrap_field user_form.first_name %}
{% bootstrap_field user_form.last_name %}
{% bootstrap_field user_form.email %}
{% trans "Turn off to block the user while keeping the account." %}

{% trans "Role" %}

{% trans "What the user manages." %}

{% trans "Uses the VMs given to them, within their quota." as user_help %} {% trans "May change and delete the template VMs given to them." as editor_help %} {% trans "Manages the panel: every permission, no quota." as superuser_help %}
{% for choice in user_form.role %}
{% endfor %}
{% for error in user_form.role.errors %}
{{ error }}
{% endfor %}
{# user_form.js hides the sections a superuser does not need while Superuser is chosen #} {% with superuser=user_form.role.value %}

{% trans "A superuser has every permission and no quota: there is nothing more to set." %}

{% trans "Quota" %}

{% trans "The most the user's VMs may have in total." %}

{% for field, unlimited, unit in attributes_form.quota_rows %}
{% if unit %}{{ unit }}{% endif %} {% for error in field.errors %}
{{ error }}
{% endfor %}
{% endfor %}

{% trans "Groups and permissions" %}

{% trans "The permissions of the user's groups apply too." %}

{% trans "Groups" %}
{% for box in user_form.groups %} {% empty %} {% trans "There are no groups yet." %} {% endfor %}
{% for error in user_form.groups.errors %}
{{ error }}
{% endfor %}
{% trans "Own permissions" %}

{% trans "Off grants nothing here; it takes away nothing a group grants." %}

{% for box, help in user_form.permission_rows %}
{% endfor %}
{% for error in user_form.user_permissions.errors %}
{{ error }}
{% endfor %}
{% endwith %}
{% trans "Cancel" %}
{% endblock content %} {% block script %} {% endblock script %}