<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Eversync</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
    {% load static %}
    <link rel="icon" href="{% static 'favicon.ico' %}">
    <link rel="stylesheet" href="{% static 'index-style.css' %}" ">
    
</head>
    
</head>
<body>
    <div class="header">
        <div class="header-content">
            <a href="/"><img src="{% static 'eversync2.png' %}" alt="Eversync Logo" style="height: 80px; margin-right: 10px; display: flex; align-items: center; gap: 5px;"></a>
            <a href="/" class="logo" >eversync</a>
            <div class="nav-links" style="position: relative;">
                <div class="dropdown">
                    <button class="dropdown-toggle" style="background: none; border: none; color: white; font-size: 16px; cursor: pointer;">
                        Welcome, {{ user.username }} <i class="fas fa-caret-down"></i>
                    </button>
                    <div class="dropdown-menu" style="display: none; position: absolute; right: 0; background-color: #333; border: 1px solid #444; border-radius: 4px; padding: 10px; width: 184px;">
                        
                        <form action="{% url 'manage' %}" method="post" style="margin: 0;">
                            {% csrf_token %}
                            <button type="submit" class="logout-button" style="background-color: transparent; color: white; border: none; cursor: pointer;">Manage Account</button>
                        </form>
                        
                        <form action="{% url 'logoutz' %}" method="post" style="margin: 0;">
                            {% csrf_token %}
                            <button type="submit" class="logout-button" style="background-color: transparent; color: white; border: none; cursor: pointer;">Log Out</button>
                        </form>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="container">
        <div class="welcome-box" style="width: 50%; margin: 0 auto;">
            {% load allauth i18n %}
            {% block content %}
                {% element h1 %}
                    {% translate "Activate Authenticator App" %}
                {% endelement %}
                {% element p %}
                    {% blocktranslate %}To protect your account with two-factor authentication, scan the QR code below with your authenticator app. Then, input the verification code generated by the app below.{% endblocktranslate %}
                {% endelement %}
                {% url 'mfa_activate_totp' as action_url %}
                {% element form form=form method="post" action=action_url %}
                    {% slot body %}
                        <div style="text-align: center;">
                            {% element img src=totp_svg_data_uri alt=form.secret tags="mfa,totp,qr" %}
                        </div>
                        {% endelement %}
                        {% csrf_token %}

                        <div class="divider"></div>
                        {% translate "You can store this secret and use it to reinstall your authenticator app at a later time." %}
                        <div class="divider"></div>
                        {% element field id="authenticator_secret" type="text" value=form.secret disabled=True %}
                            {% slot label %}
                                {% translate "Authenticator secret" %}
                            {% endslot %}
                        {% endelement %}
                        {% element fields form=form %}
                        <div class="divider"></div>
                        {% endelement %}
                    {% endslot %}
                    {% slot actions %}
                        <div class="divider"></div>
                        {% element button type="submit" %}
                            {% trans "Activate" %}
                        {% endelement %}
                    {% endslot %}
                {% endelement %}
            {% endblock content %}
        </div>
        
    </div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
    const toggle = document.querySelector('.dropdown-toggle');
    const menu = document.querySelector('.dropdown-menu');
    toggle.addEventListener('click', function () {
        menu.style.display = menu.style.display === 'block' ? 'none' : 'block';
    });
});
</script>
</body>
</html> 
