<%= t(".attachments_title", scope: "decidim.admin") %> <% if can? :create, authorization_object %> <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.attachment.name", scope: "decidim.admin")), url_for(action: :new), class: 'button tiny button--title new' %> <% end %>

<% if attached_to.attachments.any? %>
<% attached_to.attachments.each do |attachment| %> <% end %>
<%= t("models.attachment.fields.title", scope: "decidim.admin") %> <%= t("models.attachment.fields.content_type", scope: "decidim.admin") %>
<%= link_to translated_attribute(attachment.title), edit_polymorphic_path([attached_to, attachment]) %>
<%= attachment.file_type %> <% if can? :update, authorization_object %> <%= icon_link_to "pencil", edit_polymorphic_path([attached_to, attachment]), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %> <% end %> <% if can? :destroy, authorization_object %> <%= icon_link_to "circle-x", polymorphic_path([attached_to, attachment]), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> <% end %>
<% end %>