templates/default/concours-2023.html.twig line 1

Open in your IDE?
  1. {% extends "layout-no-menu.html.twig" %}
  2. {#
  3. {% use AppBundle/Helper/Apik %}
  4. #}
  5. {% block content %}
  6.     <!-- #main -->
  7.     <main id="main" role="main">
  8.         <div class="apk-concours-2023">
  9.             {% if editmode %}
  10.             <p>Image desktop</p>
  11.             {{ pimcore_image("banner-image") }}
  12.             <hr/>
  13.             <p>Image mobile</p>
  14.             {{ pimcore_image("banner-image-mobile") }}
  15.             <hr/>
  16.             <p>Image fond formulaire</p>
  17.             {{ pimcore_image("banner-image-form") }}
  18.             <hr/>
  19.             <p>Sous-titre</p>
  20.             <p>
  21.             {{ pimcore_textarea("content-text",{
  22.                 "nl2br" : true
  23.             }) }}
  24.             </p>
  25.             <p>Sous-titre gras</p>
  26.             <p>
  27.             {{ pimcore_textarea("content-text-2",{
  28.                 "nl2br" : true
  29.             }) }}
  30.             </p>
  31.             <p>Dates</p>
  32.             <p>
  33.             {{ pimcore_textarea("content-date",{
  34.                 "nl2br" : true
  35.             }) }}
  36.             </p>
  37.             <div class="uk-alert uk-alert-primary" uk-alert>
  38.                 <h2 class="uk-h2">Modal du réglement du concours</h2>
  39.                 {{ pimcore_wysiwyg('reglement') }}
  40.             </div>
  41.             {% else %}
  42.             <div id="modal-reglement-2023" class="uk-flex-top" uk-modal>
  43.                 <div class="uk-modal-dialog uk-margin-auto-vertical">
  44.                     <button class="uk-modal-close-full uk-close-large" type="button" uk-close></button>
  45.                     <div class="uk-modal-body" uk-overflow-auto>
  46.                         {{ pimcore_wysiwyg('reglement') }}
  47.                     </div>
  48.                     <div class="uk-modal-footer uk-text-right">
  49.                         <button class="uk-button uk-button-default uk-modal-close" type="button">{{ "Fermer"|trans }}</button>
  50.                     </div>
  51.                 </div>
  52.             </div>
  53.             <div class="apk-container-image uk-inline uk-visible@m">
  54.                 {{ pimcore_image("banner-image") }}
  55.                 {{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
  56.                 <div class="uk-position-center-left">
  57.                     <div class="apk-title">
  58.                         <h1>{{ "Concours !"|trans }}</h1>
  59.                     </div>
  60.                 </div>
  61.                 <div class="uk-position-top-right">
  62.                     <div class="apk-date">
  63.                         <p>{{ pimcore_textarea("content-date",{"nl2br" : true}) }}</p>
  64.                     </div>
  65.                 </div>
  66.                 <div class="uk-position-bottom-left">
  67.                     <p class="uk-margin-remove-bottom">{{ pimcore_textarea("content-text",{"nl2br" : true}) }}</p>
  68.                     <p class="uk-margin-remove-top"><strong>{{ pimcore_textarea("content-text-2",{"nl2br" : true}) }}</strong></p>
  69.                 </div>
  70.             </div>
  71.             <div class="apk-container-image uk-inline uk-hidden@m">
  72.                 {{ pimcore_image("banner-image-mobile") }}
  73.                 {{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
  74.                 <div class="uk-position-center-left">
  75.                     <div class="apk-title">
  76.                         <h1>{{ "Concours !"|trans }}</h1>
  77.                     </div>
  78.                 </div>
  79.                 <div class="uk-position-center-right">
  80.                     <div class="apk-date">
  81.                         <p>{{ pimcore_textarea("content-date",{"nl2br" : true}) }}</p>
  82.                     </div>
  83.                 </div>
  84.                 <div class="uk-position-bottom-left">
  85.                     <p class="uk-margin-remove-bottom">{{ pimcore_textarea("content-text",{"nl2br" : true}) }}</p>
  86.                     <p class="uk-margin-remove-top"><strong>{{ pimcore_textarea("content-text-2",{"nl2br" : true}) }}</strong></p>
  87.                 </div>
  88.             </div>
  89.             {% endif %}
  90.             <div class="uk-background-cover uk-panel uk-flex uk-flex-center uk-flex-middle apk-background-cover" style="background-image: url({{ pimcore_image("banner-image-form").thumbnail("full-background") }});">
  91.                 <div class="uk-container apk-container1400">
  92.                     {% if formStatus == 'robot' %}
  93.                         <div class="uk-alert-warning" uk-alert>
  94.                             <p>{{ "Une erreur recaptcha est survenue, merci de réessayer."|trans }}</p>
  95.                         </div>
  96.                     {% elseif formStatus == 'invalid' %}
  97.                         <div class="uk-alert-warning" uk-alert>
  98.                             <p>{{ "Vous n'avez pas remplis tout les champs, merci de réessayer."|trans }}</p>
  99.                         </div>
  100.                     {% elseif formStatus == 'alreadyPlayed' %}
  101.                         <div class="uk-alert-warning" uk-alert>
  102.                             <p>{{ "Vous avez déjà participé à ce concours"|trans }}</p>
  103.                         </div>
  104.                     {% elseif formStatus == 'not-filled' %}
  105.                         <div class="uk-alert-warning" uk-alert>
  106.                             <p>{{ "Veuillez remplir tout les champs"|trans }}</p>
  107.                         </div>
  108.                     {% endif %}
  109.                     {{ form_start(form,{'attr': {'id': '#concours2023', 'enctype' : 'multipart/form-data'}}) }}
  110.             
  111.                     <div class="apk-container-form">
  112.                         <h2>{{ "Question 1"|trans }}</h2>
  113.                         <label class="uk-form-label required apk-label-is-linked-to-field apk-label-color"
  114.                                 for="form-stacked-text"> {{ form_label(form.choixmultiple) }} </label>
  115.                         {{ form_widget(form.choixmultiple) }}
  116.                     </div>
  117.                     <div class="apk-container-form">
  118.                         <h2>{{ "Question 2"|trans }}</h2>
  119.                         <label class="apk-label-color">{{"Selon vous, combien de personnes rempliront ce formulaire ?*"|trans}}</label>
  120.                         </br>
  121.                         <label class="uk-form-label apk-label-color"
  122.                                 for="form-stacked-text"> {{ form_label(form.message) }} </label>
  123.                         {{ form_widget(form.message) }}
  124.                     </div>
  125.                     <div class="apk-container-form uk-margin-medium-bottom">
  126.                         <div class="uk-grid-small" uk-grid>
  127.                             <div class="uk-width-1-1">
  128.                                 <label class="uk-form-label"
  129.                                         for="form-stacked-text"> {{ form_label(form.lastname) }} </label>
  130.                                 {{ form_widget(form.lastname) }}
  131.                             </div>
  132.                             <div class="uk-width-1-1">
  133.                                 <label class="uk-form-label"
  134.                                         for="form-stacked-text"> {{ form_label(form.firstname) }} </label>
  135.                                 {{ form_widget(form.firstname) }}
  136.                             </div>
  137.                             <div class="uk-width-1-1">
  138.                                 <label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.email) }} </label>
  139.                                 {{ form_widget(form.email) }}
  140.                             </div>
  141.                             <div class="uk-width-1-1">
  142.                                 <label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.preuvePaiement) }} </label>
  143.                                 {{ form_widget(form.preuvePaiement) }}
  144.                             </div>
  145.                             <div class="uk-width-1-1">
  146.                                 {{ form_widget(form.gdpr) }}
  147.                                 <label for="concours2023_form_gdpr" id="accept-condition" class="uk-padding-remove">
  148.                                     {{ "J’accepte la politique de confidentialité, le traitement de mes données par Magnecaps"|trans }}
  149.                                 </label>
  150.                             </div>
  151.                             <div class="uk-margin-small-top uk-margin-small-bottom uk-width-1-1">
  152.                                 {{ form_widget(form.reglement) }}
  153.                                 <label for="concours2023_form_reglement" id="accept-reglement" class="uk-padding-remove">
  154.                                     {{ "J’accepte le règlement de ce concours"|trans }}
  155.                                     <a href="#modal-reglement-2023" uk-toggle>
  156.                                         <img uk-svg width="20" height="20" src="/static/img/pictos/information.svg" alt="reglement">
  157.                                     </a>
  158.                                 </label>
  159.                             </div>
  160.                             <div class="div-submit">
  161.                                 {{ form_widget(form.recaptcha) }}
  162.                                 {{ form_widget(form.submit) }}
  163.                             </div>
  164.                         </div>
  165.                         <p class="uk-margin-remove-bottom" style="font-size: 12px;">{{"*Champs obligatoires"|trans}}</p>
  166.                     </div>
  167.                     {{ form_end(form) }}
  168.                     {% if formStatus == 'success' %}
  169.                         <div id="success" uk-modal>
  170.                             <div class="uk-modal-dialog uk-modal-body apk-modal-sucess">
  171.                                 <div class="uk-inline uk-text-center">
  172.                                     <div class="uk-position-center-left apk-forme-left">
  173.                                         <img src="/static/img/bgs/formes-un.png" alt="">
  174.                                     </div>
  175.                                     <div class="uk-text-right uk-margin-right uk-margin-small-top">
  176.                                         <button class="uk-modal-close" type="button" aria-label="Close" uk-close></button>
  177.                                     </div>
  178.                                     <div class="uk-flex uk-flex-center uk-flex-middle uk-height-1-1">
  179.                                         <div class="apk-content-modal">
  180.                                             <h2>{{ "Merci pour votre participation !"|trans }}</h2>
  181.                                             <p><strong>{{ "Le tirage au sort aura lieu le 02/05/2023 et tous les gagnants seront avertis par e-mail."|trans }}</strong></p>
  182.                                             <p>{{ "D'ici là n'hésitez pas à nous suivre sur les réseaux sociaux !"|trans }}</p>
  183.                                             <div class="uk-flex uk-flex-center apk-logos-media">
  184.                                                 {% if document.property('facebookUrl') %} 
  185.                                                     <a href="{{ document.property('facebookUrl') }}" target="_blank"><img src="/static/img/pictos/Facebook-logo.png" alt=""></a>
  186.                                                 {% endif %}
  187.                                                 {% if document.property('instagramUrl') %} 
  188.                                                     <a href="{{ document.property('instagramUrl') }}" target="_blank"><img src="/static/img/pictos/Instagram-logo.png" alt=""></a>
  189.                                                 {% endif %}
  190.                                             </div>
  191.                                         </div>
  192.                                     </div>
  193.                                     <div class="uk-position-center-right apk-forme-right">
  194.                                         <img src="/static/img/bgs/formes-deux.png" alt="">
  195.                                     </div>
  196.                                 </div>
  197.                             </div>
  198.                         </div>
  199.                     {% endif %}
  200.                 </div>
  201.             </div>
  202.         </div>
  203.     </main><!-- end #main -->
  204.     {% do pimcore_head_link().appendStylesheet(asset('/static/framework/dropify/css/dropify.min.css')) %}
  205.     {% do pimcore_head_script().appendFile(asset('/static/framework/heic2any/heic2any.js')) %}
  206.     {% do pimcore_head_script().appendFile(asset('/static/framework/dropify/js/dropify.js')) %}
  207.     {% endblock %}
  208. {% block inlinescripts %}
  209.   {% set recaptchaKeyPublic = pimcore_website_config('recaptchaKeyPublic') %}
  210.   <script src="https://www.google.com/recaptcha/api.js?onload=onloadRecaptchaCallback&render={{ recaptchaKeyPublic }}"></script>
  211.   <script>
  212.     if($('#success').length) {
  213.       UIkit.modal($('#success')).show();
  214.       console.log('success');
  215.     }
  216.     
  217.     function onloadRecaptchaCallback(){
  218.         grecaptcha.ready(function() {
  219.             grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'concours2023'}).then(function(token) {
  220.             //alert('recaptcha is loaded');
  221.             var recaptcha = document.getElementById('concours2023_form_recaptcha');
  222.             recaptcha.value = token;
  223.             });
  224.         });
  225.     }
  226.     setInterval(function () {
  227.         grecaptcha.ready(function() {
  228.         grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'concours2023'}).then(function(token) {
  229.         //alert('recaptcha is loaded');
  230.         var recaptcha = document.getElementById('concours2023_form_recaptcha');
  231.         recaptcha.value = token;
  232.         });
  233.     });
  234.     }, 110 * 1000);
  235.   </script>
  236. {% endblock inlinescripts %}