{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}

{% block field%}
{%- spaceless %}
    {% if value %}
        {% set text = 'label_type_yes'|trans({}, 'SonataAdminBundle') %}
    {% else %}
        {% set text = 'label_type_no'|trans({}, 'SonataAdminBundle') %}
    {% endif %}

    {% if field_description.options.inverse|default(false) ? not value : value %}
        {% set class = 'label-success' %}
    {% else %}
        {% set class = 'label-danger' %}
    {% endif %}
    <span class="label {{ class }} editableboolean" data-value="{{value ? 'true' : 'false'}}" data-url="{{path('setenable', {'id': object.id, 'type': field_description.options.datatype})}}" style='cursor:pointer;'>{{ text }}</span>
{% endspaceless -%}
{% endblock %}