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

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.     <div class="row justify-content-center">       
  6.         {% if bloc.form %}
  7.         <div class="col-md-8">
  8.             <form id="form-{{bloc.form.id}}" action="{{path('save_form')}}" method="post" class="needs-validation row  form-recap {{bloc.form.identifier}}" novalidate>
  9.                 {% for message in app.flashes('success-form-' ~ bloc.form.id) %}
  10.                     <div class="alert alert-success alert-form mx-auto">
  11.                         {{ message|raw }}
  12.                     </div>
  13.                 {% endfor %}
  14.                 {% for message in app.flashes('error-form-' ~ bloc.form.id) %}
  15.                     <div class="alert alert-danger alert-form mx-auto">
  16.                         {{ message|raw }}
  17.                     </div>
  18.                 {% endfor %}
  19.                 
  20.                 {% set message = 'validation_form'|trans([],'variable') %}
  21.                 <input type="hidden" value="{{bloc.form.id}}" name="IdForm">
  22.                 
  23.                 <div class="contact-border">
  24.                     <div class="icon-header"></div>
  25.                     <div class="row">
  26.                         {% for item in bloc.form.data %}
  27.                             {% set label = item.label|default(null)%}
  28.                             {% set placeholder = item.placeholder|default(null) %}
  29.     
  30.                             {% if item.type == "text" %}
  31.                                 <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 %}>
  32.                                     <div class="form-group">
  33.                                         {{ forms.input(item.name,item.type,item.className,item.required,item.subtype,label,placeholder,item.maxlength|default(null)) }}
  34.                                         <div class="invalid-feedback">
  35.                                             {% if item.name == 'ctc_postcode' %}
  36.                                                 {{'validation_code_postal'|trans([],'variable')}}
  37.                                             {% else %}
  38.                                                 {{item.ErrorMessage|default(message)}}
  39.                                             {% endif %}
  40.                                         </div>
  41.                                     </div>
  42.                                 </div>
  43.                             {% elseif item.type == "select" %}
  44.                                 <div {% if item.classGlobal is defined %} class="col-sm-12 {{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  45.                                     <div class="form-group">
  46.                                         {{ forms.select(item.type,item.name,item.className,item.required,item.multiple,item.values,label,placeholder) }}
  47.                                         <div class="invalid-feedback">
  48.                                             {{item.ErrorMessage|default(message)}}
  49.                                         </div>
  50.                                     </div>
  51.                                 </div>
  52.                             {% elseif item.type == "textarea" %}
  53.                                 <div {% if item.classGlobal is defined %} class="{{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  54.                                     <div class="form-group">
  55.                                         {{ forms.textarea(item.name,item.type,item.className|default(''),item.required,item.subtype,item.label|default(''),item.placeholder|default(''),item.rows|default('')) }}
  56.                                         <div class="invalid-feedback">
  57.                                             {{item.ErrorMessage|default(message)}}
  58.                                         </div>
  59.                                     </div>
  60.                                 </div>
  61.                             {% elseif item.type == "button" and item.subtype != "submit" %}
  62.                                  {# <div {% if item.classGlobal is defined %} class="{{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  63.                                     <div class="form-group">
  64.                                         {{ forms.button(item.name,item.type,item.subtype,item.className,item.label) }}
  65.                                     </div>
  66.                                 </div>  #}
  67.                             {% elseif item.type == "checkbox-group" %}
  68.                                 <div class="{% if item.classGlobal is defined %}{{item.classGlobal}}{% else %}col-sm-12 d-flex justify-content-center{% endif %}">
  69.                                     {# {% if label %}<label>{{label}}</label>{% endif %} #}
  70.                                     <div class="form-group  {% if item.inline is defined and item.inline == "true" %}d-flex{% endif %}">
  71.                                         {{ forms.checkbox(item.required,item.name,item.values) }}
  72.                                     </div>
  73.                                 </div>
  74.                             {% elseif item.type == "paragraph" %}
  75.                                 <div class="{% if item.classGlobal is defined %}{{item.classGlobal}}{% else %}col-sm-12{% endif %}">
  76.                                     <p>{{item.label|unescape|raw}}</p>
  77.                                 </div>
  78.                             {% elseif item.type == "button" and item.subtype == "submit" %}
  79.                                 <div class="col-sm-12 d-flex justify-content-center">
  80.                                     <div class="form-group button-submit">
  81.                                         <button class="btn btn-primary" type="submit">{{item.label }}</button>
  82.                                     </div>
  83.                                 </div>
  84.                             {% endif %}
  85.                             
  86.                         {% endfor %}
  87.                     </div>
  88.                 </div>
  89.                 <input type="hidden" id="{{bloc.form.id}}_captcha" name="g-recaptcha-response" value="">
  90.             </form>
  91.             </div>
  92.         {% endif %}
  93.    
  94.         </div>
  95.     </div>
  96. </section>
  97. {{ render(controller('App\\Controller\\Front\\FunctionController::renderHorairesPageContact')) }}
  98. {{ render(controller('App\\Controller\\Front\\FunctionController::renderMapContact')) }}