{% load static %}
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="shortcut icon" type="image/png" href="{% static 'minecraft_manager/img/favicon.png' %}"/>
<script src="{% static 'minecraft_manager/js/jquery-3.3.1.min.js' %}"></script>
<script src="{% static 'minecraft_manager/js/FilterByText.js' %}"></script>
<script src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
{% if captcha %}
    <script src='https://www.google.com/recaptcha/api.js'></script>
{% endif %}
<link rel="stylesheet" href="{% static 'minecraft_manager/css/external.css' %}">
<link rel="stylesheet" href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
</head>
<body>
{% include 'minecraft_manager/external/map.html' %}
<div id="form"><h1>{% block h1 %}{% endblock %}</h1>
    {% block form_top %}{% endblock %}
    {% if valid is True %}
        {% block valid %}{% endblock %}
    {% else %}
        <form method="{% block method %}POST{% endblock %}">
            {% block form %}{{ form }}{% endblock %}<br/><br/>
            {% if captcha %}<div class="g-recaptcha" data-sitekey="6LeLcGEUAAAAAMMpHR-7VL6Q3nNV5v03S5sq1Ddz"></div>{% endif %}
            <button type="submit">{% block submit %}Submit{% endblock %}</button>
        </form>
    {% endif %}
    {%  block form_bottom %}{% endblock %}
</div>
</body>
<script>
    $(document).ready(function() {
        var $dataTable = $("#dataTable");
        if ($dataTable.length) {
            $dataTable.hide();
            $dataTable.DataTable({
                'initComplete': function(settings, json) {
                    $dataTable.show();
                }
            });
        }

        var $filter = $("#filter");
        if ($filter.length) {
            $("#stats").filterByText($filter);
        }

    });
</script>
</html>