Sha256: 9a7aaae14fb105f001fcdd0fff80d8bcf39bfae60ed379b0f8bbf11523aa0ce9

Contents?: true

Size: 1.19 KB

Versions: 86

Compression:

Stored size: 1.19 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="tabs">
    <h2 class="govuk-tabs__title">
      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

86 entries across 86 versions & 1 rubygems

Version Path
govuk_publishing_components-16.2.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-16.1.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-16.0.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-15.3.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-15.2.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-15.1.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-15.0.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-14.0.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.8.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.8.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.7.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.6.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.6.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.5.4 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.5.3 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.5.2 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.5.1 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.5.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.4.0 app/views/govuk_publishing_components/components/_tabs.html.erb
govuk_publishing_components-13.3.0 app/views/govuk_publishing_components/components/_tabs.html.erb