Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #240 from sumocoders/fix-sidebar-icons-at-parent-l…
Browse files Browse the repository at this point in the history
…evel

Fix sidebar icons at parent level
  • Loading branch information
ohvitorino authored Oct 18, 2018
2 parents fb6d7d0 + 1f1f0a8 commit 5418394
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
{% block label %}
{% if item.attributes.icon is defined %}
<i class="{{ item.attributes.icon }}"></i>
{% if item.parent.name == 'root' and item.hasChildren %}
<i class="icon icon-angle"></i>
{% endif %}
{% endif %}
{{ item.label|trans(item.getExtra('translation_params', {}), item.getExtra('translation_domain', 'messages'))|capitalize }}
{{ item.label|trans(item.getExtra('translation_params', {}), item.getExtra('translation_domain', 'messages'))|capitalize }}
{% endblock %}

{% block item %}
{% if item.parent.name == 'root' and item.hasChildren %}
{% set item = item.setLinkAttributes({ 'class': 'menu-item dropdown-toggle', 'role': 'button', 'aria-expended': false }) %}
{% set item = item.setAttributes({ 'class': 'dropdown', 'icon': 'icon icon-angle' }) %}
{% set item = item.setAttributes({ 'class': 'dropdown', 'icon': item.attribute('icon') }) %}
{% set item = item.setChildrenAttributes({ 'class': 'dropdown-menu', 'role': 'menu' }) %}
{% elseif item.parent.name == 'root' and not item.hasChildren %}
{% set item = item.setLinkAttributes({ 'class': 'menu-item' }) %}
Expand Down

0 comments on commit 5418394

Please sign in to comment.