Sha256: 6d3b494e40fe9d41aa03e4e382fa121e8ea8441c45d28a2993d1b77f92bee14a
Contents?: true
Size: 1.2 KB
Versions: 93
Compression:
Stored size: 1.2 KB
Contents
<% attachment = GovukPublishingComponents::Presenters::Attachment.new(attachment) target ||= nil data_attributes ||= {} attributes = [] if attachment.content_type_name content = if attachment.content_type_abbr raw tag.abbr(attachment.content_type.abbr, title: attachment.content_type_name, class: "gem-c-attachment-link__abbr") else attachment.content_type_name end attributes << tag.span(content, class: "gem-c-attachment-link__attribute") end if attachment.file_size attributes << tag.span( number_to_human_size(attachment.file_size), class: "gem-c-attachment-link__attribute", ) end if attachment.number_of_pages attributes << tag.span( I18n.t("components.attachment.page", count: attachment.number_of_pages), class: "gem-c-attachment-link__attribute", ) end %> <%= tag.span(class: "gem-c-attachment-link") do %> <%= link_to(attachment.title, attachment.url, class: "govuk-link", target: target, data: data_attributes) -%> <%= raw("(#{attributes.join(', ')})") if attributes.any? -%> <% end %>
Version data entries
93 entries across 93 versions & 1 rubygems