{% import "helper.twig" as helper %} {% macro assoc_row(assoc) %} {# @var assoc \App\Entity\Parts\PartAssociation #} {{ helper.part_icon_link(assoc.owner) }} {{ assoc.typeTranslationKey | trans }} {{ helper.part_icon_link(assoc.other) }} {{ assoc.comment }} {% endmacro %} {% macro assoc_table(assocs, caption) %}
{% for assoc in assocs %} {{ _self.assoc_row(assoc) }} {% endfor %}
{{ caption | trans }}:
{% trans %}part_association.table.from{% endtrans %} {% trans %}part_association.table.type{% endtrans %} {% trans %}part_association.table.to{% endtrans %} {% trans %}part_association.edit.comment{% endtrans %}
{% endmacro %} {% if part.associatedPartsAsOwner is not empty %} {{ _self.assoc_table(part.associatedPartsAsOwner, 'part_association.table.from_this_part') }} {% endif %} {% if part.associatedPartsAsOther is not empty %} {{ _self.assoc_table(part.associatedPartsAsOther, 'part_association.table.to_this_part') }} {% endif %}