{% block component_basic_captcha %}
{% set basicCaptchaOptions = {
router: path('frontend.captcha.basic-captcha.load'),
validate: path('frontend.captcha.basic-captcha.validate'),
captchaRefreshIconId: '#%s-basic-captcha-content-refresh-icon' | format(formId),
captchaImageId: '#%s-basic-captcha-content-image' | format(formId),
basicCaptchaInputId: '#%s-basic-captcha-input' | format(formId),
basicCaptchaFieldId: '#%s-basic-captcha-field' | format(formId),
formId: formId,
preCheck: preCheck,
preCheckRoute : {
path: path('frontend.captcha.basic-captcha.validate'),
token: sw_csrf('frontend.captcha.basic-captcha.validate', {'mode': 'token'})
}
} %}
<div class="{{ formRowClass }} basic-captcha"
data-basic-captcha="true"
data-basic-captcha-options='{{ basicCaptchaOptions|json_encode }}'>
<div class="form-group {% if additionalClass %} {{ additionalClass }}{% else %}col-md-6{% endif %} basic-captcha-content">
{% block component_basic_captcha_image %}
<div class="basic-captcha-content-code">
<div class="basic-captcha-content-image" id="{{ formId }}-basic-captcha-content-image"></div>
{% block component_basic_captcha_refresh_icon %}
<a class="btn btn-outline-primary basic-captcha-content-refresh-icon" id="{{ formId }}-basic-captcha-content-refresh-icon">
{% sw_icon 'arrow-switch' %}
</a>
{% endblock %}
</div>
{% endblock %}
{% block component_basic_captcha_fields_title_label %}
<label class="form-label">
{{ "captcha.basicCaptchaLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% if preCheck %}
<input id="{{ formId }}-precheck"
data-skip-report-validity="true"
type="text"
name="preCheck"
class="d-none"
required
>
{% endif %}
{% sw_include '@Storefront/storefront/component/captcha/basicCaptchaFields.html.twig' %}
</div>
</div>
{% endblock %}