{% extends "base.html" %} {% from "macros.html" import icon, btn, badge %} {% block title %}{{ t('My Profile') }}{% endblock %} {% block content %}
{# Account form #}
{{ request.csrf_input() }}
{% if errors_global %}
{{ icon('alert-triangle', 18) }} {{ errors_global }}
{% endif %}
{{ icon('user', 12) }} {{ t('Account Details') }}
{% if form._fields.email %}
{{ form._fields.email.input }} {% if form._fields.email._error %}
{{ icon('x', 14) }} {{ form._fields.email._error }}
{% endif %}
{% endif %} {% if form._fields.name %}
{{ form._fields.name.input }} {% if form._fields.name._error %}
{{ icon('x', 14) }} {{ form._fields.name._error }}
{% endif %}
{% endif %}
{{ icon('shield', 12) }} {{ t('Security') }} {{ t('Leave blank to keep current password') }}
{{ form._fields.current_password.input(autocomplete='current-password') }} {% if form._fields.current_password._error %}
{{ icon('x', 14) }} {{ form._fields.current_password._error }}
{% endif %}
{{ form._fields.new_password.input(autocomplete='new-password') }} {% if form._fields.new_password._error %}
{{ icon('x', 14) }} {{ form._fields.new_password._error }}
{% endif %}
{{ form._fields.confirm_password.input(autocomplete='new-password') }} {% if form._fields.confirm_password._error %}
{{ icon('x', 14) }} {{ form._fields.confirm_password._error }}
{% endif %}
{# 2FA card #}
{{ icon('shield', 12) }} {{ t('Two-Factor Authentication') }}
{% if twofa_enabled %} {{ badge(t('Active'), 'success') }} {% else %} {{ badge(t('Inactive'), 'error') }} {% endif %}
{{ icon('shield', 32, 'empty-icon') }}
{% if twofa_enabled %}

{{ t('2FA is Enabled') }}

{{ t('Your account is secured with an extra layer of protection using a TOTP authenticator app.') }}

{{ request.csrf_input() }}
{{ btn(t('Disable 2FA'), 'danger', icon='trash', type='submit') }}
{% else %}

{{ t('Secure Your Account') }}

{{ t('Two-factor authentication adds an additional layer of security to your account by requiring more than just a password to log in.') }}

{{ icon('shield', 14) }} {{ t('Setup Two-Factor') }} {% endif %}
{% endblock %}