<!DOCTYPE html>
{% load i18n %}
{% load browserid %}
{% load staticfiles %}
{% load wger_extras %}
{% load compress %}
<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/>.
    -->

    {% compress css %}
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml412/yaml/core/base.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml412/yaml/forms/gray-theme.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml412/yaml/screen/typography.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml412/yaml/screen/screen-FULLPAGE-layout.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/yaml412/yaml/print/print.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/custom-yaml.css' %}">

    <link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager-common.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/jquery-ui-custom.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-custom.css' %}">
    {% endcompress %}

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

    {% compress js %}
    <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/d3.js' %}"              type="text/javascript"></script>
    <script src="{% static 'js/workout-manager.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>
    <script src="{% static 'js/exercises.js' %}"       type="text/javascript"></script>
    <script src="{% static 'js/weight.js' %}"          type="text/javascript"></script>
    <script src="{% static 'js/nutrition.js' %}"       type="text/javascript"></script>
    {% endcompress %}

    <script src="{% static datepicker_i18n_path %}"></script>
    {% 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>
{% browserid_info %}
<header>
    <div class="float-right" style="margin-right:1em;margin-top:0em;position:absolute;right:0px;">

        {% if user.is_authenticated and not user.userprofile.is_temporary %}
            <a href="{% url 'core:preferences' %}">
            {% if user.email %}
                {{user.email}}
            {% else %}
                {{user.username}}
            {% endif %}
            </a>
            |

            <a href="{% url 'core:logout' %}" class="browserid-logout">
            {% trans "Logout" %}
            </a>
        {% else %}
            <a href="{% url 'core:login' %}">{% trans "Login" %}</a>
            |
            <a href="{% url 'core:registration' %}">{% trans "Register" %}</a>
        {% endif %}
        |
        <a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>
        |

        {# Render the links to the other languages #}
        {% for language in languages %}
        {% language_select language %}
        {% endfor %}
    </div>

    <div class="ym-wrapper">
        <div class="ym-wbox">
            <span class="name">wger</span>
            <span class="regular">| Workout Manager</span>
        </div>
    </div>
</header>
{% include 'navigation.html' %}
<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 not user.is_authenticated or user.userprofile.is_temporary %}
                    <div class="abox ainfo" style="padding:0.6em; margin: 0em 0em 1em 0em;text-align:center;font-size:95%;">
                    {% trans "You are using a guest account, data entered will be deleted after a week."%}
                    {% if not has_demo_data %}
                    <a href="{% url 'core:demo-entries' %}" rel="nofollow" class="btn btn-success btn-small">{% trans "Create some demo entries" %} »</a>
                    {% endif %}
                    </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://github.com/rolandgeider/wger" 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-g80 ym-gl">
                <div class="ym-gbox-left">
                <a href="{% url 'core:about' %}">{% trans "About" %}</a>
                | <a href="{% url 'software:contribute' %}">{% trans "Contribute!" %}</a>
                | <a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>
                | <a href="?flavour=mobile" rel="nofollow">{% trans "Mobile version" %}</a>
                </div>
            </div>
            <div class="ym-g10 ym-gr align-right">
                <div class="ym-gbox-right">
                    <em class="dimmed" style="font-size: 80%;">{{version}}</em>
                </div>
            </div>
        </div>
    </div>
    </div>
</footer>

<script src="https://login.persona.org/include.js" type="text/javascript"></script>
</body>
</html>
