<!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 lang="{{language.short_name}}">
{% 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 %}


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

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

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

    {% if language.short_name != 'en' %}
    <script src="{% static datepicker_i18n_path %}"       type="text/javascript"></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();

        // Check for RO-access before allowing sharing
        toggle_ro_access();

        $('input[type="date"]').datepicker({
                                            autoclose: true,
                                            language: $('html').attr('lang')
                                        });
     });
    </script>


    <title>{% block title %}{% endblock %}</title>
</head>
<body>
<header>
    <div class="container">
        <div class="row">
        <div class="col-md-offset-9 col-md-3">
            <a href="{% url 'core:contact' %}">{% trans "Get in touch" %}</a>
            |

            {#                                         #}
            {# Render the links to the other languages #}
            {#                                         #}
            <div class="btn-group">
                <button type="button" class="btn btn-primary dropdown-toggle btn-xs" data-toggle="dropdown">
                    <img src="/static/images/icons/flag-{{language.short_name}}.svg"
                         width="18"
                         height="11"
                         alt="{% trans language.full_name %}"
                         title="{% trans language.full_name %}"
                         style="border: 1px solid #151515;">
                    {{language.full_name}} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    {% for language in languages %}
                    {% language_select language %}
                    {% endfor %}
                    <li class="divider"></li>
                    <li>
                        <a href="https://www.transifex.com/projects/p/wger-workout-manager/">
                            <span class="glyphicon glyphicon-plus"></span>
                            {% trans "Translate" %}
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        </div>
    </div>

    <div class="container">
        <span class="name">wger</span>
        <span class="regular">| Workout Manager</span>
    </div>
</header>
{% include 'navigation.html' %}
<div id="main">
    <div class="container">
        <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"
                                style="padding-left: 0.5em;">&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>


        {#             #}
        {# Guest users #}
        {#             #}
        {# {% if not user.is_authenticated or user.userprofile.is_temporary %} #}
        {% if user.is_authenticated and 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 %}
        {% block template %}{% endblock %}
    </div>
</div>



<footer id="main-footer">
    <div class="container">
        <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>

        <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="{% url 'software:tos' %}">{% trans "Terms of service" %}</a>

        <div class="navbar-right">
            <em class="text-muted" style="font-size: 80%;">{{version}}</em>
        </div>
    </div>
</footer>

<script src="{% static 'js/shariff.min.js' %}"></script>
</body>
{% endspaceless_config %}
</html>
