{% extends "base.html" %}
{% block extra_head %}
<link rel="stylesheet" href="{{ static_url('/static/css/auth.css') }}">
<link rel="stylesheet" href="{{ static_url('/static/css/moderation.css') }}">
{% endblock %}
{% block content %}
<div class="page-narrow">
    <h1>Delete your account</h1>
    <p class="report-intro">This removes your DevPlace account and your personal data. Read what happens before you confirm.</p>

    <section class="card report-summary">
        <h3>Removed immediately</h3>
        <ul class="delete-list">
            {% for item in removed %}
            <li>{{ item }}</li>
            {% endfor %}
        </ul>

        <h3>Retained</h3>
        <ul class="delete-list">
            {% for item in retained %}
            <li>{{ item }}</li>
            {% endfor %}
        </ul>

        <h3>Timing</h3>
        <p class="report-intro">Your account is gone from your view and everyone else's the moment you confirm: your username is tombstoned and your email, profile, avatar, API key and password are cleared straight away, and every session and token is revoked.</p>
        {% if grace_hours %}
        <p class="report-intro">The removal stays reversible by an administrator for <strong>{{ grace_hours }} hours</strong> in case you delete by accident. After that window the whole deletion is permanently purged and cannot be recovered.</p>
        {% else %}
        <p class="report-intro">The removal is purged permanently on the next sweep and cannot be recovered.</p>
        {% endif %}
    </section>

    <section class="card report-decision">
        <h3>Confirm with your password</h3>
        <form class="report-form" method="POST" action="/profile/{{ username }}/delete">
            <div class="auth-field">
                <label for="delete-password">Your password</label>
                <input type="password" id="delete-password" name="password" required maxlength="128" autocomplete="current-password">
            </div>
            <button type="submit" class="btn btn-danger" data-confirm="Delete your account? This removes your content everywhere." data-confirm-danger data-confirm-title="Delete account">Delete my account</button>
        </form>
    </section>

    <p class="report-intro"><a href="/profile/{{ username }}?tab=privacy">Back to privacy settings</a></p>
</div>
{% endblock %}
