show_orm_many_to_many.html.twig 989 B

123456789101112131415161718192021222324252627282930
  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. <ul class="sonata-ba-show-many-to-many">
  10. {% if field_description.hasassociationadmin and field_description.associationadmin.hasRoute('edit') and field_description.associationadmin.isGranted('edit')%}
  11. {% for element in value%}
  12. <li>
  13. <a href="{{ field_description.associationadmin.generateObjectUrl('edit', element) }}">{{ element|render_relation_element(field_description) }}</a>
  14. </li>
  15. {% endfor %}
  16. {% else %}
  17. {% for element in value%}
  18. <li>
  19. {{ element|render_relation_element(field_description) }}
  20. </li>
  21. {% endfor %}
  22. {% endif %}
  23. </ul>
  24. {% endblock %}