{#
  Copyright 2024-2026 Simply.IN Sp. z o.o.
  Licensed under the EUPL-1.2 or later.

  Form theme for the BO settings page: renders every boolean CheckboxType as the
  classic PrestaShop Yes/No toggle (prestashop-switch), matching the legacy HelperForm look.
#}
{% block checkbox_widget -%}
    {# Honour Symfony's `disabled` option: without it a disabled field would still render as an
       editable toggle. Inert while no field sets it. #}
    {% set off = disabled ? ' disabled="disabled"' : '' %}
    <span class="switch prestashop-switch fixed-width-lg{{ disabled ? ' simplyin-switch-readonly' : '' }}">
        <input type="radio" name="{{ full_name }}" id="{{ id }}_on" value="1"{{ checked ? ' checked="checked"' : '' }}{{ off }} />
        <label for="{{ id }}_on">{{ 'Yes'|trans({}, 'Admin.Global') }}</label>
        <input type="radio" name="{{ full_name }}" id="{{ id }}_off" value="0"{{ checked ? '' : ' checked="checked"' }}{{ off }} />
        <label for="{{ id }}_off">{{ 'No'|trans({}, 'Admin.Global') }}</label>
        <a class="slide-button btn"></a>
    </span>
{%- endblock %}
