Sha256: 1eeeb2cd9899bc101dbeede88c93467ac9ac51d2bf2e812f08f8b485bfc3fc10
Contents?: true
Size: 1.48 KB
Versions: 390
Compression:
Stored size: 1.48 KB
Contents
<% id ||= "file-upload-#{SecureRandom.hex(4)}" value ||= nil accept ||= nil data ||= nil label ||= nil hint ||= nil error_message ||= nil error_items ||= [] has_error = error_message || error_items.any? hint_id = "hint-#{SecureRandom.hex(4)}" error_id = "error-#{SecureRandom.hex(4)}" css_classes = %w(gem-c-file-upload govuk-file-upload) css_classes << "govuk-file-upload--error" if has_error form_group_css_classes = %w(govuk-form-group) form_group_css_classes << "govuk-form-group--error" if has_error aria_described_by ||= nil if hint || has_error aria_described_by = [] aria_described_by << hint_id if hint aria_described_by << error_id if has_error aria_described_by = aria_described_by.join(" ") end %> <%= content_tag :div, class: form_group_css_classes do %> <% if label %> <%= render "govuk_publishing_components/components/label", { html_for: id, text: label[:text] }.merge(label.symbolize_keys) %> <% end %> <% if hint %> <%= render "govuk_publishing_components/components/hint", { id: hint_id, text: hint } %> <% end %> <% if has_error %> <%= render "govuk_publishing_components/components/error_message", { id: error_id, text: error_message, items: error_items, } %> <% end %> <%= tag.input name: name, type: "file", value: value, class: css_classes, id: id, data: data, accept: accept, aria: { describedby: aria_described_by } %> <% end %>
Version data entries
390 entries across 390 versions & 1 rubygems