diff --git a/templates/Parts/info/_attachments_info.html.twig b/templates/Parts/info/_attachments_info.html.twig index 4472a6ad..4f8e3b81 100644 --- a/templates/Parts/info/_attachments_info.html.twig +++ b/templates/Parts/info/_attachments_info.html.twig @@ -1,5 +1,3 @@ -{% import "helper.twig" as helper %} - @@ -18,7 +16,8 @@ {% for attachment in part.attachments %} diff --git a/templates/components/attachments.macro.html.twig b/templates/components/attachments.macro.html.twig index 7194c5ad..d30579d9 100644 --- a/templates/components/attachments.macro.html.twig +++ b/templates/components/attachments.macro.html.twig @@ -17,4 +17,23 @@ {% trans %}attachment.create{% endtrans %} +{% endmacro %} + +{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x", link = true) %} + {% set disabled = attachment.secure and not is_granted("show_secure", 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 %} \ No newline at end of file diff --git a/templates/helper.twig b/templates/helper.twig index cbf8b895..07585599 100644 --- a/templates/helper.twig +++ b/templates/helper.twig @@ -6,25 +6,6 @@ {% endif %} {% endmacro %} -{% macro attachment_icon(attachment, attachment_helper, class = "fa-fw fas fa-3x", link = true) %} - {% set disabled = attachment.secure and not is_granted("show_secure", 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 %} - {% macro string_to_tags(string, class="badge bg-info") %} {% for tag in string|split(',') %} {{ tag | trim }}
- {{ helper.attachment_icon(attachment, attachment_manager) }} + {% import "components/attachments.macro.html.twig" as attachments %} + {{ attachments.attachment_icon(attachment, attachment_manager) }} {{ attachment.name }} {{ attachment.attachmentType.fullPath }}