<!DOCTYPE html>
<html lang="ru">
{%load static%}
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}{% endblock %}</title>
    <script src="{% static 'auth_tg/js/telegramAuth.js' %}"></script>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .profile-photo {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            object-fit: cover;
        }
        .navbar-brand img {
            height: 40px;
            margin-right: 10px;
        }
        .profile-photo-placeholder {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background-color: #6c757d;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 3rem;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="{% url 'home' %}">
                django-tgauth
            </a>
            <div class="navbar-nav ms-auto">
                {% if is_authenticated %}
                    <a class="nav-link" href="{% url 'profile' %}">Личный кабинет</a>
                    <a class="nav-link" href="{% url 'logout' %}">Выход</a>
                {% else %}
                    <button class="btn btn-primary" onclick="TelegramAuth.initTelegramAuth()">
    Войти через Telegram
</button>
                {% endif %}
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        {% block content %}{% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>