{% trans_default_domain 'messages' %}
<!DOCTYPE html>
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="fr-FR"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="fr-FR">
<!--<![endif]-->
<head>
	   {# POUR AJOUTER DES META ( like og: ) #}
    {% block meta %}
        <meta charset="utf-8">
        <meta name="lang" content="FR"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <meta name="application-name" content="{{ KOH_MLC_NAME_SMALL|default('Kohinos') }}"/>
        <meta name="mobile-web-app-capable" content="yes"/>
        <meta name="apple-mobile-web-app-capable" content="yes"/>
        <meta name="apple-mobile-web-app-title" content="{{ KOH_MLC_NAME_SMALL|default('Kohinos') }}"/>
        <meta name="msapplication-starturl" content="/">
        <meta name="msapplication-TileColor" content="#ffffff">
        <meta name="theme-color" content="#ffffff">
        <link rel="manifest" href="/manifest.json"/>

        <meta name="description" content="{{ description|default('Kohinos : Outil de gestion de monnaie locale complémentaire') }}" />
        <meta name="keywords" content="{{ keywords|default('Kohinos, mlc, mlcc, monnaie locale, monnaies locales') }}" />
    {% endblock meta %}
    
    {% block pagetitle %}
        <title>{{title|default(KOH_MLC_NAME|default('')) }}</title>
    {% endblock pagetitle %}


    {# FAVICON #}
    {% block favicon %}
        <link rel="shortcut icon" href="/images/favicon/favicon-32x32.png" type="image/x-icon"/>
        <link rel="icon" type="image/x-icon" href="/images/favicon/favicon.ico"/>
        {# https://www.favicon-generator.org #}
        <link rel="apple-touch-icon" sizes="57x57" href="/images/favicon/apple-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="60x60" href="/images/favicon/apple-icon-60x60.png">
        <link rel="apple-touch-icon" sizes="72x72" href="/images/favicon/apple-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="76x76" href="/images/favicon/apple-icon-76x76.png">
        <link rel="apple-touch-icon" sizes="114x114" href="/images/favicon/apple-icon-114x114.png">
        <link rel="apple-touch-icon" sizes="120x120" href="/images/favicon/apple-icon-120x120.png">
        <link rel="apple-touch-icon" sizes="144x144" href="/images/favicon/apple-icon-144x144.png">
        <link rel="apple-touch-icon" sizes="152x152" href="/images/favicon/apple-icon-152x152.png">
        <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-icon-180x180.png">
        <link rel="icon" type="image/png" sizes="192x192"  href="/images/favicon/android-icon-192x192.png">
        <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="96x96" href="/images/favicon/favicon-96x96.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
        <meta name="msapplication-TileImage" content="/images/favicon/ms-icon-144x144.png">
    {% endblock favicon %}

 	{% block stylesheets %}
        {{ encore_entry_link_tags('app') }}
        <link rel="stylesheet" href="/leaflet/leaflet.css">
    {% endblock stylesheets %}

	{# POUR AJOUTER DES CSS #}
 	{% block css %} {% endblock css %}
</head>

<body>
    <input type="hidden" name="koh_map_center" id="koh_map_center" value='{{KOH_MAP_CENTER|default('')}}' />
    <input type="hidden" name="koh_map_zoom" id="koh_map_zoom" value='{{KOH_MAP_ZOOM|default('')}}' />

	{% include '@kohinos/common/modale_choix_groupe.html.twig' %}
    {% include '@kohinos/common/modale_confirmation_transaction.html.twig' %}
	{% include '@kohinos/common/modale_info_for_users.html.twig' %}

    <!-- HEADER -->
    {% block header %}
      {% include '@kohinos/common/header.html.twig' %}
    {% endblock header %}

    <!-- CONTAINER -->
    <div class="container">
        {% include '@kohinos/common/flash-messages.html.twig' %}
        {% block content %}
        <!-- CONTENT -->
        {% endblock content %}
    </div>

    <!-- FOOTER -->
    {% block footer %}
      {% include '@kohinos/common/footer.html.twig' %}
    {% endblock footer %}

	{% block javascripts %}
        {{ encore_entry_script_tags('app') }}
    {% endblock javascripts %}

    {# POUR AJOUTER DES JS #}
    {% block js %} {% endblock js %}

    {# AFFICHAGE DE LA MODALE DE CHOIX DU RÔLE (groupe associé aux rôles) #}
    {% if showModalGroupChoice() %}
        <script>
            $(document).ready(function() {
                $('#roleGroupeModal').modal('show');
            });
        </script>
    {% endif %}

    {# AFFICHAGE DE LA MODALE INFORMATIVE #}
    {% if showInformationModal() %}
        <script>
            $(document).ready(function() {
                $('#infoForUserModal').modal('show');
            });
        </script>
    {% endif %}

    {% if app.request.query.get('showmlcadhesionmodal') %}
        <script>
            $(document).ready(function() {
                $('#mlcadhesionmodal').modal('show');
            });
        </script>
    {% endif %}
    <script>
        $('.viewChoiceGroup').on('click', function () {
            $('#roleGroupeModal').modal('show');
        });
        {# https://stackoverflow.com/questions/34369951/how-to-get-add-to-home-screen-pop-up-on-site-open-in-mobile-browser #}
        {#if ('serviceWorker' in navigator) {
            console.log('sw');
            navigator.serviceWorker.register('/service-worker.js')
            .then(function(reg){
                console.log('sw ok');
            }).catch(function(err) {
                console.log('sw nok');
            });
        }#}
        if ("serviceWorker" in navigator){
            window.addEventListener("load", () => {
                navigator.serviceWorker.register("/sw.js");
            })
        }
    </script>

</body>

</html>
