-
Notifications
You must be signed in to change notification settings - Fork 89
PR title: Fix deep page nesting in sidebar, prev/next order, and parent dropdown indent #330
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
66ffd4f
PR title: Fix deep page nesting in sidebar, prev/next order, and pare…
Dobrunia 56d8a79
Refactor sidebar component structure
Dobrunia 9c9de40
Refactor menu tree creation for improved readability
Dobrunia da07301
Refactor page grouping logic to combine parent and map retrieval, imp…
Dobrunia d1ff372
Refactor parent select options to remove visual indenting and streaml…
Dobrunia 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| {% set is_leaf = node.children is not defined or node.children is empty %} | ||
| <section class="docs-sidebar__section{{ nested ? ' docs-sidebar__section--nested' : '' }}{{ is_leaf ? ' docs-sidebar__section--leaf' : '' }}" data-id="{{ node._id }}"> | ||
| <a class="docs-sidebar__section-title-wrapper" | ||
| href="{{ node.uri ? '/' ~ node.uri : '/page/' ~ node._id }}" | ||
| > | ||
| <div class="docs-sidebar__section-title {{ page is defined and toString(page._id) == toString(node._id) ? 'docs-sidebar__section-title--active' : '' }}"> | ||
| <span> | ||
| {{ node.title | striptags }} | ||
| </span> | ||
| {% if node.children is defined and node.children is not empty %} | ||
| <button type="button" class="docs-sidebar__section-toggler" aria-label="Toggle section"> | ||
| {{ svg('arrow-up') }} | ||
| </button> | ||
| {% endif %} | ||
| </div> | ||
| </a> | ||
| {% if node.children is defined and node.children is not empty %} | ||
| <ul class="docs-sidebar__section-list docs-sidebar__section-list--nested"> | ||
| {% for child in node.children %} | ||
| <li> | ||
| {% include 'components/sidebar-section.twig' with { node: child, nested: true } %} | ||
| </li> | ||
| {% endfor %} | ||
| </ul> | ||
| {% endif %} | ||
| </section> |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -26,14 +26,11 @@ | |
| {% endif %} | ||
| <select id="parent" name="parent"> | ||
| <option value="0">Root</option> | ||
| {% for _page in pagesAvailableGrouped %} | ||
| {% for entry in parentSelectOptions %} | ||
| {% set _page = entry.page %} | ||
| {% if toString(_page._id) != toString(currentPageId) %} | ||
| <option value="{{ toString(_page._id) }}" {{ page is not empty and toString(page._parent) == toString(_page._id) ? 'selected' : ''}}> | ||
| {% if _page._parent != "0" %} | ||
| | ||
| | ||
| {% endif %} | ||
| {{ _page.title }} | ||
| {{- entry.indent -}}{{- _page.title -}} | ||
|
Member
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. please, add "strip tags" filter to the title to prevent xss |
||
| </option> | ||
| {% endif %} | ||
| {% endfor %} | ||
|
|
||
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.
Seem like it is a presentation-specific logic, and should not be stored in a data model.
depthis enough. You can add indents in a template then.