{% set form = get_recall_form() %}
{% set class = class|default("") %}
<div class="request-form request-form_{{ class }}"> {# <- Вот сюда будет добавлен класс success, когда форма успешно уйдет #}
<div class="request-form__data">
{{ form_start(form, {
'action': path('request:recall'),
'attr': {
'class': 'inline-form__form',
'data-ajax-form': 'true',
'data-success-selector': '.request-form',
'data-goal-yandex-submit': settings().successGoal,
'data-goal-vk-submit': settings().successGoal
}
}) }}
<div class="inline-form__field-wrap text__body">
{% if form.name is defined %}
<div class="inline-form__field text__body form-field">
{{ form_row(form.name) }}
</div>
{% endif %}
{% set phoneIsValid = form.phone.vars.valid %}
<div class="inline-form__field text__body form-field {% if not phoneIsValid %}_has-errors{% endif %}">
{{ form_row(form.phone) }}
</div>
</div>
<div class="{{ class }}__submit-policy-wrap">
{{ form_widget(form.submit, {
'attr': {
'class': 'inline-form__submit',
'data-submit-button': '',
}
}) }}
<div class="footer__policy-wrap">
{% include '_parts/common/policy-checkbox.html.twig' with {
class: 'footer__policy',
id: 'footer-recall'
} %}
</div>
</div>
{{ form_end(form) }}
</div>
<div class="request-form__success">
<div class="request-form__success-icon-wrap">
{% include "_parts/icons/form-success.svg" %}
</div>
<div class="request-form__success-text-wrap">
<div class="request-form__success-title h2">
Вы успешно оставили заявку
</div>
<div class="request-form__success-description text__main text__grey03">
Наш менеджер свяжется с вами в ближайшее время
</div>
</div>
</div>
</div>