{% extends "bootstrap/base.html" %}
{%- if _ is not defined -%}
    {% macro _(message) -%}
        {{ message }}
    {%- endmacro %}
{%- endif -%}

{% block title %}{{ _('Manage People Grid') }}{% endblock %}


{% block styles %}
    {{ super() }}
    <link href="{{url_for('webgrid.static', filename='multiple-select.css')}}" rel="stylesheet" media="screen">
    <link href="{{url_for('webgrid.static', filename='webgrid.css')}}" rel="stylesheet" media="screen">
{% endblock %}

{% block content %}
    <div class="container">
    <h2>{{ _('Manage People') }}</h2>
    {{ people_grid.html()|safe}}
    </div>
{% endblock %}

{% block scripts %}
    {{super()}}
    <script src="{{url_for('webgrid.static', filename='gettext.min.js')}}"></script>
    <script>
        var i18n = window.i18n({});
        window._ = function(msgid, domain) {
            return i18n.dcnpgettext.apply(
                i18n,
                [domain, undefined, msgid, undefined, undefined].concat(
                    Array.prototype.slice.call(arguments, 1)
                )
            );
        };
        {% set json_filename = find_mo_filename(package_name='webgrid', extension='json', localedir='static/i18n') %}
        {% if json_filename %}
            {# strip off the leading 'static/' portion of the filename #}
            {% set json_filename = json_filename[7:] %}
        $.getJSON(
            '{{ url_for("webgrid.static", filename=json_filename) }}'
        ).then(function (result) {
            i18n.loadJSON(result, 'webgrid');
        });
        {% endif %}
    </script>
    <script src="{{url_for('webgrid.static', filename='webgrid.js')}}"></script>
    <script src="{{url_for('webgrid.static', filename='jquery.multiple.select.js')}}"></script>
{% endblock %}
