-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename navigation_items_label to navigation_aria_label - move default value for navigation aria label to the layout_header template
- Loading branch information
1 parent
8222e19
commit 1c7a339
Showing
4 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
<% navigation_items_label ||= "Top level" %> | ||
<% if navigation_items.any? %> | ||
<button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button> | ||
<nav class="gem-c-header__nav" aria-label="<%= navigation_items_label %>"> | ||
<%= tag.nav(class: "gem-c-header__nav", 'aria-label': navigation_aria_label ? navigation_aria_label : nil ) do %> | ||
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end"> | ||
<% navigation_items.each_with_index do |item, index| %> | ||
<li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %> | ||
<%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>"> | ||
<%= link_to( | ||
item[:text], | ||
item[:href], | ||
class: 'govuk-header__link', | ||
) %> | ||
</li> | ||
<li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %> | ||
<%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>"> | ||
<%= link_to( | ||
item[:text], | ||
item[:href], | ||
class: 'govuk-header__link', | ||
) %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</nav> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters