{% extends "wagtailadmin/generic/base.html" %}
{% load wagtailusers_tags i18n %}

{% block extra_css %}
    {{ block.super }}

    {{ form_media.css }}
{% endblock %}

{% block main_content %}
    <form action="{% url 'wagtailusers_groups:add' %}" method="POST" novalidate>
        {% csrf_token %}

        <ul class="fields">
            {% block fields %}
                <li>
                    {% include "wagtailadmin/shared/field.html" with field=form.name %}
                </li>
                {% block extra_fields %}{% endblock extra_fields %}
            {% endblock fields %}
            <li>
                {% format_permissions permission_bound_field=form.permissions %}
            </li>
            {% for panel in permission_panels %}
                <li>
                    {{ panel.as_admin_panel }}
                </li>
            {% endfor %}
            <li><input type="submit" value="{% trans 'Add group' %}" class="button" /></li>
        </ul>
    </form>
{% endblock %}

{% block extra_js %}
    {{ block.super }}
    {% include "wagtailusers/groups/includes/group_form_js.html" %}
{% endblock %}
