Skip to content

Commit

Permalink
Allow for a description in related link sections
Browse files Browse the repository at this point in the history
This change is required so we can display the new Register to Vote
section in the related links sidebar. Because there needs to be a
description in there, we need to make sure we add it to the section,
when available.
  • Loading branch information
carvil committed May 4, 2017
1 parent f4e955c commit 53e6e7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/govuk-component/_related-items.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
margin-bottom: 0.5em;
}

.description {
@include core-16;
}

ul {
// reset the default browser styles
padding: 0;
Expand Down
7 changes: 7 additions & 0 deletions app/views/govuk_component/related_items.raw.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
>
<%= section[:title] %>
</h2>

<% if section[:description].present? %>
<p class='description'>
<%= section[:description] %>
</p>
<% end %>

<nav role="navigation" <% if section[:id] %>aria-labelledby="<%= section[:id] %>"<% end %>>
<ul>
<% total_links_in_section = section[:items].length + (section[:url] ? 1 : 0) %>
Expand Down

0 comments on commit 53e6e7e

Please sign in to comment.