templates/front/theme1/form/form_faq.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. <section class="contact-faq text-center text-md-left">
  3.     <div class="container-fluid wrapper2">     
  4.         {% if bloc.form %}
  5.             <form id="form-{{bloc.form.id}}" action="{{path('save_form')}}" method="post" class="needs-validation row gx-5 form-recap {{bloc.form.identifier}}" novalidate>
  6.                 {% for message in app.flashes('success-form-' ~ bloc.form.id) %}
  7.                     <div class="alert alert-success alert-form mx-auto">
  8.                         {{ message|raw }}
  9.                     </div>
  10.                 {% endfor %}
  11.                 {% for message in app.flashes('error-form-' ~ bloc.form.id) %}
  12.                     <div class="alert alert-danger alert-form mx-auto">
  13.                         {{ message|raw }}
  14.                     </div>
  15.                 {% endfor %}
  16.                 {% set message = 'validation_form'|trans([],'variable') %}
  17.                 <input type="hidden" value="{{bloc.form.id}}" name="IdForm">
  18.                 <div class="row flex-column flex-md-row justify-content-center"> 
  19.                     {% for item in bloc.form.data %}
  20.                         {% set label = item.label|default(null)%}
  21.                         {% set placeholder = item.placeholder|default(null) %}
  22.                         {% if item.type == "header" %}
  23.                             <div class="col-md-12">
  24.                                 {{ forms.header(item.subtype,item.label,item.className) }}
  25.                             </div>
  26.                         {% elseif item.type == "text" or item.type == "textarea" %}
  27.                             <div {% if item.classGlobal is defined %} class="pl-r {{item.classGlobal}} {{item.name == 'ctc_city'?'ctc_city':''}}" {% else %} class="col-form-item form-group {{ item.required == "true" ? 'required' : '' }} {{item.name == 'ctc_city'?'ctc_city':''}} " {% endif %}>
  28.                                 {{ forms.input(item.name,item.type,item.className,item.required,item.subtype,label,placeholder,item.maxlength|default(null)) }}
  29.                                 <div class="invalid-feedback">
  30.                                     {% if item.name == 'ctc_postcode' %}
  31.                                         {{'validation_code_postal'|trans([],'variable')}}
  32.                                     {% else %}
  33.                                         {{item.ErrorMessage|default(message)}}
  34.                                     {% endif %}
  35.                                 </div>
  36.                             </div>
  37.                             
  38.                         {% elseif item.type == "select" %}
  39.                             <div {% if item.classGlobal is defined %} class="col-form-item form-group  {{item.classGlobal}}" {% else %} class="col-form-item form-group {{ item.required == "true" ? 'required' : '' }}" {% endif %}>
  40.                                 {{ forms.select(item.type,item.name,item.className,item.required,item.multiple,item.values,label,placeholder) }}
  41.                                 <div class="invalid-feedback">
  42.                                     {{item.ErrorMessage|default(message)}}
  43.                                 </div>
  44.                             </div>
  45.                         {# {% elseif item.type == "textarea" %}
  46.                             <div {% if item.classGlobal is defined %} class="pl-r  {{item.classGlobal}}" {% else %} class="col-sm-12" {% endif %}>
  47.                                 <div class="form-group {{ item.required == "true" ? 'required' : '' }}">
  48.                                     {{ forms.textarea(item.name,item.type,item.className,item.required,item.subtype,label,placeholder,item.rows) }}
  49.                                     <div class="invalid-feedback">
  50.                                         {{item.ErrorMessage|default(message)}}
  51.                                     </div>
  52.                                 </div>
  53.                             </div> #}
  54.                         {% elseif item.type == "button" %}
  55.                             <div {% if item.classGlobal is defined %} class="pl-r  {{item.classGlobal}}" {% else %} class="col-form-item form-group button-submit" {% endif %}>
  56.                                 <button class="{{item.className}}" type="{{item.subtype}}">{{item.label}}</button>
  57.                             </div>
  58.                         {% elseif item.type == "checkbox-group" %}
  59.                             <div class="{% if item.classGlobal is defined %}pl-r  {{item.classGlobal}}{% else %}col-md-12{% endif %}">
  60.                                 {% if label %}<label>{{label}}</label>{% endif %}
  61.                                 <div class="form-group {{ item.required == "true" ? 'required' : '' }} {% if item.inline is defined and item.inline == "true" %}d-flex{% endif %}">
  62.                                     {{ forms.checkbox(item.required,item.name,item.values) }}
  63.                                 </div>
  64.                             </div>
  65.                         {% elseif item.type == "paragraph" %}
  66.                             <div class="{% if item.classGlobal is defined %}{{item.classGlobal}}{% else %}col-md-12{% endif %}">
  67.                                 <p>{{item.label|unescape|raw}}</p>
  68.                             </div>
  69.                         {% endif %}
  70.                     {% endfor %}
  71.                 </div>
  72.                 <input type="hidden" id="{{bloc.form.id}}_captcha" name="g-recaptcha-response" value="">
  73.             </form>
  74.         {% endif %}
  75.     </div>
  76. </section>