{% extends "panel.html" %} {% load i18n %} {% load inventree_extras %} {% load socialaccount %} {% load crispy_forms_tags %} {% load user_sessions i18n %} {% block label %}account{% endblock %} {% block heading %} {% trans "Account Settings" %} {% endblock %} {% block actions %} {% inventree_demo_mode as demo %} {% if not demo %}
{% trans "Set Password" %}
{% trans "Edit" %}
{% endif %} {% endblock %} {% 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 %}

{% trans "Social Accounts" %}

{% if social_form.accounts %}

{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}

{% csrf_token %}
{% if social_form.non_field_errors %}
{{ social_form.non_field_errors }}
{% endif %} {% for base_account in social_form.accounts %} {% with base_account.get_provider_account as account %}
{% endwith %} {% endfor %}
{% else %}

{% trans 'You currently have no social network accounts connected to this account.' %}

{% endif %}
{% trans 'Add a 3rd Party Account' %}
{% include "socialaccount/snippets/provider_list.html" with process="connect" %}
{% include "socialaccount/snippets/login_extra.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 'Warning:'%} {% trans "You currently do not have any factors set up." %}

{% endif %}
{% trans "Change factors" %}
{% trans "Setup multifactor" %} {% if user.staticdevice_set.all or user.totpdevice_set.all %} {% trans "Remove multifactor" %} {% endif %}

{% 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 %} {% endfor %}
{% trans "IP Address" %} {% trans "Device" %} {% trans "Last Activity" %}
{{ object.ip }} {{ object.user_agent|device|default_if_none:unknown_on_unknown|safe }} {% 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 %}
{% endblock %} {% block js_ready %} (function() { var message = "{% trans 'Do you really want to remove the selected email address?' %}"; var actions = document.getElementsByName('action_remove'); if (actions.length) { actions[0].addEventListener("click", function(e) { if (! confirm(message)) { e.preventDefault(); } }); } })(); {% endblock %}