show_orm_one_to_one.html.twig 870 B

12345678910111213141516171819202122
  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.hasAssociationAdmin and field_description.associationadmin.id(value) %}
  10. {% if field_description.hasAssociationAdmin and field_description.associationadmin.isGranted('EDIT') and field_description.associationadmin.hasRoute('edit') %}
  11. <a href="{{ field_description.associationadmin.generateObjectUrl('edit', value) }}">{{ value|render_relation_element(field_description) }}</a>
  12. {% else %}
  13. {{ value|render_relation_element(field_description) }}
  14. {% endif %}
  15. {% endif %}
  16. {% endblock %}