{% set spacingSelect %}
{{ pimcore_checkbox("checkSpacing", {
"reload": true
}) }}
{% endset %}
{% set noSpacingTop = '' %}
{% set brickAnchorId = '' %}
{% if pimcore_checkbox('checkSpacing').isChecked() %}
{% set noSpacingTop = 'no-offset-top' %}
{% endif %}
{% set UID = uniqid() %}
{% if pimcore_input("brickAnchorIdInput") is not empty %}
{% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
{% endif %}
{% if editmode %}
<div class="flex-col offset-bottom-single">
<div class="col xs-12 m-6 l-3">
<span class="hint">{{ 'admin.brick.hint.anchorId' |trans }}</span>
{{ pimcore_input("brickAnchorIdInput") }}
</div>
</div>
<div class="flex-col offset-bottom-single">
<div class="col xs-12">
<span class="hint">{{ 'admin.brick.hint.eMailTemplateSettings' |trans }}</span>
</div>
<div class="xs-12">
<div class="input-space flex-col">
{% for key, value in constant('CoreBundle\\Document\\Areabrick\\ContactFormBrick::TOPIC_CHOICES') %}
<div class="col xs-12 m-6 offset-bottom-single">
<span class="hint">{{ key }}</span>
{{ pimcore_href("mailTemplate"~value|capitalize) }}
</div>
{% endfor %}
</div>
</div>
<div class="col xs-12 m-6">
<span class="hint">{{ 'admin.brick.hint.addProductList' |trans }}</span>
<div class="input-space">
<span class="hint">{{ 'admin.brick.hint.addProductListCommaSeparated' |trans }}</span>
{{ pimcore_textarea("productList") }}
</div>
</div>
</div>
{% endif %}
<div id="{{ brickAnchorId }}" class="section" data-maxFileUploadSize="{{ maxFileUploadSize }}" data-postMaxSize="{{ postMaxSize }}">
<div class="main-content flex-col">
<div class="col xs-12">
{% if(errors is defined and errors|length > 0) %}
<div class="alert">
<div class="alert-danger">
<h4>{{ 'Error' | trans }}</h4>
</div>
</div>
{% endif %}
{% if(success is defined) %}
<div class="alert">
<div class="alert-success">
{{ message | trans }}
</div>
</div>
{% endif %}
<div class="contact-confirm-wrapper">
{% if editmode %}
<span class="hint">{{ 'admin.brick.hint.contactFormText' |trans }}</span>
{% else %}
<p>{{ pimcore_input("ContactFormText") }}</p>
{{ form_start(form) }}
<div class="form-field">
{{ form_label(form.gender) }}
{{ form_widget(form.gender) }}
</div>
<div class="form-field">
{{ form_label(form.title) }}
{{ form_widget(form.title) }}
</div>
<div class="form-field">
{{ form_label(form.firstname) }}
{{ form_widget(form.firstname) }}
</div>
<div class="form-field">
{{ form_label(form.lastname) }}
{{ form_widget(form.lastname) }}
</div>
<div class="form-field">
{{ form_label(form.street) }}
{{ form_widget(form.street) }}
</div>
<div class="form-field">
{{ form_label(form.plz) }}
{{ form_widget(form.plz) }}
</div>
<div class="form-field">
{{ form_label(form.city) }}
{{ form_widget(form.city) }}
</div>
<div class="form-field">
{{ form_label(form.phone) }}
{{ form_widget(form.phone) }}
</div>
<div class="form-field">
{{ form_label(form.email) }}
{{ form_widget(form.email) }}
</div>
<div class="form-field">
{{ form_label(form.topic) }}
{{ form_widget(form.topic) }}
</div>
<div class="form-field">
{{ form_label(form.message) }}
{{ form_widget(form.message) }}
</div>
<div class="form-field">
{{ form_widget(form.code) }}
</div>
{% if form.orderNumber is defined %}
<div class="form-field">
{{ form_label(form.orderNumber) }}
{{ form_widget(form.orderNumber) }}
</div>
{% endif %}
{% if form.customerNumber is defined %}
<div class="form-field">
{{ form_label(form.customerNumber) }}
{{ form_widget(form.customerNumber) }}
</div>
{% endif %}
{% if form.retoure is defined %}
<div class="form-field">
{{ form_label(form.retoure) }}
{{ form_widget(form.retoure) }}
</div>
{% endif %}
{% if form.produktreklamation is defined %}
<div class="form-field">
{{ form_label(form.produktreklamation) }}
{{ form_widget(form.produktreklamation) }}
</div>
{% endif %}
{% if form.lot_number is defined %}
<div class="form-field">
{{ form_label(form.lot_number) }}
{{ form_widget(form.lot_number) }}
</div>
{% endif %}
{% if form.bestBeforeDate is defined %}
<div class="form-field">
{{ form_label(form.bestBeforeDate) }}
{{ form_widget(form.bestBeforeDate) }}
</div>
{% endif %}
{% if form.purchased is defined %}
<div class="form-field">
{{ form_label(form.purchased) }}
{{ form_widget(form.purchased) }}
</div>
{% endif %}
{% if form.available is defined %}
<div class="form-field">
{{ form_widget(form.available) }}
{{ form_label(form.available) }}
</div>
{% endif %}
{% if form.product is defined %}
<div class="form-field">
{{ form_label(form.product) }}
{{ form_widget(form.product) }}
</div>
{% endif %}
{% if form.upload is defined %}
<div class="form-field">
{{ form_label(form.upload) }}
{{ form_widget(form.upload) }}
</div>
{% if ((fileUploadError is defined and fileUploadError == true) or (fileSizeExceededError is defined and fileSizeExceededError == true)) %}
<div class="alert">
<div class="alert-danger">
<strong>{{ 'error.maxFileSizeExceeded' | trans }} (max. {{ maxMByte }}MByte)</strong>
</div>
</div>
{% endif %}
{% endif %}
<div>
{{ form_widget(form.confirm) }}
<label for="confirm"
class="required"><span>{{ (document.module ~ ".areabrick.contactform.datapolicyconfirmation.part1") |trans }}
<a href="{{ (document.module ~ ".areabrick.contactform.datapolicyconfirmation.link") |trans }}">{{ (document.module ~ ".areabrick.contactform.datapolicyconfirmation.linktext") |trans }}</a>
{{ (document.module ~ ".areabrick.contactform.datapolicyconfirmation.part2") |trans }}
</span>
</label>
</div>
{% if form.captcha is defined %}
<div id="Captcha" class="form-field">
<div class="captcha">
<div class="captcha-label">
{{ form_label(form.captcha) }}
</div>
<div class="captcha-field">
<div class="captcha-error">
{{ form_errors(form.captcha) }}
</div>
<div class="captcha-image">
{{ form_widget(form.captcha) }}
</div>
</div>
</div>
</div>
{% endif %}
{{ form_row(form.submit, { 'label': 'submit' |trans }) }}
{{ form_end(form) }}
{% endif %}
</div>
</div>
{% verbatim %}
<script>
window.addEventListener("load", function(event) {
{% endverbatim %}
{% if jump_to_form == true %}
{% verbatim %}
$(document).ready(function () {
$('html, body').animate({
scrollTop: $("#Captcha").offset().top-200
}, 300);
});
{% endverbatim %}
{% endif %}
{% verbatim %}
$(document).on('change', '#topic', function(){
var offset = $("#topic").offset().top-200;
var data = $('form').serialize();
$.post({
url: window.location.protocol + "//" + window.location.host + window.location.pathname + "?topic=changed",
type: "POST",
data: data,
dataType: 'HTML',
success:function(data) {
var newDoc = document.open("text/html", "replace");
newDoc.write(data);
newDoc.close();
$('html, body').animate({
scrollTop: offset
}, 300);
}
});
});
});
</script>
{% endverbatim %}
</div>
</div>