<!DOCTYPE html>

{% load static %}
{% load sass_tags %}

<html lang="fr">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <title>1bet.fr · {% block title %}{% endblock %}</title>

        <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto">
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
              integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">

        <link rel="stylesheet" type="text/css" href="{% static 'css/body.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'css/navbar.css' %}">
        <link rel="stylesheet" type="text/css" href="{% sass_src 'sass/custom.scss' %}"/>

        <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"
                integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
        <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
                integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
        <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
                integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment-with-locales.min.js"
                integrity="sha512-qSnlnyh7EcD3vTqRoSP4LYsy2yVuqqmnkM9tW4dWo6xvAoxuVXyM36qZK54fyCmHoY1iKi9FJAUZrlPqmGNXFw==" crossorigin="anonymous"></script>

        <script type="text/javascript" src="/static/js/session.js"></script>
        <script type="text/javascript">
            moment.locale(navigator.language);
            $.ajaxSetup({
                beforeSend: function(xhr) {
                    xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
                }
            });

            {% if not request.session.seenBuildingModal %}
                $(window).on("load", function(){
                    $("#buildingModal").modal("show");
                });
                $("#buildingModal").on("hidden.bs.modal", function(e) {
                    Session.seenBuildingModal();
                });
            {% endif %}
        </script>
        {% block static %}

        {% endblock %}
    </head>

    <body>
        <div id="buildingModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5>Bienvenue sur 1bet.fr</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body text-justify">
                        <p>
                            Ce site est actuellement en cours de construction, il est donc possible que certains
                            contenus soient incorrects ou mal affichés. Merci de votre compréhension.
                        </p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="Session.seenBuildingModal()">
                            Ne plus afficher ce message
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <div class="fixed-top w-100" id="pageNav">
            <nav class="navbar navbar-expand-sm navbar-light bg-primary">
                <a class="navbar-brand" href="/">
                    <img src="{% static 'img/logo-1bet.png' %}" alt="1bet.fr">
                </a>

                <button class="navbar-toggler text-white" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                        aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                    <i class="fa fa-bars" aria-hidden="true"></i>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav mr-auto">
                        {% for sport in navbar_sports %}
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle px-3 py-2 text-white" href="#" role="button"
                                   data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    {{ sport.name }}
                                </a>
                                <ul class="dropdown-menu border-0 bg-secondary my-0 py-0 rounded-0">
                                    <li>
                                        <a class="dropdown-item pl-3 py-2 text-white text-decoration-none" href="/{{ sport.clean_name }}">
                                            <i class="fa fa-angle-right" aria-hidden="true"></i> Actualités
                                        </a>
                                    </li>
                                    {% for country in sport.countries %}
                                        <li class="dropdown-item dropdown-submenu pl-3 pr-4 py-2">
                                            <a class="dropdown-toggle text-white text-decoration-none my-2" href="#" role="button"
                                               data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                {{ country.name }}
                                            </a>
                                            <ul class="dropdown-menu border-0 bg-light my-0 py-0 rounded-0">
                                                {% for league in country.leagues %}
                                                    <li>
                                                        <a class="dropdown-item px-3 py-2 text-primary text-decoration-none"
                                                           href="/{{ sport.clean_name }}/{{ league.clean_name }}">
                                                            {{ league.name }}
                                                        </a>
                                                    </li>
                                                {% endfor %}
                                            </ul>
                                        </li>
                                    {% endfor %}
                                </ul>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
            </nav>
        </div>

        <div id="pageTabContainer" class="position-fixed w-100 text-center bg-info">
            {% block tabs %}

            {% endblock %}
        </div>

        <section id="content">
            {% block content %}

            {% endblock %}
        </section>
    </body>
</html>