{% extends "layout.html.twig" %}
{#
{% use AppBundle/Helper/Apik %}
#}
{% block content %}
{{ pimcore_areablock("myAreablock") }}
{{ pimcore_areablock('contentTop') }}
<!-- #main -->
<main id="main" role="main">
{% if editmode %}
<div class="editmode-img">
<div class="uk-margin-xlarge-top">
{{ pimcore_image("facebook-image") }}
{{ pimcore_image("instagram-image") }}
</div>
{{ pimcore_image('reseaux-forme') }}
</br>
<div>Type de heading pour le titre ?</div>
{{ pimcore_select("content-heading", {
"store" : [
['span', 'span'],
['h1', 'Heading 1'],
['h2', 'Heading 2'],
['h3', 'Heading 3'],
['h4', 'Heading 4'],
['h5', 'Heading 5'],
['h6', 'Heading 6']
],
"defaultValue" : "h2"
}) }}
<div><strong>Style</strong> du heading pour le titre ?</div>
{{ pimcore_select("content-heading-style", {
"store" : [
['h1', 'Heading 1'],
['h2', 'Heading 2'],
['h3', 'Heading 3'],
['h4', 'Heading 4'],
['h5', 'Heading 5'],
['h6', 'Heading 6']
],
"defaultValue" : "h2"
}) }}
<h2 class="">{{ pimcore_textarea('content-title', {'nl2br' : true}) }}</h2>
<div>Type de heading pour le sous-titre ?</div>
{{ pimcore_select("subtitle-heading", {
"store" : [
['span', 'span'],
['h1', 'Heading 1'],
['h2', 'Heading 2'],
['h3', 'Heading 3'],
['h4', 'Heading 4'],
['h5', 'Heading 5'],
['h6', 'Heading 6']
],
"defaultValue" : "h2"
}) }}
<div><strong>Style</strong> du heading pour le sous-titre ?</div>
{{ pimcore_select("subtitle-style", {
"store" : [
['h1', 'Heading 1'],
['h2', 'Heading 2'],
['h3', 'Heading 3'],
['h4', 'Heading 4'],
['h5', 'Heading 5'],
['h6', 'Heading 6']
],
"defaultValue" : "h2"
}) }}
<h2 class="">{{ pimcore_textarea('content-subtitle', {'nl2br' : true}) }}</h2>
{{ pimcore_image("forme-image") }}
<div>
{{ pimcore_textarea("content") }}
{{ pimcore_image("logo-image") }}
</div>
{{ pimcore_link("link-logo") }}
{{ pimcore_image("logo-right") }}
</div>
{{ pimcore_image('background-image') }}
{% else %}
<div class="div-fond-concours" uk-height-match="target: changed">
<div class="div-fond-concours-cropped uk-cover-container apk-height-match" >
{{ pimcore_image('background-image').thumbnail('concours-thumb').html({'imgAttributes' : {'uk-cover' : null}})|raw }}
</div>
<div class="div-fond-blanc" uk-grid>
<div class="uk-width-1-3@m apk-height-match">
<div class="div-text-concours">
<div class="polygone uk-visible@m">
{{ pimcore_image('reseaux-forme') }}
<div class="reseaux uk-flex">
{% if document.property('facebookUrl') %}
<a href="{{ document.property('facebookUrl') }}" target="_blank"><img
src="{{ pimcore_image('facebook-image').thumbnail('reseaux') }}"></a>
{% endif %}
{% if document.property('instagramUrl') %}
<a href="{{ document.property('instagramUrl') }}" target="_blank"><img
src="{{ pimcore_image('instagram-image').thumbnail('reseaux') }}"></a>
{% endif %}
</div>
</div>
<div class="uk-margin-xlarge-top">
{% if not pimcore_textarea("content-title").isEmpty %}
{% if pimcore_select("content-heading").data == "span" %}
<span class="uk-{{ pimcore_select("content-heading-style").getData() }}">{{ pimcore_textarea('content-title', {'nl2br' : true}) }}</span>
{% else %}
{% set content_heading = pimcore_select("content-heading").getData() %}
<{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}
">
{{ pimcore_textarea("content-title", {
"nl2br" : true})|raw }}
</{{ content_heading }}>
{% endif %}
{% endif %}
</div>
<p class="content-textarea-concours">{{ pimcore_textarea("content") }}</p>
<div class="forme-concours">{{ pimcore_image("forme-image") }}</div>
</div>
</div>
<div class="uk-width-1-3@m div-form">
<div>
<div class="uk-text-center">
{{ pimcore_image("logo-image", {"thumbnail": "logo-concours-thumb"}) }}
</div>
{% if not pimcore_textarea("content-subtitle").isEmpty %}
{% if pimcore_select("subtitle-heading").data == "span" %}
<span class="uk-{{ pimcore_select("subtitle-style").getData() }}">{{ pimcore_textarea('content-subtitle', {'nl2br' : true}) }}</span>
{% else %}
{% set content_heading = pimcore_select("subtitle-heading").getData() %}
<{{ content_heading }} class="uk-{{ pimcore_select("subtitle-style").getData() }}">
{{ pimcore_textarea("content-subtitle", {"nl2br" : true})|raw }}
</{{ content_heading }}>
{% endif %}
{% endif %}
{% 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 %}
{% if formStatus != 'success' %}
{{ form_start(form,{'attr': {'id': 'contact-form', 'enctype' : 'multipart/form-data'}}) }}
<div class="uk-grid-small form-concours-grid" uk-grid>
<div class="uk-width-1-1">
<label class="uk-form-label required apk-label-is-linked-to-field"
for="form-stacked-text"> {{ form_label(form.choixmultiple) }} </label>
{{ form_widget(form.choixmultiple) }}
</div>
<div class="uk-width-1-1">
<label class="uk-form-label"
for="form-stacked-text"> {{ form_label(form.message) }} </label>
{{ form_widget(form.message) }}
</div>
<div class="uk-width-1-2">
<label class="uk-form-label"
for="form-stacked-text"> {{ form_label(form.lastname) }} </label>
{{ form_widget(form.lastname) }}
</div>
<div class="uk-width-1-2">
<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>
{{ form_widget(form.gdpr) }}
<label for="contact_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">
{{ form_widget(form.reglement) }}
<label for="contact_form_reglement" id="accept-reglement" class="uk-padding-remove">
{{ "J’accepte le règlement de ce concours"|trans }}
<a href="#modal-reglement" 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>
{{ form_end(form) }}
{% endif %}
</div>
</div>
<div class="uk-width-1-3@m">
{{ get_language_switcher_html(document, 'dropdown', 'code')|raw }}
<div class="logo-right">
<a href="{{ pimcore_link("link-logo").href }}" target="_blank"><img
src="{{ pimcore_image('logo-right').thumbnail('') }}"></a>
</div>
</div>
{% endif %}
{% if editmode %}
<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" 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>
{% endif %}
<div class="area-concours">{{ pimcore_areablock('contentBottom') }}</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>
function onloadRecaptchaCallback(){
grecaptcha.ready(function() {
grecaptcha.execute('{{ recaptchaKeyPublic }}', {action: 'contact'}).then(function(token) {
//alert('recaptcha is loaded');
var recaptcha = document.getElementById('contact_form_recaptcha');
recaptcha.value = token;
});
});
}
</script>
{% endblock inlinescripts %}