-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add "vertical layout" template #3
Merged
Merged
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
626fd12
Add "vertical layout" template
b4d91a7
Pooling of "horizontal" and "vertical" layout
6f63581
Update src/Helper/ContextHelper.php
cavasinf cc86c6c
Update src/Helper/ContextHelper.php
cavasinf 2b07d71
Change layout includes files location
ccc4f46
Set getLayout to private access
58a754c
BugFix block overriding from "base" (user) template
c284556
BugFix block horizontal template name
af9a000
Add "HTML attribute id" config to primary blocks
40325cb
Add hasActiveChildren() on menu + auto open tree
d3809ea
Merge branch 'main' into layout-vertical
cavasinf 6e39911
Add new tabler param to ConfigurationTest
de1240b
BugFix when focus out, active menu was closed
d01dee9
Add dark-mode for header and navbar individually
13597db
Add new dark param into default configuration for tests
7d3989b
Merge branch 'main' into layout-vertical
kevinpapst 5eea967
remove required config, it has a default value
kevinpapst 0085d69
Update templates/includes/layout_vertical.html.twig
cavasinf e831141
Use include navbar template
62b2fb6
Add `header` block as default from layout vertical
90e3e3b
singular = hasActiveChild()
e8c7df1
Remove hacky include way
a33825a
Add `navbar` block as default from layout horizontal
e224005
Update menu twig to allows childs of a child item
21b1119
Explode layout option into twigs layout
58591e6
Remove `layout` tabler configuration
56e4f1d
Remove `layout` tabler configuration
6534bcc
Merge branch 'main' into layout-vertical
7500575
BugFix extends & variable layout type
9e280c7
Clean unused `includes`
ec345da
Add badge option on child item
4e51950
Merge branch 'main' into layout-vertical
bcc1ab5
[Redo] Update menu twig to allows childs of a child item
f80cf40
Remove navbar embeded (twig doens't allow block override in embeded f…
efaf141
Redo PR #74
636fc1a
Switch navbar into macro
a1e81cc
Add safe escape
72512a0
Merge branch 'main' into layout-vertical
081ae49
remove tabler_layoutType, do not show badge on first level vertical m…
kevinpapst 9d2c766
remove tabler_layoutType, do not show badge on first level vertical m…
kevinpapst 0558b4b
added missing commits
kevinpapst 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
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
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,47 +1,95 @@ | ||
{% if menu is not defined %} | ||
{% set menu = tabler_menu(app.request) %} | ||
{% endif %} | ||
|
||
{% if menu is defined and menu is not null %} | ||
<ul class="navbar-nav"> | ||
{% for item in menu %} | ||
<li id="{{ item.identifier }}" class="nav-item {{ item.isActive ? 'active' : '' }} {{ item.hasChildren? 'dropdown' : '' }}"> | ||
<a {% if item.hasChildren -%} | ||
class="nav-link dropdown-toggle" href="#navbar-base" data-bs-toggle="dropdown" role="button" aria-expanded="false" | ||
{%- else -%} | ||
class="nav-link" href="{{ '/' in item.route ? item.route : path(item.route|tabler_route, item.routeArgs) }}" | ||
{%- endif -%}> | ||
{% if item.icon %} | ||
<span class="nav-link-icon d-md-none d-lg-inline-block text-center"> | ||
{{ tabler_icon(item.icon, false, item.icon) }} | ||
</span> | ||
{% endif %} | ||
<span class="nav-link-title">{{ item.label|trans }}</span> | ||
{% if item.badge is not null or item.badgeColor is not null %} | ||
<span class="badge bg-{{ item.badgeColor|default('blue') }}">{{ item.badge }}</span> | ||
{% endif %} | ||
</a> | ||
|
||
{% if item.hasChildren %} | ||
<div class="dropdown-menu"> | ||
<ul class="navbar-nav {{ navbar_class | default('') }}"> | ||
{% for item in menu %} | ||
<li id="{{ item.identifier }}" class="nav-item {{ item.isActive ? 'active' : '' }} {{ item.hasChildren? 'dropdown' : '' }}"> | ||
<a | ||
{% if item.hasChildren %} | ||
class="nav-link dropdown-toggle" role="button" | ||
data-bs-toggle="dropdown" data-bs-auto-close="{{ tabler_layoutType is same as "vertical" ? 'false' : 'outside' }}" | ||
aria-expanded="{{ tabler_layoutType is same as "vertical" }}" | ||
{% else %} | ||
class="nav-link" href="{{ '/' in item.route ? item.route : path(item.route|tabler_route, item.routeArgs) }}" | ||
{% endif %} | ||
> | ||
{{ _self.item_icon(item) }} | ||
<span class="nav-link-title">{{ item.label|trans }}</span> | ||
{{ _self.item_badge(item) }} | ||
</a> | ||
|
||
{{ _self.item_childs(item, tabler_layoutType) }} | ||
|
||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
|
||
|
||
|
||
|
||
|
||
|
||
{% macro item_childs(item, tabler_layoutType) %} | ||
{% if item.hasChildren %} | ||
<div class="dropdown-menu {{ tabler_layoutType is same as "vertical" and item.isActive ? 'show':'' }}" data-bs-popper="none"> | ||
<div class="dropdown-menu-columns"> | ||
<div class="dropdown-menu-column"> | ||
|
||
{% for child in item.children %} | ||
{% if child.divider %} | ||
{% if not loop.last -%} | ||
<hr class="dropdown-divider"> | ||
{%- endif %} | ||
|
||
{% if child.hasChildren %} | ||
<div class="dropend"> | ||
<a class="dropdown-item dropdown-toggle" role="button" | ||
data-bs-toggle="dropdown" data-bs-auto-close="{{ tabler_layoutType is same as "vertical" ? 'false' : 'outside' }}" | ||
aria-expanded="{{ tabler_layoutType is same as "vertical" }}" | ||
> | ||
{{ _self.item_icon(child) }} | ||
{{ child.label|trans }} | ||
{{ _self.item_badge(child) }} | ||
</a> | ||
|
||
{{ _self.item_childs(child, tabler_layoutType) }} | ||
|
||
</div> | ||
{% else %} | ||
<a class="dropdown-item {{ child.isActive ? 'active':'' }}" href="{{ '/' in child.route ? child.route : path(child.route|tabler_route, child.routeArgs) }}"> | ||
{% if child.icon %} | ||
<span class="nav-link-icon d-md-none d-lg-inline-block text-center"> | ||
{{ tabler_icon(child.icon, false, child.icon) }} | ||
</span> | ||
{% endif %} | ||
{{ child.label|trans }} | ||
</a> | ||
{{ _self.child_item(child) }} | ||
{% endif %} | ||
|
||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{% macro child_item(child) %} | ||
{% if child.divider %} | ||
{% if not loop.last -%} | ||
<hr class="dropdown-divider"> | ||
{%- endif %} | ||
{% else %} | ||
<a | ||
class="dropdown-item {{ child.isActive ? 'active':'' }}" | ||
{% if not child.hasChildren %}href="{{ '/' in child.route ? child.route : path(child.route|tabler_route, child.routeArgs) }}"{% endif %} | ||
> | ||
{{ _self.item_icon(child) }} | ||
{{ child.label|trans }} | ||
{{ _self.item_badge(child) }} | ||
</a> | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{% macro item_icon(item) %} | ||
{% if item.icon %} | ||
<span class="nav-link-icon d-md-none d-lg-inline-block text-center">{{ tabler_icon(item.icon, false, item.icon) }}</span> | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{% macro item_badge(item) %} | ||
{% if item.badge is not null or item.badgeColor is not null %} | ||
<span class="badge bg-{{ item.badgeColor|default('blue') }}">{{ item.badge }}</span> | ||
{% endif %} | ||
{% endmacro %} |
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.
tabler_layoutType
is used here for example