Sha256: 640a70f6b181dd4a721a0868390714ec3faabf5deecbf259c4f1e1d4ddce8d02

Contents?: true

Size: 1.88 KB

Versions: 2

Compression:

Stored size: 1.88 KB

Contents

<%
  email_signup_link ||= false
  email_signup_link_text ||= t("govuk_component.subscription_links.email_signup_link_text", default: "Get email alerts")
  feed_link ||= false
  feed_link_text ||= t("govuk_component.subscription_links.feed_link_text", default: "Subscribe to feed")
  feed_link_box_value ||= false
  feed_link_data = false

  if feed_link_box_value
    feed_link = "#"
    feed_link_data = {
      controls: "feed-reader",
      expanded: "false"
    }
  end
%>
<% if email_signup_link || feed_link || feed_link_box_value %>
  <section class="gem-c-subscription-links" data-module="gem-toggle">
    <h2 class="visuallyhidden"><%= t("govuk_component.subscription_links.subscriptions", default: "Subscriptions") %></h2>
    <ul class="gem-c-subscription-links__list">
      <% if email_signup_link.present? %>
        <li class="gem-c-subscription-links__list-item">
          <%= link_to email_signup_link_text, email_signup_link, class: "gem-c-subscription-links__link gem-c-subscription-links__link--email-alerts" %>
        </li>
      <% end %>

      <% if feed_link_box_value || feed_link.present? %>
        <li class="gem-c-subscription-links__list-item">
          <%= link_to feed_link_text, feed_link,
              class: "gem-c-subscription-links__link gem-c-subscription-links__link--feed",
              data: feed_link_data
          %>
        </li>
      <% end %>
    </ul>

    <% if feed_link_box_value %>
      <div class="gem-c-subscription-links__feed-box js-hidden" id="feed-reader">
        <p class="gem-c-subscription-links__feed-description js-hidden"><%= feed_link_text %></p>
        <%= render "govuk_publishing_components/components/input", {
          label: {
            text: "Copy and paste this URL into your feed reader"
          },
          name: "feed-reader-box",
          value: feed_link_box_value
        } %>
      </div>
    <% end %>
  </section>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_publishing_components-7.3.0 app/views/govuk_publishing_components/components/_subscription-links.html.erb
govuk_publishing_components-7.2.0 app/views/govuk_publishing_components/components/_subscription-links.html.erb