-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expandable/dropdown menus #3917
Merged
Merged
Changes from 71 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
c7a2e8d
wip - root level nav updates
martyn-w 1e9e9d9
wip - category menus
martyn-w 8c2fb78
wip - javascript controller
martyn-w 955a78d
wip - grid layout and tweaking JS
martyn-w fd7bd6c
wip - improving menu logic
martyn-w a2b85cb
linting
martyn-w dc88128
Merge branch 'master' into expandable-menus
martyn-w b858ba6
test fixes
martyn-w 70e7644
linting fixes
martyn-w 56b3ab1
test fix
martyn-w 3542bfc
Merge branch 'expandable-menus' of github.com:DFE-Digital/get-into-te…
martyn-w 748fa4c
Merge branch 'master' into expandable-menus
martyn-w f7f42a4
fix tab navigation, bugfix menu hide
martyn-w 87f65e8
set ariaExpanded attribute
martyn-w cd03508
Merge branch 'master' into expandable-menus
martyn-w 557691d
set expanded on anchor link
martyn-w 375eb47
tweak styles
martyn-w 61a68aa
fix linting error
martyn-w ae765b9
mobile styles wip
martyn-w 12c976e
mobile javascript workflow
martyn-w 3d075a2
rewrite of JS sync logic
martyn-w 39cb638
ensure menu sync from different menu branchs
martyn-w 540f4c8
Merge branch 'master' into expandable-menus
martyn-w b1a8c2b
linting
martyn-w e1fb51e
bugfix to close page-links menu
martyn-w a59f23f
fix arrows and spacing
martyn-w f1fbf8f
linting
martyn-w 07daf5c
more styling tweaks
martyn-w 590cb96
test fix
martyn-w 4ae76af
more test fixes
martyn-w bf62879
expanded icon for active state
martyn-w d3921fc
tweak icon size
martyn-w be6c763
change link to button for better accessibility
martyn-w f206a34
testfix
martyn-w 5cd3a16
simple non-js menu list
martyn-w 858e6ea
test fix
martyn-w 1030f4b
add selected item behaviour
martyn-w 1c52273
Various style fixes
martyn-w e4d7f80
Update browse.html.erb
martyn-w 02ff0a6
Expose uncategorised menu items
martyn-w 16d261e
fix wrapping of icon for iQTS
martyn-w 4090194
fix padding and margins
martyn-w 9763946
linting
martyn-w 924f8e5
Update navigation_component.rb
martyn-w 3a472cb
Update navigation_component_spec.rb
martyn-w 1001b16
bring uncategorised pages to level 2 menu
martyn-w c6a8e7b
fix increased height bug in "how to apply"
martyn-w 96c997c
remove underline on top level items
martyn-w 2f4d65c
cleanup
martyn-w 0f60878
add right padding to mobile menu arrows
martyn-w dd07a97
remove indent on top level mobile menu
martyn-w 0f5a342
Merge branch 'master' into expandable-menus
martyn-w 428eefc
Update browse.html.erb
martyn-w bb43919
Align page menu with categories
martyn-w 6b145a7
Merge branch 'master' into expandable-menus
martyn-w ed4976e
more wip
martyn-w f5061e2
more wip
martyn-w a0bcf5e
further style fixes
martyn-w ef97194
linting
martyn-w 287ac10
Merge branch 'master' into expandable-menus
martyn-w 19e9621
button width fix
martyn-w 2893d33
tweak arrow colours on mobile
martyn-w ee4cc5c
Merge branch 'master' into expandable-menus
martyn-w 7a7dac9
tabbing functionality on nav menu
martyn-w 9fe8b6c
re-instate hover on top nav menu
martyn-w 13339fb
minor bug fixes
martyn-w 0386983
linting
martyn-w 55310e4
updating styling of the browse page
jenhadfield-dfe e729f03
Linting whitespace
martyn-w 781ef45
Merge branch 'master' into expandable-menus
martyn-w 434c052
update to title on browse page
jenhadfield-dfe 797a874
tidy up browse page
martyn-w d413004
refactor nav controller
martyn-w a39b848
Update app/webpacker/controllers/navigation_controller.js
martyn-w c271071
Merge branch 'expandable-menus' of github.com:DFE-Digital/get-into-te…
martyn-w 3e0904e
fix show menu logic
martyn-w 9e3cf4e
rename sync to corresponding
martyn-w 1cac3ad
linting, update js spec
martyn-w File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
<nav id="primary-navigation" class="hidden-mobile" data-navigation-target="nav" aria-label="Primary navigation" role="navigation"> | ||
<ol class="primary" data-navigation-target="primary"> | ||
<!-- mobile navigation --> | ||
<%= tag.nav id: "primary-navigation", class: "hidden-mobile", data: { "navigation-target": "nav", action: "click->navigation#handleNavMenuClick" }, "aria-label": "Primary navigation", role: "navigation" do %> | ||
<%= tag.ol class: "primary", data: { "navigation-target": "primary" } do %> | ||
<% all_resources.each do |resource| %> | ||
<%= nav_link(resource.title, resource.path) %> | ||
<%= nav_link(resource, :mobile) %> | ||
<% end %> | ||
</ol> | ||
</nav> | ||
<% end %> | ||
<% end %> | ||
|
||
<!-- desktop dropdown navigation --> | ||
<%= tag.div id: "secondary-navigation", class: "desktop-menu-container hidden-mobile", data: { "navigation-target": "desktop", action: "click->navigation#handleNavMenuClick" }, "aria-label": "Secondary navigation", role: "navigation" do %> | ||
<div class="category-links"> | ||
<% all_resources.each do |resource| %> | ||
<% if resource.children? %> | ||
<%= category_list(resource, :desktop, css_class: "category-links-list hidden-menu") %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="page-links"> | ||
<% all_resources.each do |resource| %> | ||
<% if resource.subcategories.present? %> | ||
<% resource.subcategories.each do |subcategory| %> | ||
<%= page_list(resource, subcategory, :desktop, css_class: "page-links-list hidden-menu") %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="key-links"> | ||
</div> | ||
|
||
<% 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
class HeaderComponent < ViewComponent::Base | ||
attr_reader :breadcrumbs | ||
attr_reader :breadcrumbs, :front_matter | ||
|
||
def initialize(breadcrumbs: false) | ||
def initialize(breadcrumbs: false, front_matter: {}) | ||
super | ||
|
||
@breadcrumbs = breadcrumbs | ||
@front_matter = front_matter | ||
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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- The <ul> element is dynamically generated --> | ||
<!-- //NOSONAR --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this? |
||
<h1>Menu</h1> | ||
<% Pages::Navigation.root_pages.each do |resource| %> | ||
<h3> | ||
<%= link_to(resource.title, resource.path) %> | ||
<% if resource.subcategories? %> | ||
</h3> | ||
<ul> | ||
<% resource.subcategories.map do |category| %> | ||
<li><%= category %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<% end %> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems slightly counterintuitive at first glance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe there's a way of expressing what
sync
means in this contextThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep I think I could phrase that better 👍