<!DOCTYPE html>
<!--
    This file is part of wger Workout Manager

    wger 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.

    wger 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/>.
-->


{% load i18n staticfiles wger_extras compress django_bootstrap_breadcrumbs %}
{% block breadcrumbs %}
    {% clear_breadcrumbs %}
{% endblock %}
<html>
{% spaceless_config %}
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="Roland Geider">

    <!-- OpenGraph -->
    {% block opengraph %}
        <meta property="og:url" content="{{ request_absolute_path }}">
        <meta property="og:type" content="website">
    {% endblock %}
    {% block opengraphimages %}
        <meta property="og:image" content="{{ image_absolute_path }}">
    {% endblock %}

    <!-- twitter cards -->
    {% block twittercard %}
        <meta content="summary" name="twitter:card">
        <meta content="@wger_de" name="twitter:site">
    {% endblock %}

    <title>{% block title %}{% endblock %}</title>

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

    {% compress 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' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager-common.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/workout-manager-mobile.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'css/shariff.min.css' %}">
    {% endcompress %}

    {% compress js %}
    <script src="{% static 'js/jquery.js' %}"></script>
    <script src="{% static 'js/jquery-ui.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    <script src="{% static 'js/d3.js' %}"></script>
    <script src="{% static 'js/workout-manager.js' %}"></script>
    <script src="{% static 'js/workout-manager-mobile.js' %}"></script>
    <script src="{% static 'js/exercises.js' %}"></script>
    <script src="{% static 'js/weight.js' %}"></script>
    <script src="{% static 'js/nutrition.js' %}"></script>
    {% endcompress %}

    {% block header %}{% endblock %}

    <script>
    $(document).ready(function () {
        $('[data-toggle=offcanvas]').click(function () {
            $('.row-offcanvas').toggleClass('active')
        });

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

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

        // Check for RO-access before allowing sharing
        toggle_ro_access();
    });
    </script>

</head>
<body>
<header>
    <div class="navbar navbar-fixed-top" style="background-color: #204A87;">
        <button type="button"
                class="btn btn-primary pull-left visible-xs"
                data-toggle="offcanvas"
                style="margin-top: 0.5em;margin-left: 0.5em;">
            <span class="glyphicon  glyphicon-th-list"></span>
        </button>
        <span class="center-block application-name">
            wger
        </span>
    </div>

    <div class="hidden-xs" role="navigation">
        {% include 'navigation.html' %}
    </div>
</header>

<div class="container">

    <div class="modal fade" id="language-options">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title">{% trans "Language" %}</h4>
                </div>
                <div class="modal-body">
                    <div class="list-group">
                        {% for language in languages %}
                            {% language_select language %}
                        {% endfor %}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="main" class="row-offcanvas row-offcanvas-left">
        <div class="modal fade" id="wger-ajax-info" tabindex="-1" role="dialog">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="ajax-info-title">Modal title</h4>
                    </div>
                    <div class="modal-body" id="ajax-info-content">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
                    </div>
                </div>
            </div>
        </div>
        <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="alert alert-warning" role="alert" style="padding:0.6em; margin-top: 1em; 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:user:demo-entries' %}" rel="nofollow" class="btn btn-success btn-xs">
                {% trans "Create some demo entries" %}
                <span class="glyphicon glyphicon-chevron-right"></span>
            </a>
            {% else %}
                <a href="{% url 'core:user:registration' %}" class="btn btn-success btn-xs">
                    {% trans "Register" %}
                    <span class="glyphicon glyphicon-chevron-right"></span>
                </a>
            {% endif %}
            </div>
        {% endif %}

        <div id="main-template">
            {% block template %}{% endblock %}
        </div>

        <div class="sidebar-offcanvas visible-xs" role="navigation">
            {% include 'navigation.html' %}
        </div>
    </div>
</div>


<div class="btn-group btn-group-justified" style="margin-top: 1em;">
    {% if user.is_authenticated %}
    <div class="btn-group">
        <a href="{% url 'core:index' %}" {% auto_link_css flavour %}>{% trans "Dashboard" %}</a>
    </div>
    <div class="btn-group">
        <a href="{% url 'manager:workout:overview' %}" {% auto_link_css flavour %}>{% trans "Workouts" %}</a>
    </div>
    <div class="btn-group">
        <a href="{% url 'nutrition:plan:overview' %}" {% auto_link_css flavour %}>{% trans "Nutrition" %}</a>
    </div>
    {% else %}
    <div class="btn-group">
        <a href="{% url 'core:user:login' %}" {% auto_link_css flavour %}>{% trans "Login" %}</a>
    </div>
    <div class="btn-group">
        <a href="{% url 'software:features' %}" {% auto_link_css flavour %}>{% trans "Features" %}</a>
    </div>
    {% endif %}
</div>

<script src="{% static 'js/shariff.min.js' %}"></script>
<script src="https://login.persona.org/include.js" type="text/javascript"></script>
</body>
{% endspaceless_config %}
</html>
