{% extends request.user_agent.is_mobile|yesno:"mobile/template.html,template.html" %}
{% load i18n wger_extras django_bootstrap_breadcrumbs %}

{% block template %}
{% if show_shariff %}
    {% include 'misc/fragments/shariff_modal.html' %}
{% endif %}


{% if trainer_identity %}
<div class="alert alert-info" style="margin-top: 1em;">
    {% blocktrans with current_user=user|format_username %}You are
browsing the site as the user "{{current_user}}", all actions are performed on his data.
    {% endblocktrans %}
    <a href="{% url 'core:user:trainer-login' trainer_identity %}" class="alert-link">
        {% blocktrans with target=user.userprofile.gym.name %}Back to "{{ target }}"{% endblocktrans %}
    </a>
</div>
{% endif %}



<div class="row">
    <div class="col-sm-8">
        <h2 id="page-title" class="page-header">
            {% block title %}{% endblock %}
        </h2>
    </div>
    <div class="col-sm-4" style="padding-top: 15px; padding-bottom: 15px;">
        <div class="btn-group">

            {% block options %}
            {% endblock %}

            {% if show_shariff %}
                <button type="button"
                        class="btn btn-default btn-sm"
                        data-toggle="modal"
                        data-target="#shariffModal">
                    <span class="glyphicon glyphicon-retweet"></span>
                    {%  trans "Share" %}
                </button>
            {% endif %}
        </div>
    </div>
</div>



<div class="row">
    <div class="col-sm-8" id="main-content">
        {% if messages and not no_messages %}
            {% for message in messages %}
                <div class="alert {% if message.tags == 'warning'%}alert-error{% elif message.tags == 'info' %}alert-info{% elif message.tags == 'success' %}alert-success{% endif %}">
                <a href="#" class="close extra-bold" data-dismiss="alert">&times;</a>
                {{message}}
                </div>
            {% endfor %}
        {% endif %}

        {% render_breadcrumbs "django_bootstrap_breadcrumbs/bootstrap3.html" %}

        <div id="content">
        {% block content %}{% endblock %}
        </div>
    </div>
    <div class="col-sm-4" id="main-sidebar">
        {% block sidebar %}
        {% endblock %}
    </div>
</div>
{% endblock %}
