{% extends "panel.html" %} {% load i18n %} {% load sso %} {% load inventree_extras %} {% load socialaccount %} {% load crispy_forms_tags %} {% load user_sessions i18n %} {% block label %}account{% endblock label %} {% block heading %} {% trans "Account Settings" %} {% endblock heading %} {% block actions %} {% inventree_customize 'hide_password_reset' as hide_password_reset %} {% if not hide_password_reset %}
{% trans "Set Password" %}
{% endif %}
{% trans "Edit" %}
{% endblock actions %} {% block content %} {% mail_configured as mail_conf %}
{% trans "Username" %} {{ user.username }}
{% trans "First Name" %} {{ user.first_name }}
{% trans "Last Name" %} {{ user.last_name }}

{% trans "Email" %}

{% if user.emailaddress_set.all %}

{% trans 'The following email addresses are associated with your account:' %}

{% else %}
{% trans 'Warning:' %} {% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %}
{% endif %}
{% if can_add_email %}
{% trans "Add Email Address" %}
{% csrf_token %} {{ add_email_form|crispy }}
{% endif %}
{% include "InvenTree/settings/user_sso.html" %}

{% trans "Multifactor" %}

{% if user.staticdevice_set.all or user.totpdevice_set.all %}

{% trans 'You have these factors available:' %}

{% for token in user.totpdevice_set.all %} {% endfor %} {% for token in user.staticdevice_set.all %} {% endfor %}
Type Name
{% trans 'TOTP' %} {{ token.name }}
{% trans 'Static' %} {{ token.name }}
{% else %}
{% trans "Multifactor authentication is not configured for your account" %}
{% endif %}
{% trans "Change factors" %}
{% trans "Setup multifactor" %} {% if user.staticdevice_set.all or user.totpdevice_set.all %} {% trans "Remove multifactor" %} {% endif %}
{% inventree_customize 'hide_active_sessions' as hide_active_sessions %} {% if not hide_active_sessions %}

{% trans "Active Sessions" %}

{% include "spacer.html" %}
{% if session_list.count > 1 %}
{% csrf_token %}
{% endif %}
{% trans "unknown on unknown" as unknown_on_unknown %} {% trans "unknown" as unknown %} {% for object in session_list %} {% if object.user_agent or object.device %} {% else %} {% endif %} {% endfor %}
{% trans "IP Address" %} {% trans "Device" %} {% trans "Last Activity" %}
{{ object.ip }}{{ object.user_agent|device|default_if_none:unknown_on_unknown|safe }}{{ unknown_on_unknown }} {% if object.session_key == session_key %} {% blocktrans with time=object.last_activity|timesince %}{{ time }} ago (this session){% endblocktrans %} {% else %} {% blocktrans with time=object.last_activity|timesince %}{{ time }} ago{% endblocktrans %} {% endif %}
{% endif %} {% endblock content %} {% block js_ready %} (function() { var message = '{% trans "Do you really want to remove the selected email address?" escape %}'; var actions = document.getElementsByName('action_remove'); if (actions.length) { actions[0].addEventListener("click", function(e) { if (! confirm(message)) { e.preventDefault(); } }); } })(); {% endblock js_ready %}