list_boolean.html.twig 969 B

1234567891011121314151617181920212223242526272829
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% extends admin.getTemplate('base_list_field') %}
  8. {% block field_span_attributes %}
  9. {% spaceless %}
  10. {{ parent() }}
  11. data-source="[{value: 0, text: '{%- trans from 'SonataAdminBundle' %}label_type_no{% endtrans -%}'},{value: 1, text: '{%- trans from 'SonataAdminBundle' %}label_type_yes{% endtrans -%}'}]"
  12. {% endspaceless %}
  13. {% endblock %}
  14. {% block field %}
  15. {% spaceless %}
  16. {% if value %}
  17. <span class="label label-success">{%- trans from 'SonataAdminBundle' %}label_type_yes{% endtrans -%}</span>
  18. {% else %}
  19. <span class="label label-important">{%- trans from 'SonataAdminBundle' %}label_type_no{% endtrans -%}</span>
  20. {% endif %}
  21. {% endspaceless %}
  22. {% endblock %}