templates/front/theme1/cookies/cookie.html.twig line 1

Open in your IDE?
  1. {% set parametre = ParametreSite() %}
    {% set cookies = Cookies() %}
    
    {% if cookies.cookies == '1' %}
        <script type="text/javascript" src="https://www.termsfeed.com/public/cookie-consent/4.0.0/cookie-consent.js" charset="UTF-8" defer></script>
        <script type="text/javascript" charset="UTF-8">
        document.addEventListener('DOMContentLoaded', function () {
        cookieconsent.run({"notice_banner_type":"simple","consent_type":"explicit","palette":"light","language":"{{ app.request.locale }}","page_load_consent_levels":["strictly-necessary"],"notice_banner_reject_button_hide":false,"preferences_center_close_button_hide":false,"website_name":"{{parametre.titre|default('')}}"});
        });
        </script>
    {% else %}
        <script src="{{asset('tarteaucitron_js/tarteaucitron.js')}}"></script>  
        <script type="text/javascript">
            tarteaucitron.init({
                "privacyUrl": "{{cookies.privacypolicylink|default('cookies')}}", /* Privacy policy url */
                "bodyPosition": "bottom", /* or top to bring it as first element for accessibility */
    
                "hashtag": "#tarteaucitron", /* Open the panel with this hashtag */
                "cookieName": "tarteaucitron", /* Cookie name */
    
                "orientation": "{{cookies.postion|default('bottom')}}", /* Banner position (top - bottom - middle - popup) */
    
                "groupServices": false, /* Group services by category */
                "showDetailsOnClick": true, /* Click to expand the description */
                "serviceDefaultState": "wait", /* Default state (true - wait - false) */
    
                "showAlertSmall": {% if app.request.attributes.get('_route_params')['slug'] is defined and app.request.attributes.get('_route_params')['slug'] == 'cookies' %}true{% else %}false{% endif %}, /* Show the small banner on bottom right */
                "cookieslist": false, /* Show the cookie list */
                
                "showIcon": true, /* Show cookie icon to manage cookies */
                // "iconSrc": "", /* Optional: URL or base64 encoded image */
                "iconPosition": "BottomRight", /* Position of the icon between BottomRight, BottomLeft, TopRight and TopLeft */
    
                "adblocker": false, /* Show a Warning if an adblocker is detected */
    
                "DenyAllCta" : true, /* Show the deny all button */
                "AcceptAllCta" : true, /* Show the accept all button when highPrivacy on */
                "highPrivacy": true, /* Disable auto consent */
    
                "handleBrowserDNTRequest": false, /* If Do Not Track == 1, disallow all */
    
                "removeCredit": false, /* Remove credit link */
                "moreInfoLink": true, /* Show more info link */
                "useExternalCss": false, /* If false, the tarteaucitron.css file will be loaded */
                "useExternalJs": false, /* If false, the tarteaucitron.services.js file will be loaded */
    
                // "cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for subdomain website */
    
                "readmoreLink": "", /* Change the default readmore link pointing to tarteaucitron.io */
                
                "mandatory": true, /* Show a message about mandatory cookies */
                "mandatoryCta": true, /* Show the disabled accept button when mandatory on */
                
                // "customCloserId": "", /* Optional a11y: Custom element ID used to open the panel */
    
                "googleConsentMode": true, /* Enable Google Consent Mode v2 for Google ads and GA4 */
                
                "partnersList": false, /* Details the number of partners on the popup and middle banner */
    
                "privacyUrlLabel": "{{cookies.labelprivacypolicylink|default('En savoir plus')}}",
                "privacyOKLabel": "{{cookies.labelclosebutton|default('OK, tout accepter')}}",
                "privacyPersonalizeLabel": "{{cookies.labelcustomlink|default('Personnaliser')}}",
                
                "texte": "{{cookies.message|default('')}}",
                "font_color": "{{cookies.colorokbutton|default('#839273')}}",
                "fond_color": "{{cookies.backgroundcolor|default('#333333')}}",
                "lien_color": "{{cookies.colorcookielink|default('#333333')}}"
            });
            </script>
    
        {% if cookies.googletypekit and cookies.googletypekitid is not empty %}
            <script type="text/javascript">
               tarteaucitron.user.typekitId = '{{cookies.googletypekitid}}';
               (tarteaucitron.job = tarteaucitron.job || []).push('typekit');
            </script>
        {% endif %}
    
        {% if ParametreSite().analytics is not empty %}    
            <script type="text/javascript">
                tarteaucitron.user.gtagUa = 'G-{{ParametreSite().analytics}}';
                tarteaucitron.user.gtagMore = function () { /* add here your optionnal gtag() */ };
                (tarteaucitron.job = tarteaucitron.job || []).push('gtag');
            </script>
        {% endif %}
    
        {% if cookies.googlemaps and cookies.googlemapskey is not empty %}
            <script type="text/javascript">
                tarteaucitron.user.googlemapsKey = '{{cookies.googlemapskey}}';
                (tarteaucitron.job = tarteaucitron.job || []).push('googlemaps');
            </script>
        {% endif %}
    
        <script type="text/javascript">
            (tarteaucitron.job = tarteaucitron.job || []).push('maps_noapi');
            </script>
    
        {#{% if cookies.googleanalytics  and  cookies.googleanalyticsid is not empty %}
             <script type="text/javascript">
                tarteaucitron.user.analyticsUa = 'UA-{{cookies.googleanalyticsid}}';
                tarteaucitron.user.analyticsMore = function () { /* optionnal ga.push() */ };
                tarteaucitron.user.analyticsUaCreate = { /* optionnal create configuration */ };
                tarteaucitron.user.analyticsAnonymizeIp = true;
                tarteaucitron.user.analyticsPageView = { /* optionnal pageview configuration */ };
                tarteaucitron.user.analyticsMore = function () { /* optionnal ga.push() */ };
                (tarteaucitron.job = tarteaucitron.job || []).push('analytics');
            </script>
        {% endif %}#}
    
        {% if cookies.googleadwords and cookies.codegoogleadwords is not empty %}
            <script type="text/javascript">
            tarteaucitron.user.googleadsId = '{{cookies.codegoogleadwords|raw}}';
            (tarteaucitron.job = tarteaucitron.job || []).push('googleads');
            </script>
        {% endif %}
    
        {% if cookies.youtube %}
            <script type="text/javascript">
               (tarteaucitron.job = tarteaucitron.job || []).push('youtube');
            </script>
        {% endif %}
    
        {% if cookies.facebooklikebox %}
            <script type="text/javascript">
                (tarteaucitron.job = tarteaucitron.job || []).push('facebooklikebox');
            </script>
        {% endif %}
    
        {% if cookies.facebook %}
            <script type="text/javascript">
               (tarteaucitron.job = tarteaucitron.job || []).push('facebook');
            </script>
        {% endif %}
    
        {% if cookies.linkedin %}
           <script type="text/javascript">
             (tarteaucitron.job = tarteaucitron.job || []).push('linkedin');
           </script>
        {% endif %}
    
        {% if cookies.twitter %}
            <script type="text/javascript">
               (tarteaucitron.job = tarteaucitron.job || []).push('twitter');
            </script>
        {% endif %}
    
        {% if cookies.twittercards %}
            <script type="text/javascript">
               (tarteaucitron.job = tarteaucitron.job || []).push('twitterembed');
            </script>
        {% endif %}
    
        {% if cookies.twittertimeline %}
            <script type="text/javascript">
                (tarteaucitron.job = tarteaucitron.job || []).push('twittertimeline');
            </script>
        {% endif %}
    
        {% if parametre != null and parametre.typerecaptcha == 1 and cookies.googlerecaptcha != null %}
            {% if cookies.googlerecaptcha != null and parametre != null and parametre.clekey != null %}
                <script>
                    tarteaucitron.user.key = "{{parametre.clekey}}";
                    (tarteaucitron.job = tarteaucitron.job || []).push('recaptcha3');
                </script> 
            {% endif %}
    
            <script>
                var checkCookieRecaptcha = (tarteaucitron.cookie.read().indexOf('recaptcha3=true') >= 0);
                var forms = document.querySelectorAll('form');
                if(checkCookieRecaptcha){
                    forms.forEach((form)=> {
                    $(form).find('[type="submit"]').removeAttr('disabled' ).css({'cursor': '', 'opacity': ''});
                    });
                }else{
                forms.forEach((form)=> {
                    $(form).find('[type="submit"]').attr('disabled', 'disabled').css({'cursor': 'not-allowed', 'opacity': 0.4});
                    $('<div class="alert-danger alert-cookie-recaptcha">Merci d\'accepter les cookies pour pouvoir envoyer votre message</div>').show().insertBefore($(form).find('[type="submit"]'));
                });
                }
            </script>
         {% elseif parametre != null and parametre.typerecaptcha == 2 and cookies.googlerecaptcha != null %}
    
            {% if parametre != null and parametre.clekey != null %}
                <script type="text/javascript">
                    (tarteaucitron.job = tarteaucitron.job || []).push('recaptcha');
                </script> 
            {% endif %}
    
    
        {% endif %}
            
    {% endif %}