-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Programmatic menus #1756
Merged
Merged
Programmatic menus #1756
Conversation
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
1d4f69b
to
bd573f4
Compare
tvdeyen
approved these changes
Mar 20, 2020
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.
Very nice. Just two little nits
bd573f4
to
33f3394
Compare
@mamhoff there seems to be a feature spec failing that might be related? |
33f3394
to
71d9229
Compare
Yes, related - and fixed! |
We want to programmatically specify which menu names are allowed through a YML file. This method makes the contents of this YML file available to the app.
This adds a sample menus.yml to the install generator.
71d9229
to
e615f40
Compare
This allows us to use the same partial for multi-language sites.
The name field on root nodes is not meant to be human-readable, but rather translated.
e615f40
to
3204ada
Compare
@mamhoff a rebase should fix the code coverage report issue |
tvdeyen
added a commit
that referenced
this pull request
Mar 30, 2020
- Sortable menus [#1758](#1758) ([mamhoff](https://github.com/mamhoff)) - Programmatic menus [#1756](#1756) ([mamhoff](https://github.com/mamhoff)) - Fix syntax in non-erb Menu templates [#1751]((#1751)) ([Alexander ADAM](https://github.com/alexanderadam)) - Fix `render_menu` for custom controllers [#1746]((#1746)) ([Alexander ADAM](https://github.com/alexanderadam))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is this pull request for?
This decouples partial generation and UI translations of menus from database contents. This is desirable so that
a) We keep with the general philosophy that users should not be able to do stuff in the admin that makes template changes necessary
b) We can use the same template for menus in multiple languages.
Notable changes (remove if none)
Root nodes now have a string like 'main_menu' as their name, and that is translated.
Screenshots
After changing the admin locale to German with no German translations:
![grafik](https://user-images.githubusercontent.com/703401/77163348-2b357980-6aae-11ea-9696-923d8ed7edd7.png)
Checklist