Sha256: 6a036032c1019ed1c227b51853f4311e999295ca60682fcba2e5dea061dad2e5

Contents?: true

Size: 1.3 KB

Versions: 13

Compression:

Stored size: 1.3 KB

Contents

<%
  add_gem_component_stylesheet("glance-metric")

  name ||= false
  figure ||= nil
  context ||= ""
  measurement_display_label ||= ""
  measurement_explicit_label ||= ""

  local_assigns[:heading_level] ||= 3

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_class("gem-c-glance-metric govuk-body")
%>
<% if name %>
  <%= tag.div(**component_helper.all_attributes) do %>
    <%= content_tag(shared_helper.get_heading_level, class: "gem-c-glance-metric__heading") do %>
      <%= name %>
    <% end %>

    <% if figure.nil? %>
      <span class="gem-c-glance-metric__figure">No data</span>
    <% else %>
      <span class="gem-c-glance-metric__figure">
        <%= figure %>
        <% if measurement_display_label.present?  %>
          <span class="gem-c-glance-metric__display-label" aria-hidden="true"><%= measurement_display_label %></span>
        <% end %>
        <% if measurement_explicit_label.present? %>
          <span class="gem-c-glance-metric__explicit-label"><%= measurement_explicit_label %></span>
        <% end %>
    <% end %>
    </span>
    <p class="gem-c-glance-metric__context govuk-body-xs"><%= context %></p>
  <% end %>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
govuk_publishing_components-51.1.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-51.0.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-50.0.1 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-50.0.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-49.1.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-49.0.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-47.0.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-46.4.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-46.3.1 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-46.3.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-46.2.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb
govuk_publishing_components-46.1.0 app/views/govuk_publishing_components/components/_glance_metric.html.erb