{% macro sidebarMenu(sidebarMenu, currentModule, currentAction) %}
    {% if sidebarMenu|length > 1 %}
        <div class="Menu Menu--admin">
            <ul class="Menu-tabList">
                {% for name,submenu in sidebarMenu %}
                    {% if submenu._hasSubmenu %}
                        <li>
                            <span>{{ name|translate }}</span>
                            <ul>
                                {% for sname,url in submenu %}
                                    {% if sname|slice(0,1) != '_' %}
                                        <li>
                                            <a href='index.php{{ url._url|urlRewriteWithParameters }}'
                                               target="_self"
                                               {% if url._url.module == currentModule and (url._url.action is empty or url._url.action == currentAction) %}class='active'{% endif %}>{{ sname|translate }}</a>
                                        </li>
                                    {% endif %}
                                {% endfor %}
                            </ul>
                        </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
    {% endif %}
{% endmacro %}
