templates/front/machine/parts.html.twig line 1

Open in your IDE?
  1. {% extends "front/_common/_base.html.twig" %}
  2. {% block linkcanonical %}
  3.     <link rel="canonical" href="{{ absolute_url(path('parts')) }}">
  4.     {% if info.captchaShow %}
  5.     <script type="text/javascript">
  6.         var onloadCallback = function() {
  7.             grecaptcha.render('html_element', {
  8.             'sitekey' : '{{ info.captchaSite }}'
  9.             });
  10.         };
  11.     </script>
  12.     {% endif %}
  13. {% endblock %}
  14. {% block cssadicional %}{% endblock %}
  15. {% block classbody %}{% endblock %}
  16. {% block content %}
  17. <section class="b20">
  18.     <article class="b20_top">
  19.         <div class="wancho">
  20.             <div class="general_breadcrumbs">
  21.                 <ul>
  22.                     <li><a href="{{ path('home') }}">INICIO</a></li>
  23.                     <li><a href="{{ path('about') }}" aria-selected="true">REPUESTOS</a></li>
  24.                 </ul>
  25.             </div>
  26.             <div class="main_title_layout">
  27.                 {% if home.mainPrefix %}
  28.                 <h2>{{ home.mainPrefix }}</h2>
  29.                 {% endif %}
  30.                 {% if home.mainTitle %}
  31.                 <h1 class="general_title">{{ home.mainTitle }}</h1>
  32.                 {% endif %}
  33.             </div>
  34.         </div>
  35.     </article>
  36.     <article class="b20_ctn">
  37.         <div class="share_wrapper">
  38.             <ul>
  39.                 <li><a href="" class="icon-facebook facebook-share-fixed"></a></li>
  40.                 <li><a href="" class="icon-twitter twitter-share-fixed"></a></li>
  41.                 <li>
  42.                     <a
  43.                         href="https://api.whatsapp.com/send?text=FAW - REPUESTOS {{ absolute_url(path('parts')) }}"
  44.                         class="icon-whatsapp"
  45.                         target="_blank"
  46.                         data-action="share/whatsapp/share"
  47.                     ></a>
  48.                 </li>
  49.             </ul>
  50.         </div>
  51.         <div class="b20_fixed_ctn">
  52.             <div class="b20_form repuestos">
  53.                 {% if home.formTitle %}
  54.                 <h6>{{ home.formTitle }}</h6>
  55.                 {% endif %}
  56.                 <p>{{ home.formText }}</p>
  57.                 <div class="general_form">
  58.                       {{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
  59.                         {{ form_widget(form.utmSource, {'attr': {'class': 'form_utmsource'}}) }}
  60.                         {{ form_widget(form.utmMedium, {'attr': {'class': 'form_utmmedium'}}) }}
  61.                         {{ form_widget(form.utmCampaign, {'attr': {'class': 'form_utmcampaign'}}) }}
  62.                         {{ form_widget(form.utmContent, {'attr': {'class': 'form_utmcontent'}}) }}
  63.                         {{ form_widget(form.utmTerm, {'attr': {'class': 'form_utmterm'}}) }}
  64.                         {{ form_widget(form.gclid, {'attr': {'class': 'gclid'}}) }}
  65.                         <div class="fInput">
  66.                             <label for="nombre">Nombres</label>
  67.                              {{ form_widget(form.name, {'attr': {'class':'validate[required, maxSize[50]] validKeypress', 'data-maxChar':'50', 'data-expression':'text'}}) }}
  68.                         </div>
  69.                         <div class="fInput">
  70.                             <label for="apellidos">Apellidos</label>
  71.                              {{ form_widget(form.lastname, {'attr': {'class':'validate[required, maxSize[50]] validKeypress', 'data-maxChar':'50', 'data-expression':'text'}}) }}
  72.                         </div>
  73.                         <div class="fInput">
  74.                             <label for="DNI">DNI*</label>
  75.                              {{ form_widget(form.doc, {'attr': {'class':'validate[required, maxSize[8]] validKeypress', 'data-maxChar':'8', 'data-expression':'number'}}) }}
  76.                         </div>
  77.                         <div class="fInput">
  78.                             <label for="telefono">Teléfono*</label>
  79.                              {{ form_widget(form.phone, {'attr': {'class':'validate[required, maxSize[15]] validKeypress', 'type': 'tel', 'data-maxChar':'15', 'data-expression':'number'}}) }}
  80.                         </div>
  81.                         <div class="fInput">
  82.                             <label for="correo">Correo Electrónico*</label>
  83.                              {{ form_widget(form.email, {'attr': {'class':'validate[required, maxSize[100]] validKeypress', 'type': 'email', 'data-maxChar':'100', 'data-expression':'email'}}) }}
  84.                         </div>
  85.                         <div class="fInput">
  86.                             <label for="placa">Placa*</label>
  87.                              {{ form_widget(form.placa, {'attr': {'class':'validate[required, maxSize[50]] validKeypress', 'data-maxChar':'50'}}) }}
  88.                         </div>
  89.                         <div class="fInput">
  90.                             <label for="modelo">Modelo*</label>
  91.                              {{ form_widget(form.model, {'attr': {'class':'validate[required, maxSize[50]] validKeypress', 'data-maxChar':'50'}}) }}
  92.                         </div>
  93.                         <div class="fInput">
  94.                             <label for="Mensaje">Mensaje</label>
  95.                              {{ form_widget(form.message, {'attr': {'class':'validate[maxSize[255]]', 'data-maxChar' : '255'}}) }}
  96.                         </div>
  97.                         <div class="fCheckBox">
  98.                             <span>*Campos obligatorios</span>
  99.                             <div class="formCheckbox">
  100.                                 <input type="checkbox" id="1" name="check_terminos" class="validate[required]" />
  101.                                 <label for="1"
  102.                                     >He leído y acepto las
  103.                                     <a href="{{ path('privacy') }}" target="_blank">Políticas de privacidad</a></label
  104.                                 >
  105.                             </div>
  106.                         </div>
  107.                         {% if info.captchaShow %}
  108.                         <div style="margin-bottom:10px; position: relative; width: max-content;">
  109.                             <div id="html_element"></div>
  110.                         </div>
  111.                         {% endif %}
  112.                         <div class="formButtonCtn">
  113.                             <button class="f-guardar-contacto-general hidden_button_send" id="btnParts">Enviar</button>
  114.                             <button class="show_button_send">Enviando... <span class="icon-flecha-derecha"></span></button>
  115.                         </div>
  116.                       {{ form_end(form) }}
  117.                 </div>
  118.             </div>
  119.         </div>
  120.         <div class="wancho">
  121.             <div class="b20_info repuestos">
  122.                 <div class="gParrafo">
  123.                     {{ home.mainText|raw }}
  124.                 </div>
  125.                 {% if home.mainBg|image_path %}
  126.                 <img src="{{ asset(home.mainBg|image_path) }}" alt="{{ home.mainBg|image_alt }}" class="b20_img" />
  127.                 {% endif %}
  128.                 {% if home.mainSubtitle %}
  129.                 <h4>{{ home.mainSubtitle }}</h4>
  130.                 {% endif %}
  131.                 <ul class="repuesto_list">
  132.                     {% for item in home.mainItemsActive %}
  133.                     <li class="respuesto_item">
  134.                         <div class="respuesto_item_img">
  135.                             <img src="{{ asset(item.img|image_path) }}" alt="{{ item.img|image_alt }}"/>
  136.                         </div>
  137.                         <div class="repuesto_item_info">
  138.                             <h5>{{ item.title }}</h5>
  139.                             <div class="gParrafo">
  140.                                 <p>
  141.                                     {{ item.texto }}
  142.                                 </p>
  143.                             </div>
  144.                         </div>
  145.                     </li>
  146.                     {% endfor %}
  147.                 </ul>
  148.             </div>
  149.         </div>
  150.     </article>
  151.     {% if home.linksShow and home.linksItemsActive %}
  152.     <article class="b21">
  153.         <div class="wancho">
  154.             {% if  home.linksTitle %}
  155.             <h6>{{ home.linksTitle }}</h6>
  156.             {% endif %}
  157.             <ul class="flex">
  158.                 {% for item in home.linksItemsActive %}
  159.                 <li class="servicio_item {{ loop.first ? 'layout_1' : 'layout_2'}}">
  160.                     {% if item.type == 'wsp' %}
  161.                     {% set link = 'https://api.whatsapp.com/send?phone='~ item.wspNum ~'&text=' ~ item.wspMessage %}
  162.                     {% else %}
  163.                     {% set link = item.link %}
  164.                     {% endif %}
  165.                     
  166.                     <a href="{{ link }}" target="{{ item.target ? 'blank' : '_self' }}">
  167.                         <img src="{{ asset(item.img|image_path) }}" alt="{{ item.img|image_alt }}" />
  168.                         <span>{{ item.title }}</span>
  169.                         {% if item.type == 'wsp' %}
  170.                         <i class="icon-whatsapp1"></i>
  171.                         {% else %}
  172.                             {% if item.target %}
  173.                             <i class="icon-link-enterno"></i>
  174.                             {% else %}
  175.                             <i class="icon-flecha-derecha"></i>
  176.                             {% endif %}
  177.                         {% endif %}
  178.                     </a>
  179.                 </li>
  180.                 {% endfor %}
  181.             </ul>
  182.         </div>
  183.     </article>
  184.     {% endif %}
  185.     
  186.     
  187. </section>
  188. {% endblock %}
  189. {% block jsfinal %}
  190. <script src="{{ STATIC_URL }}js/validationform/jquery.validationEngine.js"></script>
  191. {% include 'front/templates/captcha.html.twig' %}
  192. <script type="text/javascript">
  193.     WidthChange(768, () => {
  194.         document.querySelector('.b20_info').appendChild(document.querySelector('.b20_form'));
  195.     });
  196.     $('form').validationEngine('attach', {
  197.         promptPosition: 'bottomLeft',
  198.         autoHidePrompt: true,
  199.         autoPositionUpdate: false,
  200.         autoHideDelay: 3000,
  201.         addFailureCssClassToField: 'inputError',
  202.         binded: false,
  203.         scroll: false,
  204.         validateNonVisibleFields: true,
  205.         showOneMessage: false,
  206.     });
  207.     $('#btnParts').on('click', function(event) {
  208.         event.preventDefault();
  209.         let btn = $(this);
  210.         let form = btn.closest('form');
  211.         var valid = form.validationEngine('validate');
  212.         btn.prop('disabled', true);
  213.         
  214.         if(valid  && validarRecaptcha()){
  215.             document.querySelector('.general_form').classList.add('submit_form')
  216.             form.submit();
  217.         } else {
  218.             btn.prop('disabled', false);
  219.             return false;
  220.         }
  221.     });
  222.     
  223. </script>
  224. {% endblock %}