templates/default/concours.html.twig line 1

Open in your IDE?
  1. {% extends "layout.html.twig" %}
  2. {#
  3. {% use AppBundle/Helper/Apik %}
  4. #}
  5. {% block content %}
  6.     {{ pimcore_areablock("myAreablock") }}
  7.     {{ pimcore_areablock('contentTop') }}
  8.     <!-- #main -->
  9.     <main id="main" role="main">
  10.         {% if editmode %}
  11.             <div class="editmode-img">
  12.                 <div class="uk-margin-xlarge-top">
  13.                     {{ pimcore_image("facebook-image") }}
  14.                     {{ pimcore_image("instagram-image") }}
  15.                 </div>
  16.                 {{ pimcore_image('reseaux-forme') }}
  17.                 </br>
  18.                 <div>Type de heading pour le titre ?</div>
  19.                 {{ pimcore_select("content-heading", {
  20.                     "store" : [
  21.                         ['span', 'span'],
  22.                         ['h1', 'Heading 1'],
  23.                         ['h2', 'Heading 2'],
  24.                         ['h3', 'Heading 3'],
  25.                         ['h4', 'Heading 4'],
  26.                         ['h5', 'Heading 5'],
  27.                         ['h6', 'Heading 6']
  28.                     ],
  29.                     "defaultValue" : "h2"
  30.                 }) }}
  31.                 <div><strong>Style</strong> du heading pour le titre ?</div>
  32.                 {{ pimcore_select("content-heading-style", {
  33.                     "store" : [
  34.                         ['h1', 'Heading 1'],
  35.                         ['h2', 'Heading 2'],
  36.                         ['h3', 'Heading 3'],
  37.                         ['h4', 'Heading 4'],
  38.                         ['h5', 'Heading 5'],
  39.                         ['h6', 'Heading 6']
  40.                     ],
  41.                     "defaultValue" : "h2"
  42.                 }) }}
  43.                 <h2 class="">{{ pimcore_textarea('content-title', {'nl2br' : true}) }}</h2>
  44.                 <div>Type de heading pour le sous-titre ?</div>
  45.                 {{ pimcore_select("subtitle-heading", {
  46.                     "store" : [
  47.                         ['span', 'span'],
  48.                         ['h1', 'Heading 1'],
  49.                         ['h2', 'Heading 2'],
  50.                         ['h3', 'Heading 3'],
  51.                         ['h4', 'Heading 4'],
  52.                         ['h5', 'Heading 5'],
  53.                         ['h6', 'Heading 6']
  54.                     ],
  55.                     "defaultValue" : "h2"
  56.                 }) }}
  57.                 <div><strong>Style</strong> du heading pour le sous-titre ?</div>
  58.                 {{ pimcore_select("subtitle-style", {
  59.                     "store" : [
  60.                         ['h1', 'Heading 1'],
  61.                         ['h2', 'Heading 2'],
  62.                         ['h3', 'Heading 3'],
  63.                         ['h4', 'Heading 4'],
  64.                         ['h5', 'Heading 5'],
  65.                         ['h6', 'Heading 6']
  66.                     ],
  67.                     "defaultValue" : "h2"
  68.                 }) }}
  69.                 <h2 class="">{{ pimcore_textarea('content-subtitle', {'nl2br' : true}) }}</h2>
  70.                 {{ pimcore_image("forme-image") }}
  71.                 <div>
  72.                     {{ pimcore_textarea("content") }}
  73.                     {{ pimcore_image("logo-image") }}
  74.                 </div>
  75.                 {{ pimcore_link("link-logo") }}
  76.                 {{ pimcore_image("logo-right") }}
  77.             </div>
  78.             {{ pimcore_image('background-image') }}
  79.         {% else %}
  80.             <div class="div-fond-concours" uk-height-match="target: changed">
  81.                  <div class="div-fond-concours-cropped uk-cover-container apk-height-match" >
  82.                     {{ pimcore_image('background-image').thumbnail('concours-thumb').html({'imgAttributes' : {'uk-cover' : null}})|raw }}
  83.                 </div>
  84.                 <div class="div-fond-blanc" uk-grid>
  85.                     <div class="uk-width-1-3@m apk-height-match">
  86.                         <div class="div-text-concours">
  87.                             <div class="polygone uk-visible@m">
  88.                                 {{ pimcore_image('reseaux-forme') }}
  89.                                 <div class="reseaux uk-flex">
  90.                                     {% if document.property('facebookUrl') %}
  91.                                         <a href="{{ document.property('facebookUrl') }}" target="_blank"><img
  92.                                                     src="{{ pimcore_image('facebook-image').thumbnail('reseaux') }}"></a>
  93.                                     {% endif %}
  94.                                     {% if document.property('instagramUrl') %}
  95.                                         <a href="{{ document.property('instagramUrl') }}" target="_blank"><img
  96.                                                     src="{{ pimcore_image('instagram-image').thumbnail('reseaux') }}"></a>
  97.                                     {% endif %}
  98.                                 </div>
  99.                             </div>
  100.                             <div class="uk-margin-xlarge-top">
  101.                                 {% if not pimcore_textarea("content-title").isEmpty %}
  102.                                 {% if pimcore_select("content-heading").data == "span" %}
  103.                                 <span class="uk-{{ pimcore_select("content-heading-style").getData() }}">{{ pimcore_textarea('content-title', {'nl2br' : true}) }}</span>
  104.                                 {% else %}
  105.                                 {% set content_heading = pimcore_select("content-heading").getData() %}
  106.                                 <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}
  107.                                 ">
  108.                                 {{ pimcore_textarea("content-title", {
  109.                                     "nl2br" : true})|raw }}
  110.                             </{{ content_heading }}>
  111.                             {% endif %}
  112.                             {% endif %}
  113.                         </div>
  114.                         <p class="content-textarea-concours">{{ pimcore_textarea("content") }}</p>
  115.                         <div class="forme-concours">{{ pimcore_image("forme-image") }}</div>
  116.                     </div>
  117.                 </div>
  118.                 
  119.                 <div class="uk-width-1-3@m div-form">
  120.                     <div>
  121.                         <div class="uk-text-center">
  122.                             {{ pimcore_image("logo-image", {"thumbnail": "logo-concours-thumb"}) }}
  123.                         </div>
  124.                         {% if not pimcore_textarea("content-subtitle").isEmpty %}
  125.                         {% if pimcore_select("subtitle-heading").data == "span" %}
  126.                             <span class="uk-{{ pimcore_select("subtitle-style").getData() }}">{{ pimcore_textarea('content-subtitle', {'nl2br' : true}) }}</span>
  127.                             {% else %}
  128.                                 {% set content_heading = pimcore_select("subtitle-heading").getData() %}
  129.                                 <{{ content_heading }} class="uk-{{ pimcore_select("subtitle-style").getData() }}">
  130.                                     {{ pimcore_textarea("content-subtitle", {"nl2br" : true})|raw }}
  131.                                 </{{ content_heading }}>
  132.                             {% endif %}
  133.                         {% endif %}
  134.                         {% if formStatus == 'robot' %}
  135.                             <div class="uk-alert-warning" uk-alert>
  136.                                 <p>{{ "Une erreur recaptcha est survenue, merci de réessayer."|trans }}</p>
  137.                             </div>
  138.                         {% elseif formStatus == 'invalid' %}
  139.                             <div class="uk-alert-warning" uk-alert>
  140.                                 <p>{{ "Vous n'avez pas remplis tout les champs, merci de réessayer."|trans }}</p>
  141.                             </div>
  142.                         {% elseif formStatus == 'alreadyPlayed' %}
  143.                             <div class="uk-alert-warning" uk-alert>
  144.                                 <p>{{ "Vous avez déjà participé à ce concours"|trans }}</p>
  145.                             </div>
  146.                         {% elseif formStatus == 'not-filled' %}
  147.                             <div class="uk-alert-warning" uk-alert>
  148.                                 <p>{{ "Veuillez remplir tout les champs"|trans }}</p>
  149.                             </div>
  150.                         {% endif %}
  151.                         {% if formStatus != 'success' %}
  152.                             {{ form_start(form,{'attr': {'id': 'contact-form', 'enctype' : 'multipart/form-data'}}) }}
  153.                             <div class="uk-grid-small form-concours-grid" uk-grid>
  154.                                 <div class="uk-width-1-1">
  155.                                     <label class="uk-form-label required apk-label-is-linked-to-field"
  156.                                            for="form-stacked-text"> {{ form_label(form.choixmultiple) }} </label>
  157.                                     {{ form_widget(form.choixmultiple) }}
  158.                                 </div>
  159.                                 <div class="uk-width-1-1">
  160.                                     <label class="uk-form-label"
  161.                                            for="form-stacked-text"> {{ form_label(form.message) }} </label>
  162.                                     {{ form_widget(form.message) }}
  163.                                 </div>
  164.                                 <div class="uk-width-1-2">
  165.                                     <label class="uk-form-label"
  166.                                            for="form-stacked-text"> {{ form_label(form.lastname) }} </label>
  167.                                     {{ form_widget(form.lastname) }}
  168.                                 </div>
  169.                                 <div class="uk-width-1-2">
  170.                                     <label class="uk-form-label"
  171.                                            for="form-stacked-text"> {{ form_label(form.firstname) }} </label>
  172.                                     {{ form_widget(form.firstname) }}
  173.                                 </div>
  174.                                 <div class="uk-width-1-1">
  175.                                     <label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.email) }} </label>
  176.                                     {{ form_widget(form.email) }}
  177.                                 </div>
  178.                                 <div class="uk-width-1-1">
  179.                                     <label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.preuvePaiement) }} </label>
  180.                                     {{ form_widget(form.preuvePaiement) }}
  181.                                 </div>
  182.                                 <div>
  183.                                     {{ form_widget(form.gdpr) }}
  184.                                     <label for="contact_form_gdpr" id="accept-condition" class="uk-padding-remove">
  185.                                         {{ "J’accepte la politique de confidentialité, le traitement de mes données par Magnecaps"|trans }}
  186.                                     </label>
  187.                                 </div>
  188.                                 <div class="uk-margin-small-top uk-margin-small-bottom">
  189.                                     {{ form_widget(form.reglement) }}
  190.                                     <label for="contact_form_reglement" id="accept-reglement" class="uk-padding-remove">
  191.                                         {{ "J’accepte le règlement de ce concours"|trans }}
  192.                                         <a href="#modal-reglement" uk-toggle>
  193.                                             <img uk-svg width="20" height="20" src="/static/img/pictos/information.svg" alt="reglement">
  194.                                         </a>
  195.                                     </label>
  196.                                 </div>
  197.                                 <div class="div-submit">
  198.                                     {{ form_widget(form.recaptcha) }}
  199.                                     {{ form_widget(form.submit) }}
  200.                                 </div>
  201.                             </div>
  202.                             {{ form_end(form) }}
  203.                         {% endif %}
  204.                     </div>
  205.                 </div>
  206.                 <div class="uk-width-1-3@m">
  207.                     {{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
  208.                     <div class="logo-right">
  209.                         <a href="{{ pimcore_link("link-logo").href }}" target="_blank"><img
  210.                                     src="{{ pimcore_image('logo-right').thumbnail('') }}"></a>
  211.                     </div>
  212.                 </div>
  213.             {% endif %}
  214.                 {% if editmode %}
  215.                     <div class="uk-alert uk-alert-primary" uk-alert>
  216.                         <h2 class="uk-h2">Modal du réglement du concours</h2>
  217.                         {{ pimcore_wysiwyg('reglement') }}
  218.                     </div>
  219.                 {% else %}
  220.                     <div id="modal-reglement" class="uk-flex-top" uk-modal>
  221.                         <div class="uk-modal-dialog uk-margin-auto-vertical">
  222.                             <button class="uk-modal-close-full uk-close-large" type="button" uk-close></button>
  223.                             <div class="uk-modal-body" uk-overflow-auto>
  224.                                 {{ pimcore_wysiwyg('reglement') }}
  225.                             </div>
  226.                             <div class="uk-modal-footer uk-text-right">
  227.                                 <button class="uk-button uk-button-default uk-modal-close" type="button">{{ "Fermer"|trans }}</button>
  228.                             </div>
  229.                         </div>
  230.                     </div>
  231.                 {% endif %}
  232.             
  233.         <div class="area-concours">{{ pimcore_areablock('contentBottom') }}</div>
  234.     </main><!-- end #main -->
  235.     {% do pimcore_head_link().appendStylesheet(asset('/static/framework/dropify/css/dropify.min.css')) %}
  236.     {% do pimcore_head_script().appendFile(asset('/static/framework/heic2any/heic2any.js')) %}
  237.     {% do pimcore_head_script().appendFile(asset('/static/framework/dropify/js/dropify.js')) %}
  238. {% endblock %}
  239. {% block inlinescripts %}
  240.   {% set recaptchaKeyPublic = pimcore_website_config('recaptchaKeyPublic') %}
  241.   <script src="https://www.google.com/recaptcha/api.js?onload=onloadRecaptchaCallback&render={{ recaptchaKeyPublic }}"></script>
  242.   <script>
  243.       function onloadRecaptchaCallback(){
  244.         grecaptcha.ready(function() {
  245.           grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'contact'}).then(function(token) {
  246.             //alert('recaptcha is loaded');
  247.             var recaptcha = document.getElementById('contact_form_recaptcha');
  248.             recaptcha.value = token;
  249.           });
  250.         });
  251.       }
  252.   </script>
  253. {% endblock inlinescripts %}