<!DOCTYPE html>
{% load i18n %}
{% load staticfiles %}
<html lang="{{language.short_name}}">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8">
    <meta name="author" content="Roland Geider">

    <!--
    This file is part of Workout Manager

    Workout Manager is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Workout Manager is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with Workout Manager. If not, see <http://www.gnu.org/licenses/>.
    -->

    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml401/demos/css/flexible-grids.css' %} "> <!-- CSS framework for the layout -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml401/custom-yaml.css' %}">               <!-- Customisations for yaml      -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager.css' %}">                <!-- Own CSS classes and styles   -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui.css' %}">                      <!-- CSS for JQuery UI elements   -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui-custom.css' %}">               <!-- Customization for JQuery CSS -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">                  <!-- Twitter Bootstrap menu       -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-custom.css' %}">               <!-- Customization for Twitter Bootstrap  -->

    <link rel="icon" href="{% static 'images/favicon.png' %}" type="image/png">

    <script src="{% static 'js/jquery.js' %}"          type="text/javascript"></script>
    <script src="{% static 'js/jquery-ui.js' %}"       type="text/javascript"></script>
    <script src="{% static 'js/workout-manager.js' %}" type="text/javascript"></script>
    {% if language.short_name == 'de' %}
    <script src="{% static 'js/jquery.ui.datepicker-de.js' %}"></script>
    {% endif %}
    {% block header %}{% endblock %}

    <script>
    $(document).ready(function() {

        if (typeof custom_page_init != "undefined")
        {
            custom_page_init();
        }


        // Init the modal dialog for editing forms
        form_modal_dialog();

        // Initialise the hook to reload the main-content
        load_maincontent();

        // Toggle weight chart tables
        toggle_weight_log_table();
     });
    </script>


    <title>{% block title %}{% endblock %}</title>
</head>
<body>
<header>
    <div class="ym-wrapper">
        <div class="ym-wbox">
            <span class="name">wger</span>
            <span class="regular">| Workout Manager</span>
        </div>
    </div>
</header>
<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">
                            <li {% if active_tab == 'user' %}class="active"{% endif %}>
                            {% if not user.is_authenticated %}
                                <a href="{% url login %}">{% trans "Login" %}</a>
                            {% else %}
                                <a href="{% url index %}">{% trans "Dashboard" %}</a>
                            {% endif %}
                            </li>

                            {% if user.is_authenticated %}
                            <li {% if active_tab == 'workout'   %}class="active"{% endif %}><a href="{% url wger.manager.views.overview %}">{% trans "Workouts" %}</a></li>
                            {% endif %}

                            <li class="dropdown {% if active_tab == 'exercises' %}active{% endif %}">
                                <a href="{% url wger.exercises.views.exercise_overview %}"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown">{% trans "Exercises" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                    <li><a href="{% url wger.exercises.views.exercise_overview %}">{% trans "Exercises" %}</a></li>
                                    <li><a href="{% url muscle-overview %}">{% trans "Muscle overview" %}</a></li>
                                </ul>
                            </li>

                            {% if user.is_authenticated %}
                            <li class="dropdown{% if active_tab == 'weight'    %} active{% endif %}">

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

                            <li class="dropdown {% if active_tab == 'nutrition' %}active{% endif %}">
                                <a href="{% url wger.nutrition.views.overview %}"
                                   class="dropdown-toggle"
                                   data-toggle="dropdown">{% trans "Nutrition" %} <b class="caret"></b></a>
                                <ul class="dropdown-menu">
                                {% if user.is_authenticated %}
                                    <li><a href="{% url wger.nutrition.views.overview %}">{% trans "Nutrition plans" %} </a></li>
                                {% endif %}
                                    <li><a href="{% url wger.nutrition.views.ingredient_overview %}">{% trans "Ingredient overview" %}</a></li>
                                </ul>
                            </li>



                            <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>
                                    {% if not user.is_authenticated %}
                                    <li><a href="{% url demo-account %}">{% trans "Demo account" %} </a></li>
                                    {% endif %}
                                    <li><a href="{% url software:issues %}">{% trans "Report problem" %} </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:license %}">{% trans "License" %} </a></li>
                                    <li><a href="{% url software:changelog %}">{% trans "Changelog" %} </a></li>
                                </ul>
                            </li>
                        </ul>
                        <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">
                                {% if user.is_authenticated %}
                                <li>
                                    <a href="{% url wger.manager.views.logout %}" id="logout" class="browserid-logout">
                                    {% trans 'Logout' %}
                                    </a>
                                </li>
                                <li>
                                    <a href="{% url wger.manager.views.preferences %}">
                                    {% trans 'My preferences' %}
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li class="nav-header">{% trans "Languages" %}</li>
                                {% endif %}

                                <li {% if language.short_name == 'de' %}class="active"{% endif %}>
                                    <a href="{{i18n_path.de}}">
                                    <img src="{% static 'images/icons/flag-de.svg' %}"
                                             width="18"
                                             height="18"
                                             alt="{% trans 'German' %}"
                                             title="{% trans 'German' %}">
                                    {% trans "German" %}</a>
                                </li>
                                <li {% if language.short_name == 'en' %}class="active"{% endif %}>
                                    <a href="{{i18n_path.en}}">
                                    <img src="{% static 'images/icons/flag-en.svg' %}"
                                             width="18"
                                             height="18"
                                             alt="{% trans 'English' %}"
                                             title="{% trans 'English' %}">
                                    {% trans "English" %}</a>
                                </li>
                            </ul>
                        </ul>
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>
    </div>
