|
2 | 2 |
|
3 | 3 | {% macro attributes(attributes) %} |
4 | 4 | {% for name, value in attributes %} |
5 | | - {%- if value is not none and value is not same(false) -%} |
6 | | - {{- ' %s="%s"'|format(name, value is same(true) ? name|e : value|e)|raw -}} |
| 5 | + {%- if value is not none and value is not same as (false) -%} |
| 6 | + {{- ' %s="%s"'|format(name, value is same as (true) ? name|e : value|e)|raw -}} |
7 | 7 | {%- endif -%} |
8 | 8 | {%- endfor -%} |
9 | 9 | {% endmacro %} |
|
29 | 29 | {% endblock %} |
30 | 30 |
|
31 | 31 | {% block list %} |
32 | | -{% if item.hasChildren and options.depth is not same(0) and item.displayChildren %} |
| 32 | +{% if item.hasChildren and options.depth is not same as (0) and item.displayChildren %} |
33 | 33 | {% set listAttributes = listAttributes|merge({'class': listAttributes.class|default('')|trim}) %} |
34 | 34 |
|
35 | 35 | {% set listClass = '' %} |
|
71 | 71 |
|
72 | 72 | {% block dropdownList %} |
73 | 73 | {% spaceless %} |
74 | | - {% if item.hasChildren and options.depth is not same(0) and ((item.extras.dropdown is not defined and item.displayChildren is same(true) or item.extras.dropdown is defined and item.extras.dropdown is same(true) and item.displayChildren is same(true))) %} |
| 74 | + {% if item.hasChildren and options.depth is not same as (0) and ((item.extras.dropdown is not defined and item.displayChildren is same as (true) or item.extras.dropdown is defined and item.extras.dropdown is same as (true) and item.displayChildren is same as (true))) %} |
75 | 75 | {% set listAttributes = listAttributes|merge({'class': (listAttributes.class|default('') ~ ' dropdown-menu')|trim}) %} |
76 | 76 | <ul{{ _self.attributes(listAttributes) }}> |
77 | 77 | {{ block('children') }} |
|
82 | 82 |
|
83 | 83 | {% block listList %} |
84 | 84 | {% spaceless %} |
85 | | - {% if item.hasChildren and options.depth is not same(0) and item.displayChildren %} |
| 85 | + {% if item.hasChildren and options.depth is not same as (0) and item.displayChildren %} |
86 | 86 | <ul{{ _self.attributes(listAttributes) }}> |
87 | 87 | {{ block('children') }} |
88 | 88 | </ul> |
|
122 | 122 | {%- if item.actsLikeLast %} |
123 | 123 | {%- set classes = classes|merge([options.lastClass]) %} |
124 | 124 | {%- endif %} |
125 | | - {%- if item.hasChildren and ((options.style is defined and options.style == 'list') or options.currentDepth is not same(1)) %} |
| 125 | + {%- if item.hasChildren and ((options.style is defined and options.style == 'list') or options.currentDepth is not same as (1)) %} |
126 | 126 | {%- set classes = classes|merge(['nav-header']) %} |
127 | | - {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and ((item.extras.dropdown is not defined and item.displayChildren is same(true) or item.extras.dropdown is defined and item.extras.dropdown is same(true) and item.displayChildren is same(true))) %} |
| 127 | + {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and ((item.extras.dropdown is not defined and item.displayChildren is same as (true) or item.extras.dropdown is defined and item.extras.dropdown is same as (true) and item.displayChildren is same as (true))) %} |
128 | 128 | {%- set classes = classes|merge(['dropdown']) %} |
129 | 129 | {%- endif %} |
130 | 130 |
|
131 | 131 | {%- set attributes = item.attributes %} |
132 | 132 |
|
133 | | - {%- if options.style is defined and options.style == 'navbar' and attributes.divider is defined and attributes.divider is not empty and options.currentDepth is same(1) %} |
| 133 | + {%- if options.style is defined and options.style == 'navbar' and attributes.divider is defined and attributes.divider is not empty and options.currentDepth is same as (1) %} |
134 | 134 | {%- set classes = classes|merge(['divider-vertical']) %} |
135 | 135 | {%- elseif attributes.divider is defined and attributes.divider is not empty %} |
136 | 136 | {%- set classes = classes|merge(['divider']) %} |
|
142 | 142 | {# displaying the item #} |
143 | 143 | <li{{ _self.attributes(attributes) }}> |
144 | 144 | {%- if attributes.divider is defined and attributes.divider is not empty %} |
145 | | - {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is same(1) and ((item.extras.dropdown is not defined and item.displayChildren is same(true) or item.extras.dropdown is defined and item.extras.dropdown is same(true) and item.displayChildren is same(true))) %} |
| 145 | + {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is same as (1) and ((item.extras.dropdown is not defined and item.displayChildren is same as (true) or item.extras.dropdown is defined and item.extras.dropdown is same as (true) and item.displayChildren is same as (true))) %} |
146 | 146 | {{ block('dropdownElement') }} |
147 | | - {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is same(1) and ((item.extras.dropdown is defined and item.extras.dropdown is same(false) or item.displayChildren(false) )) %} |
| 147 | + {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is same as (1) and ((item.extras.dropdown is defined and item.extras.dropdown is same as (false) or item.displayChildren(false) )) %} |
148 | 148 | {{ block('linkElement') }} |
149 | 149 | {%- elseif item.uri is not empty and ((matcher is defined and not matcher.isCurrent(item)) or options.currentAsLink) %} |
150 | 150 | {{ block('linkElement') }} |
|
157 | 157 | {%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %} |
158 | 158 | {%- set childrenClasses = childrenClasses|merge(['menu_level_' ~ item.level]) %} |
159 | 159 | {%- set listAttributes = item.childrenAttributes|merge({'class': childrenClasses|join(' ') }) %} |
160 | | - {%- if item.hasChildren and options.style is defined and (options.style == 'list' or options.currentDepth is not same(1)) %} |
| 160 | + {%- if item.hasChildren and options.style is defined and (options.style == 'list' or options.currentDepth is not same as (1)) %} |
161 | 161 | {{ block('listList') }} |
162 | 162 | {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] %} |
163 | 163 | {{ block('dropdownList') }} |
|
0 commit comments