{% extends "layout.html" %}
{% from "_macros.html" import render_roles %}
{%- block title -%}
{{ _('Profile') }}
{%- endblock -%}
{% block content %}

<h1>{{ current_user.email }}</h1>

{% if current_user.deletion_requested_at %}
    <div class="alert alert-danger" role="alert">
      {{ _('Your account is scheduled for deletion.') }}
      <a class="alert-link" href="{{ url_for('user_cancel_deletion') }}" role="button">{{ _('Cancel deletion') }}</a>
    </div>
{% endif %}

<h2>{{ _('Profile') }}</h2>

<div class="list-group">
    <a href="{{ url_for('security.change_password') }}" class="list-group-item">
        {{ _fsdomain('Change password') }}
        <i class="fa fa-caret-right"></i>
    </a>
    {% if not current_user.deletion_requested_at %}
    <a href="{{ url_for('user_request_deletion') }}" class="list-group-item text-danger">
        {{ _('Delete account') }}
        <i class="fa fa-caret-right"></i>
    </a>
    {% endif %}
</div>

<h2>{{ _('Settings') }}</h2>

<div class="list-group">
    <a href="{{ url_for('user_notifications') }}" class="list-group-item">
        {{ _('Notifications') }}
        <i class="fa fa-caret-right"></i>
    </a>
    <a href="{{ url_for('oauth2_tokens') }}" class="list-group-item">
        {{ _('Applications') }}
        <i class="fa fa-caret-right"></i>
    </a>
</div>

<h2>{{ _('Developer') }}</h2>

<div class="list-group">
    <a href="{{ url_for('oauth2_clients') }}" class="list-group-item">
        {{ _('OAuth2 clients') }}
        <i class="fa fa-caret-right"></i>
    </a>
</div>

{% endblock %}