authentic/src/authentic2/manager/templates/authentic2/manager/user_detail.html

125 lines
4.2 KiB
HTML

{% extends "authentic2/manager/form.html" %}
{% load i18n static %}
{% block page-title %}{{ object }} | {{ block.super }}{% endblock %}
{% block appbar %}
<h2>{{ object }}
{% if not object.is_active %}
<span class="disabled-badge">{% trans "disabled" %}</span>
{% endif %}
</h2>
<span class="actions">
<a class="extra-actions-menu-opener"></a>
<a href="{% url "a2-manager-user-journal" pk=object.pk %}">{% trans "Journal" %}</a>
{% if view.can_change %}
<a href="{% url "a2-manager-user-edit" pk=object.pk %}">{% trans "Edit" %}</a>
{% else %}
<a class="disabled" title="{% trans "You do not have the rights to edit this user." %}" href="#">{% trans "Edit" %}</a>
{% endif %}
<ul class="extra-actions-menu">
{% if view.can_delete %}
<li><a rel="popup" href="{% url "a2-manager-user-delete" pk=object.pk %}">{% trans "Delete" %}</a></li>
{% else %}
<li><a class="disabled" title="{% trans "You do not have the rights to delete this user." %}" href="#">{% trans "Delete" %}</a></li>
{% endif %}
{% if view.is_oidc_services %}
<li><a href="{% url "a2-manager-user-authorizations" pk=object.pk %}">{% trans "Consents" %}</a></li>
{% endif %}
</ul>
</span>
{% endblock %}
{% block breadcrumb %}
{{ block.super }}
<a href="../">{% trans 'Users' %}</a>
{% if multiple_ou and object.ou %}
<a href="../?search-ou={{ object.ou.pk }}">{{ object.ou }}</a>
{% endif %}
<a href="#">{{ object }}</a>
{% endblock %}
{% block afterform %}
{% if object.passwordreset_set.exists %}
<div class="warning-box">{% trans "User must change its password on next access to authentic" %}
<button name="delete_password_reset">{% trans "Cancel this constraint" %}</button>
</div>
{% endif %}
{% endblock %}
{% block buttons %}
{% endblock %}
{% block sidebar %}
<aside id="sidebar">
<p class="a2-manager-user-last-login">
{% if object.last_login %}
{% blocktrans with date=object.last_login %}Last login on {{ date }}.{% endblocktrans %}
{% else %}
{% trans "Never logged in." %}
{% endif %}
</p>
<p class="a2-manager-user-date-joined">
{% blocktrans with date=object.date_joined %}Created on {{ date }}{% endblocktrans %}
</p>
{% if object.date_joined != object.modified %}
<p class="a2-manager-user-modified">
{% blocktrans with date=object.modified %}Modified on {{ date }}{% endblocktrans %}
</p>
{% endif %}
{% if not object.is_active and object.deactivation %}
<p class="a2-manager-user-date-deactivated">
{% blocktrans trimmed with date=object.deactivation reason=object.verbose_deactivation_reason %}
Deactivated on {{ date }} ({{ reason }}).
{% endblocktrans %}
</p>
{% endif %}
{% for data in user_data %}
{{ data }}
{% endfor %}
{% block other_actions %}{{ block.super }}{% endblock %}
{% if roles_by_ou or can_change_roles %}
<div class="user-roles">
<h3>{% trans "Roles" %}</h3>
<ul>
{% for ou, ou_roles in roles_by_ou.items %}
{% if have_roles_on_multiple_ou %}
<li>{% if ou %}{{ ou }}{% else %}{% trans "All organizational units" %}{% endif %}
<ul>
{% endif %}
{% for role in ou_roles %}
<li {% if role.description %}title="{{ role.description }}"{% endif %}>
{% if role.user_visible %}<a href="{% url "a2-manager-role-members" pk=role.pk %}">{{ role }}</a>{% else %}{{ role }}{% endif %}</li>
{% endfor %}
{% if have_roles_on_multiple_ou %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
{% if can_change_roles %}
<button onclick="window.location.href = '{% url "a2-manager-user-roles" pk=object.pk %}?search-ou={% firstof object.ou.pk default_ou.pk %}'; return false">{% trans "Modify roles" %}</button>
{% endif %}
</div>
{% endif %}
{% if perms.custom_user.admin_user %}
<div id="details">
<dl>
<dt>{% trans "UUID" %}</dt>
<dd>{{ object.uuid }}</dd>
</dl>
</div>
{% endif %}
</aside>
{% endblock %}