show_choice.html.twig 854 B

123456789101112131415161718192021222324252627
  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 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
  8. {% block field%}
  9. {% if field_description.options.choices and value in field_description.options.choices|keys %}
  10. {% if field_description.options.catalogue is not defined %}
  11. {% set value = field_description.options.choices[value] %}
  12. {% else %}
  13. {% set value = field_description.options.choices[value]|trans({}, field_description.options.catalogue) %}
  14. {% endif %}
  15. {% endif %}
  16. {% if field_description.options.safe %}
  17. {{ value|raw }}
  18. {% else %}
  19. {{ value }}
  20. {% endif %}
  21. {% endblock %}