Sha256: a148e588cfa5a185d421cffb74e4d0f0da1f84c097b709e783a938dbc3d6ba19
Contents?: true
Size: 1.26 KB
Versions: 129
Compression:
Stored size: 1.26 KB
Contents
<% add_gem_component_stylesheet("attachment-link") attachment = GovukPublishingComponents::Presenters::AttachmentHelper.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
129 entries across 129 versions & 1 rubygems