Sha256: 948609f4472d1b58a056c1f7bcca58c08a88ac4de715a4a2fd862a0d3799585b

Contents?: true

Size: 1.22 KB

Versions: 154

Compression:

Stored size: 1.22 KB

Contents

<%
  tabs ||= []
  panel_border ||= true unless panel_border == false
  panel_css_classes = %w(govuk-tabs__panel)
  panel_css_classes << "gem-c-tabs__panel--no-border" if panel_border == false
  panel_css_classes = panel_css_classes.join(" ")
%>
<% if tabs.count > 1 %>
  <div class="govuk-tabs gem-c-tabs" data-module="govuk-tabs">
    <h2 class="govuk-tabs__title">
      <%= t("components.tabs.contents") %>
    </h2>
    <ul class="govuk-tabs__list">
      <% tabs.each do |tab| %>
      <li class="govuk-tabs__list-item">
        <%= link_to(tab[:label],
                    "##{tab[:id]}",
                    class: "govuk-tabs__tab",
                    data: tab[:tab_data_attributes]) %>
      </li>
      <% end %>
    </ul>
    <% tabs.each do |tab| %>
      <section class="<%= panel_css_classes %>" id="<%= tab[:id] %>">
        <% if tab[:title] %>
          <h2 class="govuk-heading-l"><%= tab[:title] %></h2>
        <% end %>
        <%= tab[:content] %>
      </section>
    <% end %>
  </div>
<% end %>
<% if tabs.count == 1 %>
    <section id="<%= tabs[0][:id] %>">
      <% if tabs[0][:title] %>
        <h2 class="govuk-heading-l"><%= tabs[0][:title] %></h2>
      <% end %>
      <%= tabs[0][:content] %>
    </section>
<% end %>

Version data entries

154 entries across 154 versions & 1 rubygems

Version Path
govuk_publishing_components-34.12.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.11.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.10.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.10.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.9.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.9.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.8.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.8.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.7.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.7.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.6.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.5.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.5.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.4.2 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.4.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.4.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.3.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.2.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.1.3 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-34.1.2 app/views/govuk_publishing_components/components/_tabs.html.erb