{% extends "layout-no-menu.html.twig" %}
{#
{% use AppBundle/Helper/Apik %}
#}
{% block content %}
<!-- #main -->
<main id="main" role="main">
<div class="apk-concours-2023">
{% if editmode %}
<p>Image desktop</p>
{{ pimcore_image("banner-image") }}
<hr/>
<p>Image mobile</p>
{{ pimcore_image("banner-image-mobile") }}
<hr/>
<p>Image fond formulaire</p>
{{ pimcore_image("banner-image-form") }}
<hr/>
<p>Sous-titre</p>
<p>
{{ pimcore_textarea("content-text",{
"nl2br" : true
}) }}
</p>
<p>Sous-titre gras</p>
<p>
{{ pimcore_textarea("content-text-2",{
"nl2br" : true
}) }}
</p>
<p>Dates</p>
<p>
{{ pimcore_textarea("content-date",{
"nl2br" : true
}) }}
</p>
<div class="uk-alert uk-alert-primary" uk-alert>
<h2 class="uk-h2">Modal du réglement du concours</h2>
{{ pimcore_wysiwyg('reglement') }}
</div>
{% else %}
<div id="modal-reglement-2023" class="uk-flex-top" uk-modal>
<div class="uk-modal-dialog uk-margin-auto-vertical">
<button class="uk-modal-close-full uk-close-large" type="button" uk-close></button>
<div class="uk-modal-body" uk-overflow-auto>
{{ pimcore_wysiwyg('reglement') }}
</div>
<div class="uk-modal-footer uk-text-right">
<button class="uk-button uk-button-default uk-modal-close" type="button">{{ "Fermer"|trans }}</button>
</div>
</div>
</div>
<div class="apk-container-image uk-inline uk-visible@m">
{{ pimcore_image("banner-image") }}
{{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
<div class="uk-position-center-left">
<div class="apk-title">
<h1>{{ "Concours !"|trans }}</h1>
</div>
</div>
<div class="uk-position-top-right">
<div class="apk-date">
<p>{{ pimcore_textarea("content-date",{"nl2br" : true}) }}</p>
</div>
</div>
<div class="uk-position-bottom-left">
<p class="uk-margin-remove-bottom">{{ pimcore_textarea("content-text",{"nl2br" : true}) }}</p>
<p class="uk-margin-remove-top"><strong>{{ pimcore_textarea("content-text-2",{"nl2br" : true}) }}</strong></p>
</div>
</div>
<div class="apk-container-image uk-inline uk-hidden@m">
{{ pimcore_image("banner-image-mobile") }}
{{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
<div class="uk-position-center-left">
<div class="apk-title">
<h1>{{ "Concours !"|trans }}</h1>
</div>
</div>
<div class="uk-position-center-right">
<div class="apk-date">
<p>{{ pimcore_textarea("content-date",{"nl2br" : true}) }}</p>
</div>
</div>
<div class="uk-position-bottom-left">
<p class="uk-margin-remove-bottom">{{ pimcore_textarea("content-text",{"nl2br" : true}) }}</p>
<p class="uk-margin-remove-top"><strong>{{ pimcore_textarea("content-text-2",{"nl2br" : true}) }}</strong></p>
</div>
</div>
{% endif %}
<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") }});">
<div class="uk-container apk-container1400">
{% if formStatus == 'robot' %}
<div class="uk-alert-warning" uk-alert>
<p>{{ "Une erreur recaptcha est survenue, merci de réessayer."|trans }}</p>
</div>
{% elseif formStatus == 'invalid' %}
<div class="uk-alert-warning" uk-alert>
<p>{{ "Vous n'avez pas remplis tout les champs, merci de réessayer."|trans }}</p>
</div>
{% elseif formStatus == 'alreadyPlayed' %}
<div class="uk-alert-warning" uk-alert>
<p>{{ "Vous avez déjà participé à ce concours"|trans }}</p>
</div>
{% elseif formStatus == 'not-filled' %}
<div class="uk-alert-warning" uk-alert>
<p>{{ "Veuillez remplir tout les champs"|trans }}</p>
</div>
{% endif %}
{{ form_start(form,{'attr': {'id': '#concours2023', 'enctype' : 'multipart/form-data'}}) }}
<div class="apk-container-form">
<h2>{{ "Question 1"|trans }}</h2>
<label class="uk-form-label required apk-label-is-linked-to-field apk-label-color"
for="form-stacked-text"> {{ form_label(form.choixmultiple) }} </label>
{{ form_widget(form.choixmultiple) }}
</div>
<div class="apk-container-form">
<h2>{{ "Question 2"|trans }}</h2>
<label class="apk-label-color">{{"Selon vous, combien de personnes rempliront ce formulaire ?*"|trans}}</label>
</br>
<label class="uk-form-label apk-label-color"
for="form-stacked-text"> {{ form_label(form.message) }} </label>
{{ form_widget(form.message) }}
</div>
<div class="apk-container-form uk-margin-medium-bottom">
<div class="uk-grid-small" uk-grid>
<div class="uk-width-1-1">
<label class="uk-form-label"
for="form-stacked-text"> {{ form_label(form.lastname) }} </label>
{{ form_widget(form.lastname) }}
</div>
<div class="uk-width-1-1">
<label class="uk-form-label"
for="form-stacked-text"> {{ form_label(form.firstname) }} </label>
{{ form_widget(form.firstname) }}
</div>
<div class="uk-width-1-1">
<label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.email) }} </label>
{{ form_widget(form.email) }}
</div>
<div class="uk-width-1-1">
<label class="uk-form-label" for="form-stacked-text"> {{ form_label(form.preuvePaiement) }} </label>
{{ form_widget(form.preuvePaiement) }}
</div>
<div class="uk-width-1-1">
{{ form_widget(form.gdpr) }}
<label for="concours2023_form_gdpr" id="accept-condition" class="uk-padding-remove">
{{ "J’accepte la politique de confidentialité, le traitement de mes données par Magnecaps"|trans }}
</label>
</div>
<div class="uk-margin-small-top uk-margin-small-bottom uk-width-1-1">
{{ form_widget(form.reglement) }}
<label for="concours2023_form_reglement" id="accept-reglement" class="uk-padding-remove">
{{ "J’accepte le règlement de ce concours"|trans }}
<a href="#modal-reglement-2023" uk-toggle>
<img uk-svg width="20" height="20" src="/static/img/pictos/information.svg" alt="reglement">
</a>
</label>
</div>
<div class="div-submit">
{{ form_widget(form.recaptcha) }}
{{ form_widget(form.submit) }}
</div>
</div>
<p class="uk-margin-remove-bottom" style="font-size: 12px;">{{"*Champs obligatoires"|trans}}</p>
</div>
{{ form_end(form) }}
{% if formStatus == 'success' %}
<div id="success" uk-modal>
<div class="uk-modal-dialog uk-modal-body apk-modal-sucess">
<div class="uk-inline uk-text-center">
<div class="uk-position-center-left apk-forme-left">
<img src="/static/img/bgs/formes-un.png" alt="">
</div>
<div class="uk-text-right uk-margin-right uk-margin-small-top">
<button class="uk-modal-close" type="button" aria-label="Close" uk-close></button>
</div>
<div class="uk-flex uk-flex-center uk-flex-middle uk-height-1-1">
<div class="apk-content-modal">
<h2>{{ "Merci pour votre participation !"|trans }}</h2>
<p><strong>{{ "Le tirage au sort aura lieu le 02/05/2023 et tous les gagnants seront avertis par e-mail."|trans }}</strong></p>
<p>{{ "D'ici là n'hésitez pas à nous suivre sur les réseaux sociaux !"|trans }}</p>
<div class="uk-flex uk-flex-center apk-logos-media">
{% if document.property('facebookUrl') %}
<a href="{{ document.property('facebookUrl') }}" target="_blank"><img src="/static/img/pictos/Facebook-logo.png" alt=""></a>
{% endif %}
{% if document.property('instagramUrl') %}
<a href="{{ document.property('instagramUrl') }}" target="_blank"><img src="/static/img/pictos/Instagram-logo.png" alt=""></a>
{% endif %}
</div>
</div>
</div>
<div class="uk-position-center-right apk-forme-right">
<img src="/static/img/bgs/formes-deux.png" alt="">
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</main><!-- end #main -->
{% do pimcore_head_link().appendStylesheet(asset('/static/framework/dropify/css/dropify.min.css')) %}
{% do pimcore_head_script().appendFile(asset('/static/framework/heic2any/heic2any.js')) %}
{% do pimcore_head_script().appendFile(asset('/static/framework/dropify/js/dropify.js')) %}
{% endblock %}
{% block inlinescripts %}
{% set recaptchaKeyPublic = pimcore_website_config('recaptchaKeyPublic') %}
<script src="https://www.google.com/recaptcha/api.js?onload=onloadRecaptchaCallback&render={{ recaptchaKeyPublic }}"></script>
<script>
if($('#success').length) {
UIkit.modal($('#success')).show();
console.log('success');
}
function onloadRecaptchaCallback(){
grecaptcha.ready(function() {
grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'concours2023'}).then(function(token) {
//alert('recaptcha is loaded');
var recaptcha = document.getElementById('concours2023_form_recaptcha');
recaptcha.value = token;
});
});
}
setInterval(function () {
grecaptcha.ready(function() {
grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'concours2023'}).then(function(token) {
//alert('recaptcha is loaded');
var recaptcha = document.getElementById('concours2023_form_recaptcha');
recaptcha.value = token;
});
});
}, 110 * 1000);
</script>
{% endblock inlinescripts %}