{% load static %}
{% load compress %}

<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
        {% compress css %}
            <link type="text/x-scss" href="{% static 'style/style.scss' %}" rel="stylesheet" media="screen">
        {% endcompress %}
        <title>{% block title %}{%endblock%} | App</title>
    </head>
    <body>
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark py-3">
            <div class="container">
                <a class="navbar-brand" href="/">App</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
                    aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                        <li class="nav-item">
                            <a class="nav-link {% if request.resolver_match.url_name == 'index' %} active {% endif %}" aria-current="page" href="/" >Home</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.resolver_match.url_name == 'about' %} active {% endif %}" href="/about">About</a>
                        </li>
                    </ul>

                    <div class="text-end mt-4 mt-md-0 text-white">
                        {% if user.is_authenticated %}
                            Welcome, {{ user.username }}
                            {% if user.is_superuser %}
                                <a href="/admin" class="btn btn-primary ms-4">Admin Panel</a>
                            {% endif %}
                            <a class="btn btn-danger ms-1" href="/logout">Logout</a>
                        {% else %}
                            <a href="/login" class="btn btn-outline-light me-2">Login</a>
                            <a href="/signup" class="btn btn-warning">Sign-up</a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </nav>

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

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    </body>
</html>