{% load bob %}

{%  if item.item_kind == 'separator' %}
<li class="divider-vertical"></li>
{%  elif item.item_kind == 'header' %}
<li class="nav-header">{{ item.label }}</li>
{%  elif item.item_kind == 'link' %}
<li class="
    {{ class_prefix|default:'menu-item' }}-{{ item.name|slugify }}
    {% if item.name == selected %}active{% endif %}
">
    <a href="{{ item.get_href }}">
        {% for i in item.kwargs.indent %}&nbsp;&nbsp;&nbsp;&nbsp;{% endfor %}
        {% if item.subitems and item.kwargs.collapsible %}
        <b href="#"
            class="fugue-icon menu-expand {% if item.kwargs.collapsed %}fugue-toggle-small-expand{% else %}fugue-toggle-small{% endif %}"
            data-toggle="collapse"
            data-target="#subitems-{{ item.name|slugify }}"
            onclick="$(this).toggleClass('fugue-toggle-small-expand fugue-toggle-small'); return false"
            style="margin-left: -16px"
         >+</b>{% endif %}{% if item.kwargs.fugue_icon %}<i class="fugue-icon {{ item.kwargs.fugue_icon }}"></i>
        {% elif item.kwargs.icon %}
            <i class="icon-{{ item.kwargs.icon }} icon-white"></i>
        {% endif %}
        {{ item.label }}
    </a>
    {% if item.subitems %}
    {% sidebar_menu_subitems item selected %}
    {% endif %}
</li>
{%  endif %}
