src/CoreBundle/Resources/views/Areas/ContactFormBrick/view.html.twig line 1

Open in your IDE?
  1. {% set spacingSelect %}
  2.     {{ pimcore_checkbox("checkSpacing", {
  3.         "reload": true
  4.     }) }}
  5. {% endset %}
  6. {% set noSpacingTop = '' %}
  7. {% set brickAnchorId = '' %}
  8. {% if pimcore_checkbox('checkSpacing').isChecked() %}
  9.     {% set noSpacingTop = 'no-offset-top' %}
  10. {% endif %}
  11. {% set UID = uniqid() %}
  12. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  13.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  14. {% endif %}
  15. {% if editmode %}
  16.     <div class="flex-col offset-bottom-single">
  17.         <div class="col xs-12 m-6 l-3">
  18.             <span class="hint">{{ 'admin.brick.hint.anchorId' |trans }}</span>
  19.             {{ pimcore_input("brickAnchorIdInput") }}
  20.         </div>
  21.     </div>
  22.     <div class="flex-col offset-bottom-single">
  23.         <div class="col xs-12">
  24.             <span class="hint">{{ 'admin.brick.hint.eMailTemplateSettings' |trans }}</span>
  25.         </div>
  26.         <div class="xs-12">
  27.             <div class="input-space flex-col">
  28.                 {% for key, value in constant('CoreBundle\\Document\\Areabrick\\ContactFormBrick::TOPIC_CHOICES') %}
  29.                     <div class="col xs-12 m-6 offset-bottom-single">
  30.                         <span class="hint">{{ key }}</span>
  31.                         {{ pimcore_href("mailTemplate"~value|capitalize) }}
  32.                     </div>
  33.                 {% endfor %}
  34.             </div>
  35.         </div>
  36.         <div class="col xs-12 m-6">
  37.             <span class="hint">{{ 'admin.brick.hint.addProductList' |trans }}</span>
  38.             <div class="input-space">
  39.                 <span class="hint">{{ 'admin.brick.hint.addProductListCommaSeparated' |trans }}</span>
  40.                 {{ pimcore_textarea("productList") }}
  41.             </div>
  42.         </div>
  43.     </div>
  44. {% endif %}
  45. <div id="{{ brickAnchorId }}" class="section" data-maxFileUploadSize="{{ maxFileUploadSize }}" data-postMaxSize="{{ postMaxSize }}">
  46.     <div class="main-content flex-col">
  47.         <div class="col xs-12">
  48.             {% if(errors is defined and errors|length > 0) %}
  49.                 <div class="alert">
  50.                     <div class="alert-danger">
  51.                         <h4>{{ 'Error' | trans }}</h4>
  52.                     </div>
  53.                 </div>
  54.             {% endif %}
  55.             {% if(success is defined) %}
  56.                 <div class="alert">
  57.                     <div class="alert-success">
  58.                         {{ message | trans }}
  59.                     </div>
  60.                 </div>
  61.             {% endif %}
  62.             <div class="contact-confirm-wrapper">
  63.                 {% if editmode %}
  64.                     <span class="hint">{{ 'admin.brick.hint.contactFormText' |trans }}</span>
  65.                 {% else %}
  66.                     <p>{{ pimcore_input("ContactFormText") }}</p>
  67.                     {{ form_start(form) }}
  68.                     <div class="form-field">
  69.                         {{ form_label(form.gender) }}
  70.                         {{ form_widget(form.gender) }}
  71.                     </div>
  72.                     <div class="form-field">
  73.                         {{ form_label(form.title) }}
  74.                         {{ form_widget(form.title) }}
  75.                     </div>
  76.                     <div class="form-field">
  77.                         {{ form_label(form.firstname) }}
  78.                         {{ form_widget(form.firstname) }}
  79.                     </div>
  80.                     <div class="form-field">
  81.                         {{ form_label(form.lastname) }}
  82.                         {{ form_widget(form.lastname) }}
  83.                     </div>
  84.                     <div class="form-field">
  85.                         {{ form_label(form.street) }}
  86.                         {{ form_widget(form.street) }}
  87.                     </div>
  88.                     <div class="form-field">
  89.                         {{ form_label(form.plz) }}
  90.                         {{ form_widget(form.plz) }}
  91.                     </div>
  92.                     <div class="form-field">
  93.                         {{ form_label(form.city) }}
  94.                         {{ form_widget(form.city) }}
  95.                     </div>
  96.                     <div class="form-field">
  97.                         {{ form_label(form.phone) }}
  98.                         {{ form_widget(form.phone) }}
  99.                     </div>
  100.                     <div class="form-field">
  101.                         {{ form_label(form.email) }}
  102.                         {{ form_widget(form.email) }}
  103.                     </div>
  104.                     <div class="form-field">
  105.                         {{ form_label(form.topic) }}
  106.                         {{ form_widget(form.topic) }}
  107.                     </div>
  108.                     <div class="form-field">
  109.                         {{ form_label(form.message) }}
  110.                         {{ form_widget(form.message) }}
  111.                     </div>
  112.                     <div class="form-field">
  113.                         {{ form_widget(form.code) }}
  114.                     </div>
  115.                     {% if form.orderNumber is defined %}
  116.                         <div class="form-field">
  117.                             {{ form_label(form.orderNumber) }}
  118.                             {{ form_widget(form.orderNumber) }}
  119.                         </div>
  120.                     {% endif %}
  121.                     {% if form.customerNumber is defined %}
  122.                         <div class="form-field">
  123.                             {{ form_label(form.customerNumber) }}
  124.                             {{ form_widget(form.customerNumber) }}
  125.                         </div>
  126.                     {% endif %}
  127.                     {% if form.retoure is defined %}
  128.                         <div class="form-field">
  129.                             {{ form_label(form.retoure) }}
  130.                             {{ form_widget(form.retoure) }}
  131.                         </div>
  132.                     {% endif %}
  133.                     {% if form.produktreklamation is defined %}
  134.                         <div class="form-field">
  135.                             {{ form_label(form.produktreklamation) }}
  136.                             {{ form_widget(form.produktreklamation) }}
  137.                         </div>
  138.                     {% endif %}
  139.                     {% if form.lot_number is defined %}
  140.                         <div class="form-field">
  141.                             {{ form_label(form.lot_number) }}
  142.                             {{ form_widget(form.lot_number) }}
  143.                         </div>
  144.                     {% endif %}
  145.                     {% if form.bestBeforeDate is defined %}
  146.                         <div class="form-field">
  147.                             {{ form_label(form.bestBeforeDate) }}
  148.                             {{ form_widget(form.bestBeforeDate) }}
  149.                         </div>
  150.                     {% endif %}
  151.                     {% if form.purchased is defined %}
  152.                         <div class="form-field">
  153.                             {{ form_label(form.purchased) }}
  154.                             {{ form_widget(form.purchased) }}
  155.                         </div>
  156.                     {% endif %}
  157.                     {% if form.available is defined %}
  158.                         <div class="form-field">
  159.                             {{ form_widget(form.available) }}
  160.                             {{ form_label(form.available) }}
  161.                         </div>
  162.                     {% endif %}
  163.                     {% if form.product is defined %}
  164.                         <div class="form-field">
  165.                             {{ form_label(form.product) }}
  166.                             {{ form_widget(form.product) }}
  167.                         </div>
  168.                     {% endif %}
  169.                     {% if form.upload is defined %}
  170.                         <div class="form-field">
  171.                             {{ form_label(form.upload) }}
  172.                             {{ form_widget(form.upload) }}
  173.                         </div>
  174.                         {% if ((fileUploadError is defined and fileUploadError == true) or (fileSizeExceededError is defined and fileSizeExceededError == true)) %}
  175.                             <div class="alert">
  176.                                 <div class="alert-danger">
  177.                                     <strong>{{ 'error.maxFileSizeExceeded' | trans }} (max. {{ maxMByte }}MByte)</strong>
  178.                                 </div>
  179.                             </div>
  180.                         {% endif %}
  181.                     {% endif %}
  182.                     <div>
  183.                         {{ form_widget(form.confirm) }}
  184.                         <label for="confirm"
  185.                                class="required"><span>{{ (document.module ~  ".areabrick.contactform.datapolicyconfirmation.part1") |trans }}
  186.                                 <a href="{{ (document.module ~  ".areabrick.contactform.datapolicyconfirmation.link") |trans }}">{{ (document.module ~  ".areabrick.contactform.datapolicyconfirmation.linktext") |trans }}</a>
  187.                                 {{ (document.module ~  ".areabrick.contactform.datapolicyconfirmation.part2") |trans }}
  188.                             </span>
  189.                         </label>
  190.                     </div>
  191.                     {% if form.captcha is defined %}
  192.                         <div id="Captcha" class="form-field">
  193.                             <div class="captcha">
  194.                                 <div class="captcha-label">
  195.                                     {{ form_label(form.captcha) }}
  196.                                 </div>
  197.                                 <div class="captcha-field">
  198.                                     <div class="captcha-error">
  199.                                         {{ form_errors(form.captcha) }}
  200.                                     </div>
  201.                                     <div class="captcha-image">
  202.                                         {{ form_widget(form.captcha) }}
  203.                                     </div>
  204.                                 </div>
  205.                             </div>
  206.                         </div>
  207.                     {% endif %}
  208.                     {{ form_row(form.submit, { 'label': 'submit' |trans }) }}
  209.                     {{ form_end(form) }}
  210.                 {% endif %}
  211.             </div>
  212.         </div>
  213.         {% verbatim %}
  214.         <script>
  215.         window.addEventListener("load", function(event) {
  216.         {% endverbatim %}
  217.         {% if jump_to_form == true %}
  218.             {% verbatim %}
  219.             $(document).ready(function () {
  220.             $('html, body').animate({
  221.             scrollTop: $("#Captcha").offset().top-200
  222.             }, 300);
  223.             });
  224.             {% endverbatim %}
  225.         {% endif %}
  226.         {% verbatim %}
  227.             $(document).on('change', '#topic', function(){
  228.                 var offset = $("#topic").offset().top-200;
  229.                 var data = $('form').serialize();
  230.                 $.post({
  231.                 url: window.location.protocol + "//" + window.location.host + window.location.pathname + "?topic=changed",
  232.                 type: "POST",
  233.                 data: data,
  234.                 dataType: 'HTML',
  235.                     success:function(data) {
  236.                         var newDoc = document.open("text/html", "replace");
  237.                         newDoc.write(data);
  238.                         newDoc.close();
  239.                         $('html, body').animate({
  240.                             scrollTop: offset
  241.                         }, 300);
  242.                     }
  243.                 });
  244.             });
  245.         });
  246.         </script>
  247.         {% endverbatim %}
  248.     </div>
  249. </div>