{% extends "wagtailadmin/base.html" %}
{% load i18n %}
{% block titletag %}{% trans "Delete group" %}{% endblock %}
{% block bodyclass %}menu-groups{% endblock %}

{% block content %}
    {% trans "Delete group" as del_str %}
    {% include "wagtailadmin/shared/header.html" with title=del_str subtitle=group.name icon="group" %}

    <div class="row row-flush nice-padding">
        <div class="col6">
            <p>
                {% blocktrans with group_user_count=group.user_set.count group_name=group.name %}The group '{{ group_name }}' has <strong>{{ group_user_count }}</strong> users assigned.{% endblocktrans %}
            </p>
            <p>
                {% if group.user_set.count %}
                    If you delete the group, those users will lose the permissions
                    granted to them by membership of this group, but retain
                    permissions they have through membership of other groups.
                {% else %}
                    It is probably safe to delete.
                {% endif %}
            </p>
        </div>
        <div class="col6">
            <p>{% trans "Are you sure you want to delete this group?" %}</p>
            <form action="{% url 'wagtailusers_groups_delete' group.id %}" method="POST">
                {% csrf_token %}
                <input type="submit" value="{% trans 'Yes, delete' %}" class="serious" />
            </form>
        </div>
    </div>
{% endblock %}
