{% extends "otree/Base.html" %}
{% load i18n %}
{% load floppyforms otree_tags staticfiles %}

{% block internal_styles %}
    {{ block.super }}
    <link href="{% static 'otree/css/table.css' %}" rel="stylesheet" />
{% endblock %}

{% block internal_scripts %}
{{ block.super }}
<script type="text/javascript" charset="utf-8">
$(function () {
    $('[data-toggle="popover"]').popover()
});
$(function(){
    // if top menu link is clicked inside iframe
    // we exit full mode
    $("#top_menu a").click(function() {
        if ( window.location !== window.parent.location ) {
                window.parent.location.href = $(this).attr("href");
        }
    });
});
$(function () {
    $.ajax({
        url: '{% url 'OtreeCoreUpdateCheck' %}',
        type: 'GET',
        success: function(data) {
            if (!data.pypi_connection_error) {
                if (data.update_needed) {
                    $('._otree-core-updates').html(
                        '<a class="navbar-brand" href="{% url 'ServerCheck' %}"><span class="glyphicon glyphicon-refresh" title="Newer version of oTree available"></span></a>')
                }
            }
        }
    });
});

</script>

<script src="{% static 'otree/js/jquery.color-2.1.2.min.js' %}"></script>
<script src="{% static 'otree/js/jquery.timeago.js' %}"></script>
<script src="{% static 'otree/js/jsondiffpatch.min.js' %}"></script>
<script src="{% static 'otree/js/table-utils2.js' %}"></script>

{% endblock %}
{% block body_main %}
    {% include 'otree/includes/TopMenu.html' %}
    <div class="container" style='max-width:970px'>
    <div class="page-header" style="padding-top: 40px">
        <h2>{% block title %}{% endblock %}</h2>
    </div>
    {% block menus %}{% endblock %}
    <div>
        {% if form.errors %}
            <div class="alert alert-danger">
            {% blocktrans trimmed %}Please fix the errors in the form.{% endblocktrans %}
            </div>
        {% endif %}

        {% block content %}{% endblock %}
    
    </div>
    <br/>
</div>
{% endblock %}
<!--end body_main-->
