add boolean 'is_disabled' in the menu item template options
This commit is contained in:
parent
10221591c2
commit
81194a1d67
|
@ -1,15 +1,28 @@
|
||||||
{% block item %}
|
{% set is_disabled = is_disabled|default(false) %}
|
||||||
<li class="nav-item">
|
{% set disabled_class = is_disabled ? 'text-muted' : '' %}
|
||||||
<a class="nav-link {% if id == section %}active{% endif %}" href="{{ route }}">
|
|
||||||
{%- block icon -%}
|
|
||||||
<span class="{{ icon }}"></span>
|
|
||||||
{%- endblock -%}
|
|
||||||
|
|
||||||
{%- block label -%}
|
{% set icon %}
|
||||||
<span class="nav-item-label">
|
<span class="{{ icon }} {{ disabled_class }}"></span>
|
||||||
{{- label|trans -}}
|
{% endset %}
|
||||||
</span>
|
|
||||||
{%- endblock -%}
|
{% set label %}
|
||||||
</a>
|
<span class="nav-item-label {{ disabled_class }}">
|
||||||
</li>
|
{{- label|trans -}}
|
||||||
|
</span>
|
||||||
|
{% endset %}
|
||||||
|
|
||||||
|
{% block item %}
|
||||||
|
{% if is_disabled|default(false) %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<span class="nav-link {% if id == section %}active{% endif %}">
|
||||||
|
{{- (icon ~ label)|raw -}}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link {% if id == section %}active{% endif %}" href="{{ route }}">
|
||||||
|
{{- (icon ~ label)|raw -}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue