Sha256: 69a22de2337a37c96cc2aa0a926447576053bb50857b5c7257a5fdb012ad0206
Contents?: true
Size: 1.19 KB
Versions: 44
Compression:
Stored size: 1.19 KB
Contents
<% id ||= "error-summary-#{SecureRandom.hex(4)}" title ||= false description ||= false data_attributes ||= {} items ||= [] title_id ||= "error-summary-title-#{SecureRandom.hex(4)}" if items.empty? && !title raise ArgumentError, "The error_summary component needs at least one item or a title in order to render." end %> <%= tag.div( class: "gem-c-error-summary govuk-error-summary", data: { module: "error-summary" }.merge(data_attributes), aria: { labelledby: title_id }, role: "alert", tabindex: -1, id: id, ) do %> <% if title %> <h2 class="govuk-error-summary__title" id="<%= title_id %>"> <%= title %> </h2> <% end %> <div class="govuk-error-summary__body"> <% if description %> <p><%= description %></p> <% end %> <% if items.present? %> <ul class="govuk-list govuk-error-summary__list"> <% items.each_with_index do |item, index| %> <li class="gem-c-error-summary__list-item"> <% if item[:href] %> <%= link_to item[:text], item[:href] %> <% else %> <%= item[:text] %> <% end %> </li> <% end %> </ul> <% end %> </div> <% end %>
Version data entries
44 entries across 44 versions & 1 rubygems