{# Renders a editable list of all attachments. form is the Attachment CollectionType #} {% macro attachment_edit_list(form, part_mode = false) %} {% form_theme form with ['parts/edit/edit_form_styles.html.twig'] %} {% import 'components/collection_type.macro.html.twig' as collection %}
{% for attachment in form %} {{ form_widget(attachment) }} {% endfor %}
{% endmacro %} {% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-2x hoverpic", link = true) %} {# @var App\Entity\Attachments\Attachment attachment #} {% set disabled = attachment.secure and not is_granted("show_private", attachment) %} {% if not attachment_helper or attachment_helper.fileExisting(attachment) %} {% if link and not disabled %} {% endif %} {% if attachment.picture %} {% else %} {% endif %} {% if link and not disabled %} {% endif %} {% elseif not attachment_helper.fileExisting(attachment) %} {% endif %} {% endmacro %}