custom/plugins/NetiNextStoreLocator/src/Resources/views/storefront/store_locator/contact-form.twig line 1

Open in your IDE?
  1. {% block neti_store_locator_contact %}
  2.     <div class="modal contact-form fade" tabindex="-1" role="dialog" aria-hidden="true">
  3.         <div class="modal-dialog modal-dialog-centered" role="document">
  4.             <div class="modal-content" v-if="store">
  5.                 <form
  6.                         action="{{ path('frontend.store_locator.contact') }}"
  7.                         id="neti-store-locator-contact-form"
  8.                         novalidate
  9.                         data-form-csrf-handler="true"
  10.                         ref="form"
  11.                         @submit.prevent="onSubmit"
  12.                         :class="{ 'was-validated': wasValidated }"
  13.                 >
  14.                     <input type="hidden" name="storeId" v-model="store.id" />
  15.                     {{ sw_csrf('frontend.store_locator.contact') }}
  16.                     {% block neti_store_locator_contact_header %}
  17.                         <div class="modal-header">
  18.                             <h5 class="modal-title">
  19.                                 {{ "neti-next-store-locator.index.contact.title"|trans }}
  20.                             </h5>
  21.                             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  22.                                 <span aria-hidden="true">&times;</span>
  23.                             </button>
  24.                         </div>
  25.                     {% endblock %}
  26.                     {% block neti_store_locator_contact_body %}
  27.                         <div class="modal-body">
  28.                             {% block neti_store_locator_contact_body_success_alert %}
  29.                                 <template v-if="isSuccess">
  30.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  31.                                         type: "success",
  32.                                         content: "neti-next-store-locator.index.contact.successText"|trans
  33.                                     } %}
  34.                                 </template>
  35.                             {% endblock %}
  36.                             {% block neti_store_locator_contact_body_error_alert %}
  37.                                 <template v-if="isError">
  38.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with {
  39.                                         type: "danger",
  40.                                         content: "neti-next-store-locator.index.contact.errorText"|trans
  41.                                     } %}
  42.                                 </template>
  43.                             {% endblock %}
  44.                             {% block neti_store_locator_contact_form %}
  45.                                 {% for key, field in page.contactFormFields %}
  46.                                     {% if field.type == 'textfield' %}
  47.                                         <div class="form-group">
  48.                                             <label for="{{ field.id }}">
  49.                                                 {{ field.translated.label }}
  50.                                             </label>
  51.                                             <input
  52.                                                     type="text"
  53.                                                     class="form-control"
  54.                                                     id="{{ field.id }}"
  55.                                                     name="{{ field.id }}"
  56.                                                     {% if field.required %}required{% endif %}
  57.                                                     data-field="{{ field.id }}"
  58.                                             />
  59.                                         </div>
  60.                                     {% elseif field.type == 'textarea' %}
  61.                                         <div class="form-group">
  62.                                             <label for="{{ field.id }}">
  63.                                                 {{ field.translated.label }}
  64.                                             </label>
  65.                                             <textarea
  66.                                                     class="form-control"
  67.                                                     id="{{ field.id }}"
  68.                                                     name="{{ field.id }}"
  69.                                                     {% if field.required %}required{% endif %}
  70.                                                 data-field="{{ field.id }}"
  71.                                             ></textarea>
  72.                                         </div>
  73.                                     {% elseif field.type == 'checkbox' %}
  74.                                         <div class="custom-control custom-checkbox">
  75.                                             <input
  76.                                                     class="custom-control-input"
  77.                                                     type="checkbox"
  78.                                                     value=""
  79.                                                     id="{{ field.id }}"
  80.                                                     name="{{ field.id }}"
  81.                                                     data-field="{{ field.id }}"
  82.                                             >
  83.                                             <label class="custom-control-label" for="{{ field.id }}">
  84.                                                 {{ field.translated.label }}
  85.                                             </label>
  86.                                         </div>
  87.                                     {% elseif field.type == 'radio' %}
  88.                                         <label>
  89.                                             {{ field.translated.label }}
  90.                                         </label>
  91.                                         {% for key, value in field.translated.value|split(';') %}
  92.                                             <div class="custom-control custom-radio">
  93.                                                 <input
  94.                                                         type="radio"
  95.                                                         id="{{ field.id ~ key }}"
  96.                                                         name="{{ field.id }}"
  97.                                                         class="custom-control-input"
  98.                                                         {% if field.required %}required{% endif %}
  99.                                                         data-field="{{ field.id }}"
  100.                                                         value="{{ value }}"
  101.                                                 >
  102.                                                 <label class="custom-control-label" for="{{ field.id ~ key }}">
  103.                                                     {{ value }}
  104.                                                 </label>
  105.                                             </div>
  106.                                         {% endfor %}
  107.                                     {% elseif field.type == 'select' %}
  108.                                         <div class="form-group">
  109.                                             <label for="{{ field.id }}">
  110.                                                 {{ field.translated.label }}
  111.                                             </label>
  112.                                             <select
  113.                                                     class="custom-select"
  114.                                                     id="{{ field.id }}"
  115.                                                     name="{{ field.id }}"
  116.                                                     {% if field.required %}required{% endif %}
  117.                                                     data-field="{{ field.id }}"
  118.                                             >
  119.                                                 <option selected disabled>
  120.                                                     {{ "neti-next-store-locator.index.contact.selectPlaceholder"|trans }}
  121.                                                 </option>
  122.                                                 {% for value in field.translated.value|split(';') %}
  123.                                                     <option value="{{ value }}">{{ value }}</option>
  124.                                                 {% endfor %}
  125.                                             </select>
  126.                                         </div>
  127.                                     {% elseif field.type == 'subject' %}
  128.                                         <div class="form-group">
  129.                                             <label for="{{ field.id }}">
  130.                                                 {{ field.translated.label }}
  131.                                             </label>
  132.                                             {% if page.contactSubjectOptions %}
  133.                                                 <select
  134.                                                         class="custom-select"
  135.                                                         id="{{ field.id }}"
  136.                                                         name="{{ field.id }}"
  137.                                                         {% if field.required %}required{% endif %}
  138.                                                         data-field="{{ field.id }}"
  139.                                                 >
  140.                                                     <option selected disabled>
  141.                                                         {{ "neti-next-store-locator.index.contact.selectPlaceholder"|trans }}
  142.                                                     </option>
  143.                                                     {% for value in page.contactSubjectOptions %}
  144.                                                         <option value="{{ value }}">{{ value }}</option>
  145.                                                     {% endfor %}
  146.                                                 </select>
  147.                                             {% else %}
  148.                                                 <input
  149.                                                         type="text"
  150.                                                         class="form-control"
  151.                                                         id="{{ field.id }}"
  152.                                                         name="{{ field.id }}"
  153.                                                         {% if field.required %}required{% endif %}
  154.                                                         data-field="{{ field.id }}"
  155.                                                 />
  156.                                             {% endif %}
  157.                                         </div>
  158.                                     {% elseif field.type == 'email' %}
  159.                                         <div class="form-group">
  160.                                             <label for="{{ field.id }}">
  161.                                                 {{ field.translated.label }}
  162.                                             </label>
  163.                                             <input
  164.                                                     type="email"
  165.                                                     class="form-control"
  166.                                                     id="{{ field.id }}"
  167.                                                     name="{{ field.id }}"
  168.                                                     {% if field.required %}required{% endif %}
  169.                                                     data-field="{{ field.id }}"
  170.                                             />
  171.                                         </div>
  172.                                     {% elseif field.type == 'email_copy' %}
  173.                                         <div class="custom-control custom-checkbox">
  174.                                             <input
  175.                                                     class="custom-control-input"
  176.                                                     type="checkbox"
  177.                                                     value=""
  178.                                                     id="{{ field.id }}"
  179.                                                     name="{{ field.id }}"
  180.                                                     data-field="{{ field.id }}"
  181.                                             >
  182.                                             <label class="custom-control-label" for="{{ field.id }}">
  183.                                                 {{ "neti-next-store-locator.index.contact.emailCopyLabel"|trans }}
  184.                                             </label>
  185.                                         </div>
  186.                                     {% elseif field.type == 'file_upload' %}
  187.                                         <div class="form-group">
  188.                                             <label for="{{ field.id }}">
  189.                                                 {{ field.translated.label }}
  190.                                             </label>
  191.                                             <input
  192.                                                     type="file"
  193.                                                     class="form-control"
  194.                                                     id="{{ field.id }}"
  195.                                                     name="{{ field.id }}"
  196.                                                     {% if field.required %}required{% endif %}
  197.                                                     data-field="{{ field.id }}"
  198.                                                     data-allowed-types="{{ field.value }}"
  199.                                                     ref="fileUpload_{{ field.id }}"
  200.                                             />
  201.                                             <span v-if="invalidUploadFields['{{ field.id }}']" class="invalid-file-type-error">
  202.                                                 {{ "neti-next-store-locator.index.contact.invalidFileTypeError"|trans }}{{ field.value }}
  203.                                             </span>
  204.                                         </div>
  205.                                     {% else %}
  206.                                         {{ field.type }}
  207.                                     {% endif %}
  208.                                 {% endfor %}
  209.                             {% endblock %}
  210.                             {% block neti_store_locator_contact_privacy %}
  211.                                 {% set neti_privacy_content %}
  212.                                     {% sw_include '@Storefront/storefront/component/privacy-notice.html.twig' %}
  213.                                 {% endset %}
  214.                                 {{ neti_privacy_content|replace({'data-url': 'data-neti-url'})|raw }}
  215.                             {% endblock %}
  216.                         </div>
  217.                     {% endblock %}
  218.                     {% block neti_store_locator_contact_footer %}
  219.                         <div class="modal-footer">
  220.                             <button class="btn btn-secondary" data-dismiss="modal" type="reset" v-if="!isLoading">
  221.                                 {{ "neti-next-store-locator.index.contact.buttonAbort"|trans }}
  222.                             </button>
  223.                             <button
  224.                                     class="btn btn-primary" type="submit" v-if="!isLoading"
  225.                             >
  226.                                 {{ "neti-next-store-locator.index.contact.buttonSubmit"|trans }}
  227.                             </button>
  228.                             <div class="spinner-border spinner" role="status" v-if="isLoading">
  229.                                 <span class="sr-only">
  230.                                     {{ "neti-next-store-locator.index.contact.loadingText"|trans }}
  231.                                 </span>
  232.                             </div>
  233.                         </div>
  234.                     {% endblock %}
  235.                 </form>
  236.             </div>
  237.         </div>
  238.     </div>
  239. {% endblock %}