templates/front/theme1/form/contact_form.html.twig line 1

Open in your IDE?
  1. {% import "front/"~ app.request.server.get('APP_THEME') ~"/form/macro_form.html.twig" as forms %}
  2. {{ render(controller('App\\Controller\\Front\\FunctionController::renderContacts')) }}
  3. <section class="contact_form text-center">
  4. <div class="container-fluid wrapper">
  5.             {% if bloc.form %}
  6.                 {% if bloc.form.titre != '' or bloc.form.texte != '' %}
  7.                 <div class="titre-content-contact">
  8.                     {% if bloc.form.titre != '' %}
  9.                     <h2>{{bloc.form.titre}}</h2>
  10.                     {% endif %}
  11.                     {% if bloc.form.texte != '' %}
  12.                     <div class="texte-in-contact">{{bloc.form.texte|raw}}</div>
  13.                     {% endif %}
  14.                 </div>   
  15.                 {% endif %}
  16.             {% endif %}
  17.     {% set espace_client = 1 %} 
  18.     {% if not espace_client and parametreProduits() and parametreProduits().actifpanier and app.session.get('panier') %}
  19.         {{ render(controller('App\\Controller\\Front\\CartController::panierContact', {'panier': app.session.get('panier')})) }}
  20.     {% endif %}
  21.     <div class="row justify-content-center">  
  22.         {% if bloc.form %}
  23.         <div class="col-md-8">
  24.             <form id="form-{{bloc.form.id}}" action="{{path('save_form')}}" method="post" class="needs-validation row  form-recap {{bloc.form.identifier}}" enctype="multipart/form-data" novalidate>
  25.                 {% for message in app.flashes('success-form-' ~ bloc.form.id) %}
  26.                     <div class="alert alert-success alert-form mx-auto">
  27.                         {{ message|raw }}
  28.                     </div>
  29.                 {% endfor %}
  30.                 {% for message in app.flashes('error-form-' ~ bloc.form.id) %}
  31.                     <div class="alert alert-danger alert-form mx-auto">
  32.                         {{ message|raw }}
  33.                     </div>
  34.                 {% endfor %}
  35.                 {% if product_interesse is defined and product_interesse is not empty %}
  36.                       <h2>Je suis intéressé par : {{product_interesse.titre}}</h2>
  37.                       <input type="hidden" value="{{product_interesse.id}}" name="id_product">
  38.                 {% endif %}
  39.                 
  40.                 
  41.                 {% set message = 'validation_form'|trans([],'variable') %}
  42.                 <input type="hidden" value="{{bloc.form.id}}" name="IdForm">
  43.                 
  44.                 <div class="contact-border">
  45.                     <div class="icon-header"></div>
  46.                     <div class="row">
  47.                         {% for item in bloc.form.data %}
  48.                             {% set label = item.label|default(null)%}
  49.                             {% set placeholder = item.placeholder|default(null) %}
  50.                             {% if item.type == "header" %}
  51.                                 <div class="col-md-12">
  52.                                     <{{item.subtype}} class="header-title">{{label|raw}}</{{item.subtype}}>
  53.                                 </div>
  54.                             {% elseif item.type == "text" %}
  55.                                 <div {% if item.classGlobal is defined %} class="col-md-6 col-lg-4 {{item.classGlobal}} {{item.name == 'ctc_city'?'ctc_city':''}}" {% else %} class="col-md-6 col-lg-4 {{item.name == 'ctc_city'?'ctc_city':''}}" {% endif %}>
  56.                                     <div class="form-group">
  57.                                         {{ forms.input(item.name,item.type,item.className,item.required,item.subtype,label,placeholder,item.maxlength|default(null)) }}
  58.                                         <div class="invalid-feedback">
  59.                                             {% if item.name == 'ctc_postcode' %}
  60.                                                 {{'validation_code_postal'|trans([],'variable')}}
  61.                                             {% else %}
  62.                                                 {{item.ErrorMessage|default(message)}}
  63.                                             {% endif %}
  64.                                         </div>
  65.                                     </div>
  66.                                 </div>
  67.                             {% elseif item.type == "select" %}
  68.                                 <div {% if item.classGlobal is defined %} class="col-sm-12 {{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  69.                                     <div class="form-group">
  70.                                         {{ forms.select(item.type,item.name,item.className,item.required,item.multiple,item.values,label,placeholder) }}
  71.                                         <div class="invalid-feedback">
  72.                                             {{item.ErrorMessage|default(message)}}
  73.                                         </div>
  74.                                     </div>
  75.                                 </div>
  76.                             {% elseif item.type == 'date' %}
  77.                             <div class="date-form col-md-12 {{ item.classGlobal is defined ? item.classGlobal : '' }}" >
  78.                                 {{ forms.input(item.name,placeholder,item.className,item.required,item.type,label) }}
  79.                                 <div class="invalid-feedback">
  80.                                     {{item.ErrorMessage|default(message)}}
  81.                                 </div>
  82.                             </div>
  83.                             {% elseif item.type == "textarea" %}
  84.                                 <div {% if item.classGlobal is defined %} class="{{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  85.                                     <div class="form-group">
  86.                                         {% if item.label is defined and item.label is not empty %}
  87.                                             <label class="label-control">{{item.label}}</label>
  88.                                         {% endif %}
  89.                                         <textarea name="{{item.name}}" class="{{item.className|default('')}}" required="{{item.required|default('false')}}" rows="{{item.rows|default('6')}}" placeholder="{{item.placeholder|default('')}}"></textarea>
  90.                                         <div class="invalid-feedback">
  91.                                             {{item.ErrorMessage|default(message)}}
  92.                                         </div>
  93.                                     </div>
  94.                                 </div>
  95.                             {% elseif item.type == "file" %}
  96.                                 <div {% if item.classGlobal is defined %} class="col-md-6 col-lg-4 input-file {{item.classGlobal}}" {% else %} class="col-md-6 text-left" {% endif %}>
  97.                                     <div class="form-group">
  98.                                         {{ forms.input(item.name,item.type,item.className,item.required,item.subtype,label,placeholder,item.maxlength|default(null)) }}
  99.                                         <div class="invalid-feedback">
  100.                                             {{item.ErrorMessage|default(message)}}
  101.                                         </div>
  102.                                     </div>
  103.                                 </div>
  104.                             {% elseif item.type == "button" and item.subtype != "submit" %}
  105.                                  {# <div {% if item.classGlobal is defined %} class="{{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  106.                                     <div class="form-group">
  107.                                         {{ forms.button(item.name,item.type,item.subtype,item.className,item.label) }}
  108.                                     </div>
  109.                                 </div>  #}
  110.                             {% elseif item.type == "checkbox-group" %}
  111.                                 <div class="{% if item.classGlobal is defined %}{{item.classGlobal}}{% else %}col-sm-12 d-flex justify-content-center{% endif %}">
  112.                                     {# {% if label %}<label>{{label}}</label>{% endif %} #}
  113.                                     <div class="form-group  {% if item.inline is defined and item.inline == "true" %}d-flex{% endif %}">
  114.                                         {{ forms.checkbox(item.required,item.name,item.values) }}
  115.                                     </div>
  116.                                 </div>
  117.                             {% elseif item.type == "paragraph" %}
  118.                                 <div class="{% if item.classGlobal is defined %}{{item.classGlobal}}{% else %}col-sm-12{% endif %}">
  119.                                     <p>{{item.label|unescape|raw}}</p>
  120.                                 </div>
  121.                             {% elseif item.type == "button" and item.subtype == "submit" %}
  122.                                 <div class="col-sm-12 d-flex justify-content-center">
  123.                                     <div class="form-group button-submit">
  124.                                         <button class="btn btn-cms" type="submit">{{item.label }}</button>
  125.                                     </div>
  126.                                 </div>
  127.                             {% endif %}
  128.                             
  129.                         {% endfor %}
  130.                     </div>
  131.                 </div>
  132.                 <input type="hidden" id="{{bloc.form.id}}_captcha" name="g-recaptcha-response" value="">
  133.             </form>
  134.             </div>
  135.             
  136.         {% endif %}
  137.    
  138.         </div>
  139.     </div>
  140. </section>
  141. <script>
  142. const filesInput = document.querySelectorAll('input[type="file"]');
  143. if(filesInput){
  144.     filesInput.forEach(function(fileInput) {
  145.         fileInput.setAttribute('accept', '.pdf,.doc,.docx,.txt,.jpg,.jpeg,.png');
  146.     });
  147. }
  148. </script>
  149. {{ render(controller('App\\Controller\\Front\\FunctionController::renderHorairesPageContact')) }}
  150. {{ render(controller('App\\Controller\\Front\\FunctionController::renderMapContact')) }}