{% extends 'users/users.html' %} {% load custom_tags_and_filters %} {% load mptt_tags %} {% block title %} {% if form.instance.id %} Modify user {% else %} New user {% endif %} {% endblock %} {% block extrahead %} {% load static %} {% endblock %} {% block before_pagination %} {% if form.instance.id %}{{ block.super }}{% endif %} {% endblock %} {% block table_empty_content %} {% if form.instance.id %}
{% endif %}
{% if form.errors %}
Oops! Something went wrong. Please correct the errors highlighted below.
{{ form.non_field_errors }}
{% endif %} {% if warning %}
{{ warning }}
{% endif %}
{% url 'history' 'user' form.instance.id as user_history_url %} {% if form.instance.id %}
{% if readonly %} View {% else %} Modify {% endif %} user
{% button type="info" icon="glyphicon-list" value="View user history" url=user_history_url %}
{% else %}
New user
{% endif %}
{% csrf_token %} {% if form.instance.id %}{% endif %}
{% if form.first_name.errors %}
{{ form.first_name.errors|striptags }}
{% endif %}
{% if form.last_name.errors %}
{{ form.last_name.errors|striptags }}
{% endif %}
{% if form.username.errors %}
{{ form.username.errors|striptags }}
{% endif %}
{% if form.email.errors %}
{{ form.email.errors|striptags }}
{% endif %}
{% if form.fields.type.choices.queryset %}
{% endif %}
{% if form.badge_number.errors %}
{{ form.badge_number.errors|striptags }}
{% endif %}
{% if not readonly %} One year from now {% endif %}
{% if form.access_expiration.errors %}
{{ form.access_expiration.errors|striptags }}
{% endif %}
{% if not readonly and form.instance.id and form.is_active.value %} {% endif %}

{% if form.instance.id %}
Date joined
{{ form.instance.date_joined }}
Last login
{{ form.instance.last_login|default_if_none:"Never" }}
{% endif %}
{% if identity_service_domains|length == 1 %}
{{ identity_service_domains.0 }}
{% elif identity_service_domains|length > 1 %}
{% for d in identity_service_domains %}
{% endfor %}
{% endif %}
{% if not readonly %}
{% endif %}
This user has no assigned projects.
{% if not readonly %}
{% endif %}
This user is not qualified to use any tools.
{% if area_access_levels or externally_managed_physical_access_levels %}
Physical access levels
{% if area_access_levels %}
Tablet controlled

Selecting a parent area access will give access to all sub-areas

{% endif %} {% if externally_managed_physical_access_levels %}
Badge-reader controlled
{% for level in externally_managed_physical_access_levels %}
{% endfor %}
{% endif %}
{% endif %} {% if form.fields.safety_trainings.choices.queryset %}
Safety training
Safety training
{% for safety_training_id, safety_training_name in form.fields.safety_trainings.choices %}
{% endfor %}
{% endif %} {% if form.fields.onboarding_phases.choices.queryset %}
Onboarding phases
Onboarding phases
{% for onboarding_phase_id, onboarding_phase_name in form.fields.onboarding_phases.choices %}
{% endfor %}
{% endif %} {% if form.instance.user_documents.all or allow_document_upload %}
Documents
{% for d in form.instance.user_documents.all %}
{% if not readonly %} {% endif %} {{ d.filename }}
{% empty %}
This user doesn't have any documents.
{% endfor %} {% if not readonly and allow_document_upload %}
{% endif %}
{% endif %} {% if not readonly %}
{% button type="save" value=form.instance.id|yesno:"Save changes,Create user" %}
{% endif %}
{% if not readonly and identity_service_available and form.instance.id and user_identity_information.can_reset_password_and_unlock_account %}
{% csrf_token %}
{% button type="warn" submit=True icon="glyphicon-repeat" value="Reset password" %}
{# Account unlock can only be performed if the account is currently in the locked state. #} {% if user_identity_information.account_locked %}
{% csrf_token %}
{% button type="warn" submit=True icon="glyphicon-lock" value="Unlock account" %}
{% endif %} {% endif %} {% endblock %}