Source du gabarit : main/index.html

{% extends "base.html" %}
{% load i18n static %}

{% block header %}
{% include 'frags/header.html' %}
{% endblock%}

{% block content %}
<!--debut bloc content-->

{% if basket_confirmed %}
<div id="myModal" class="modal">
    <div class="modal-content">
        <span class="close">&times;</span>
        <h3 class="title--modal">Comment se déroule une réservation ?</h3>

        <div class="modal__inner">
            <p>Un e-mail est envoyé au(x) Commerçant(s), celui-ci s’occupera de votre commande et prendra contact avec
                vous.
                C’est aussi simple que ça, alors n’hésite pas... Commande !</p>
        </div>
    </div>
</div>
{% endif %}

<section class="home__container column column--bottomed">

    <div class="box">
        <h1 class="title__big">Communes-Commerces</h1>
        <p class="text--big">Le Commerce de qualité est le Commerce de proximité&nbsp;!</p>

        {% include 'frags/search_full.html' %}
    </div>

    <figure class="container--img home__img">
        <img src="{% static 'img/img--home.jpg' %}" alt="Image représentant des commerçants">
    </figure>
</section>

<section class="wrapper wrapper--centered">
    <h2 class="title__medium title__medium--small-margin text--center">Trouver les Commerces de ma région</h2>

    <a class="text--center  text--color link" title="Accéder à la liste des commerces complètes"
        href="{% url 'province' %}">Consulter la liste complètes des Communes</a>

    <ul class="list-municipality">
        {% for m in municipalities_index %}
        <li>
            <a title="Accéder à la commune {{m.name}}"
                href="{% url 'municipality' m.name m.postal_code%}">{{m.name}}</a>
        </li>
        {% endfor %}
    </ul>
</section>
<!--fin bloc content-->

<script>

    const modal = document.getElementById('myModal');

    if (modal) {
        modal.style.display = "block";

        // Get the <span> element that closes the modal
        var span = document.getElementsByClassName("close")[0];
        if (span) {
            // When the user clicks on <span> (x), close the modal
            span.onclick = function () {
                modal.style.display = "none";
            }

            // When the user clicks anywhere outside of the modal, close it
            window.onclick = function (event) {
                if (event.target == modal) {
                    modal.style.display = "none";
                }
            }
        }
    }



</script>

<style>
    /* The Modal (background) */
    .modal {
        display: block;
        /* Hidden by default */
        position: fixed;
        /* Stay in place */
        z-index: 1;
        /* Sit on top */
        padding-top: 100px;
        /* Location of the box */
        left: 0;
        top: 0;
        width: 100%;
        /* Full width */
        height: 100%;
        /* Full height */
        overflow: auto;
        /* Enable scroll if needed */
        background-color: rgb(0, 0, 0);
        /* Fallback color */
        background-color: rgba(0, 0, 0, 0.4);
        /* Black w/ opacity */
    }

    /* Modal Content */
    .modal-content {
        background-color: #fefefe;
        margin: auto;
        padding: 20px;
        border: 1px solid #888;
        width: 50%;
    }

    /* The Close Button */
    .close {
        color: #aaaaaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
    }

    .close:hover,
    .close:focus {
        color: #000;
        text-decoration: none;
        cursor: pointer;
    }
</style>

{% endblock %}

{% block footer %}
{% include 'frags/footer.html' %}
{% endblock %}