{% load i18n %}{% load cache %}{% load wger_extras %}


<div data-role="popup"
     id="language-options-{{request_full_path|slugify}}"
     data-overlay-theme="a"
     class="ui-content">
     <div>
     <h3>{% trans "Language" %}</h3>
    {% for language in languages %}
        {% language_select language %}
    {% endfor %}
    </div>
</div>


{#                        #}
{# Close button for panel #}
{#                        #}
<ul data-role="listview">
    <li data-icon="delete" data-theme="a">
        <a href="#" data-rel="close">{% trans "Close" %}</a>
    </li>
    <li data-theme="c"  style="margin-top:1.5em;">
        <a href="{% url 'core:index' %}">{% trans "Dashboard" %}</a>
    </li>
</ul>


<div data-role="collapsible-set" data-inset="false" style="margin-top:1em;">

    {#             #}
    {# Workout tab #}
    {#             #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "Workouts" %}</h3>
        <ul data-role="listview">
            <li><a href="{% url 'workout-overview' %}" rel="nofollow">{% trans "Workouts" %}</a></li>
            <li><a href="{% url 'workout-calendar' %}" rel="nofollow" data-ajax="false">{% trans "Calendar" %}</a></li>
            <li><a href="{% url 'schedule-overview' %}" rel="nofollow">{% trans "Workouts schedules" %}</a></li>
        </ul>
    </div>

    {#               #}
    {# Exercises tab #}
    {#               #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "Exercises" %}</h3>
        <ul data-role="listview" data-divider-theme="a">
            <li><a href="{% url 'exercise-overview' %}">{% trans "Exercises" %}</a></li>
            <li><a href="{% url 'muscle-overview' %}" data-ajax="false">{% 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><a href="{% url 'exercise-add' %}" data-ajax="false">{% trans "Add new exercise" %}</a></li>
            {% endif %}

            {% if perms.exercises %}
            <li data-role="list-divider">{% 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 %}
        </ul>
    </div>

    {#            #}
    {# Weight tab #}
    {#            #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "Weight" %}</h3>
        <ul data-role="listview">
            <li><a href="{% url 'weight-overview' %}" rel="nofollow" data-ajax="false">{% trans "Weight overview" %}</a></li>
            <li><a href="{% url 'weight-add' %}" rel="nofollow" >{% trans "Add weight entry" %}</a></li>
        </ul>
    </div>

    {#               #}
    {# Nutrition tab #}
    {#               #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "Nutrition" %}</h3>
        <ul data-role="listview" data-divider-theme="a">
            <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" data-ajax="false">{% trans "BMI calculator" %}</a></li>
            <li><a href="{% url 'calories-calculator' %}" rel="nofollow" data-ajax="false">{% trans "Daily calories calculator" %}</a></li>
            {% if perms.exercises %}
                <li data-role="list-divider">{% 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 %}
        </ul>
    </div>

    {#              #}
    {# Software tab #}
    {#              #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "About this software" %}</h3>
        <ul data-role="listview" data-divider-theme="a">
            <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 data-role="list-divider">{% 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>
            {% if perms.exercises %}
            <li data-role="list-divider">{% 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 %}
        </ul>
    </div>

    {#             #}
    {# Options tab #}
    {#             #}
    <div data-role="collapsible" data-content-theme="d">
        <h3>{% trans "Options" %}</h3>
        <ul data-role="listview">

            {# Preferences #}
            {% if user.is_authenticated and not user.userprofile.is_temporary %}
            <li>
                <a href="{% url 'core:preferences' %}">
                {% trans "Preferences" %}
                </a>
            </li>
            {% endif %}

            {# Contact #}
            <li><a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a></li>
            <li><a href="{% url 'core:about' %}">{% trans "About" %}</a></li>

            {# Site version #}
            <li><a href="?flavour=full" data-ajax="false" rel="nofollow">{% trans "Desktop version" %}</a></li>

            {# Language #}
            <li>
                <a href="#language-options-{{request_full_path|slugify}}"
                   data-rel="popup"
                   data-position-to="window">{% trans "Language" %}
               </a>
            </li>

            {# Logout #}
            {% if user.is_authenticated and not user.userprofile.is_temporary %}
            <li>
                <a href="{% url 'core:logout' %}" data-ajax="false" class="browserid-logout">{% trans "Logout" %}</a>
            </li>
            {% endif %}
        </ul>
    </div>
</div>





{#           #}
{# Login tab #}
{#           #}
{% if not user.is_authenticated or user.userprofile.is_temporary %}
<!--
<h4 style="margin-bottom:0px;">{% trans "Options" %}</h4>

<br>
-->

<ul data-role="listview" data-inset="false" style="margin-top:2em;" data-theme="c">
    <li>
        <a href="{% url 'core:login' %}">{% trans "Login" %}</a>
    </li>
    <li>
        <a href="{% url 'core:registration' %}" data-ajax="false">{% trans "Register" %}</a>
    </li>
</ul>
{% endif %}




