{% load i18n %}
{% load mptt_tags %}
{% load td_cms_tags %}

<nav class="top-bar">
    <ul class="title-area">
        <!-- Title Area -->
        <li class="name">
          <h1><a href="{% url 'home' %}">{% trans "Home" %}</a></h1>
        </li>

        <li class="toggle-topbar menu-icon"><a href="#"><span>{% trans "Menu" %}</span></a></li>
    </ul>

    {% get_parent_categories as categories %}

    <section class="top-bar-section">
        <!-- Right Nav Section -->
        <ul class="right">
            {% recursetree categories %}

            <li class="divider hide-for-small"></li>

            {% if node.is_leaf_node or not node.children.all %}
            <li><a href="{{ node.get_absolute_url }}">{{ node.name }}</a></li>
            {% else %}
            <li class="has-dropdown">
                <a href="{{ node.get_absolute_url }}">{{ node.name }}</a>
                <ul class="dropdown">
                    {{ children }}
                </ul>
            </li>
            {% endif %}

            {% endrecursetree %}
        </ul>
    </section>
</nav>
