{% load i18n %}{% load cache %}
<nav id="nav">
    <div class="ym-wrapper">
        <div class="navbar navbar-inverse ">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            {#          #}
                            {# User tab #}
                            {#          #}
                            <li {% if active_tab == 'user' %}class="active"{% endif %}><a href="{% url 'core:index' %}">{% trans "Dashboard" %}</a></li>


                            {#             #}
                            {# Workout tab #}
                            {#             #}
                            <li class="dropdown {% if active_tab == 'workout' %}active{% endif %}">
                                <a href="{% url 'workout-overview' %}"
                                   rel="nofollow"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown">{% trans "Workouts" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'workout-overview' %}" rel="nofollow">{% trans "Workouts" %}</a></li>
                                    <li><a href="{% url 'workout-calendar' %}" rel="nofollow">{% trans "Calendar" %}</a></li>
                                    <li><a href="{% url 'schedule-overview' %}" rel="nofollow">{% trans "Workouts schedules" %}</a></li>
                                </ul>
                            </li>


                            {#               #}
                            {# Exercises tab #}
                            {#               #}
                            <li class="dropdown {% if active_tab == 'exercises' %}active{% endif %}">
                                <a href="{% url 'exercise-overview' %}"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown">{% trans "Exercises" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'exercise-overview' %}">{% trans "Exercises" %}</a></li>
                                    <li><a href="{% url 'muscle-overview' %}">{% trans "Muscle overview" %}</a></li>
                                    <li><a href="{% url 'equipment-overview' %}">{% trans "Equipment overview" %}</a></li>
                                    {% if user.is_authenticated and not user.userprofile.is_temporary %}
                                    <li class="divider"></li>
                                    <li><a href="{% url 'exercise-add' %}">{% trans "Add new exercise" %}</a><li>
                                    {% endif %}

                                    {% cache cache_timeout user-admin-exercises user.id language.id %}
                                    {% if perms.exercises %}
                                    <li class="divider"></li>
                                    <li class="nav-header">{% trans "Administration" %}</li>
                                    <li><a href="{% url 'exercise-pending' %}">{% trans "Exercises pending review" %}</a></li>
                                    <li><a href="{% url 'equipment-list' %}">{% trans "Equipment" %}</a></li>
                                    {% endif %}
                                    {% endcache %}
                                </ul>
                            </li>


                            {#            #}
                            {# Weight tab #}
                            {#            #}
                            <li class="dropdown{% if active_tab == 'weight'    %} active{% endif %}">

                                <a href="{% url 'weight-overview' %}"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown"
                                   rel="nofollow">{% trans "Weight" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'weight-overview' %}" rel="nofollow">{% trans "Weight overview" %}</a></li>
                                    <li><a href="{% url 'weight-add' %}" rel="nofollow">{% trans "Add weight entry" %}</a></li>
                                </ul>
                            </li>


                            {#               #}
                            {# Nutrition tab #}
                            {#               #}
                            <li class="dropdown {% if active_tab == 'nutrition' %}active{% endif %}">
                                <a href="{% url 'nutrition-overview' %}"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown"
                                   rel="nofollow">{% trans "Nutrition" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                <li><a href="{% url 'nutrition-overview' %}" rel="nofollow">{% trans "Nutrition plans" %}</a></li>
                                <li><a href="{% url 'ingredient-list' %}">{% trans "Ingredient overview" %}</a></li>
                                <li><a href="{% url 'bmi-view' %}" rel="nofollow">{% trans "BMI calculator" %}</a></li>
                                <li><a href="{% url 'calories-calculator' %}" rel="nofollow">{% trans "Daily calories calculator" %}</a></li>
                                {% cache cache_timeout user-admin-ingredients user.id language.id %}
                                {% if perms.exercises %}
                                    <li class="divider"></li>
                                    <li class="nav-header">{% trans "Administration" %}</li>
                                    <li><a href="{% url 'weight-unit-list' %}">{% trans "Ingredient weight units" %}</a></li>
                                    <li><a href="{% url 'ingredient-pending' %}">{% trans "Ingredients pending review" %}</a></li>
                                {% endif %}
                                {% endcache %}
                                </ul>
                            </li>


                            {#              #}
                            {# Software tab #}
                            {#              #}
                            <li class="dropdown {% if active_tab == 'software' %}active{% endif %}">
                                <a href=""
                                   class="dropdown-toggle"
                                   data-toggle="dropdown">{% trans "About this software" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'software:features' %}">{% trans "Features" %}</a></li>
                                    <li><a href="{% url 'software:contribute' %}">{% trans "Contribute!" %} </a></li>
                                    <li><a href="{% url 'software:issues' %}">{% trans "Problems and wishes" %} </a></li>
                                    <li class="divider"></li>
                                    <li class="nav-header">{% trans "Developers" %}</li>
                                    <li><a href="{% url 'software:code' %}">{% trans "Get the code" %} </a></li>
                                    <li><a href="{% url 'software:api' %}">{% trans "REST API" %} </a></li>
                                    <li><a href="{% url 'software:license' %}">{% trans "License" %} </a></li>
                                    <li><a href="{% url 'software:changelog' %}">{% trans "Changelog" %} </a></li>
                                    <li><a href="https://github.com/rolandgeider/wger">{% trans "Github" %} </a></li>
                                    <li><a href="https://www.transifex.com/projects/p/wger-workout-manager/">{% trans "Translate with Transifex" %} </a></li>
                                    {% cache cache_timeout user-admin-software user.id language.id %}
                                    {% if perms.exercises %}
                                    <li class="divider"></li>
                                    <li class="nav-header">{% trans "Administration" %}</li>
                                    <li><a href="{% url 'config:language-overview' %}">{% trans "Languages" %} </a></li>
                                    <li><a href="{% url 'core:license-list' %}">{% trans "Licenses" %} </a></li>
                                    {% endif  %}
                                    {% endcache %}
                                </ul>
                            </li>
                        </ul>


                        {#             #}
                        {# Options tab #}
                        {#             #}
                        {% if not user.is_authenticated or user.userprofile.is_temporary %}
                        <ul class="nav pull-right">
                            <li class="divider-vertical"></li>
                            <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                {% trans "Options" %}
                            <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="{% url 'core:login' %}">{% trans "Login" %}</a></li>
                                <li><a href="{% url 'core:registration' %}">{% trans "Register" %}</a></li>
                                <li><a href="{% url 'core:password_reset' %}">{% trans "Reset password" %}</a></li>
                            </ul>
                        </ul>
                        {% endif %}
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>
    </div>
</nav>