</nav>

<div id="main">
    <div class="ym-wrapper">
        <section >
            <div class="ym-grid linearize-level-1">
                <article class="ym-g80 ym-gl">
                    <div class="ym-gbox-left box invisible" id="ajax-info">

                    </div>
                </article>
            </div>
        </section>
        <div class="ym-wbox" id="content-wrapper">
            <section class="ym-grid linearize-level-1">
                <div id="current-url" data-current-url="{{request_full_path}}"></div>
                <div id="current-language" data-current-language="{{language.short_name}}"></div>

                {% if user.get_profile.is_temporary %}
                    <div class="box info" style="padding:0.6em; margin: 0em 0em 1em 0em;text-align:center;">
                    {% trans "You are using a temporary account, this user will be deleted after some time."%}
                    </div>
                {% endif %}
                {% block template %}{% endblock %}
            </section>
        </div>
    </div>
</div>



<footer>
    <div class="ym-wrapper">
    <div class="ym-wbox">
        <div class="ym-grid linearize-level-1">
            <div class="ym-g10 ym-gl">
                <a href="https://bitbucket.org/rolandgeider/workout_manager" class="no-hover">
                    <img src="{% static 'images/agpl-v3.svg' %}"
                         width="88"
                         height="31"
                         alt="{% trans 'Released under the Affero GPL' %}"
                         title="{% trans 'Released under the Affero GPL' %}">
                </a>
            </div>
            <div class="ym-g40 ym-gl">
                <div class="ym-gbox-left">
                © <a href="mailto:roland@NO!SPAM!geider.net">Roland Geider</a>
                – {% trans "Layout based on <a href='http://www.yaml.de'>YAML</a>" %}
                </div>
            </div>
            <div class="ym-g50 ym-gr align-right">
                <div class="ym-gbox-right">
                    <em class="dimmed">{{version}}</em>
                </div>
            </div>
        </div>
    </div>
    </div>
</footer>
<script src="https://login.persona.org/include.js" type="text/javascript"></script>
<script src="{% static 'js/browserid.js' %}"       type="text/javascript"></script>
<script src="{% static 'js/ubuntu-unity.js' %}"    type="text/javascript"></script>
<script src="{% static 'js/bootstrap.js' %}"       type="text/javascript"></script>
</body>
</html>
