{% extends "cradmin_legacy/viewhelpers/listbuilderview/filterlist-left.django.html" %}
{% load cradmin_legacy_tags %}
{% load cradmin_legacy_icon_tags %}
{% load crispy_forms_tags %}
{% load i18n %}

{% block pageheader-outer-extraclasses %}
    {{ block.super }}
    devilry-page-header-with-backlink
{% endblock %}

{% block pageheader-inner %}
    <a href="{% cradmin_appindex_url %}" class="devilry-page-header-backlink">
        <span class="sr-only">
            {% trans "Back to add students overview" %}
        </span>
        <span class="{% cradmin_icon 'devilry-pageheader-back' %}" aria-hidden="true"></span>
    </a>
    {{ block.super }}
{% endblock pageheader-inner %}

{% block content %}
    <div class="container">
        <div class="devilry-dashboard-container devilry-dashboard-container-withtopmargin">
            <p>
                {% blocktrans trimmed with from_assignment=from_assignment.long_name context='admin delete groups confirm' %}
                    The students listed below are the students on the current assignment that failed
                    {{ from_assignment }}, and are ready to be deleted. Students will not be included if
                {% endblocktrans %}:
            </p>
            <dl class="devilry-dl-indented devilry-dl-sm">
                <dt>
                    {% blocktrans trimmed with context='admin delete groups confirm' %}
                        The group has already been corrected
                    {% endblocktrans %}
                </dt>
                <dd>
                    <p>
                        {% blocktrans trimmed with context='admin delete groups confirm' %}
                            If a group on the current assignment has already been corrected
                            (or has been given a new attempt).
                        {% endblocktrans %}
                    </p>
                </dd>
                <dt>
                    {% blocktrans trimmed with context='admin delete groups confirm' %}
                        The group has public comment activity by students or examiners
                    {% endblocktrans %}
                </dt>
                <dd>
                    <p>
                        {% blocktrans trimmed with context='admin delete groups confirm' %}
                            If a group on the current assignment has public comments by either the students, examiners
                            or both. Drafted comments, comments by admins and comments only visible to examiners and
                            admins are not considered public comment activity.
                        {% endblocktrans %}
                    </p>
                </dd>
                <dt>
                    {% blocktrans trimmed with context='admin delete groups confirm' %}
                        The group has more than one student
                    {% endblocktrans %}
                </dt>
                <dd>
                    <p>
                        {% blocktrans trimmed with context='admin delete groups confirm' %}
                            If a project group on the current assignment has more than one student
                            (a collaborative group). You can still delete this project group manually, or split and then
                            delete if you only want to delete one of the students in the project group.
                        {% endblocktrans %}
                    </p>
                </dd>
            </dl>
            <p>
                <a href="{% cradmin_appurl viewname='manual_select' %}">{% trans 'Manually delete groups' context 'admin delete groups confirm' %}</a>
            </p>
        </div>
    </div>
    {% if no_groups_found %}
        <div class="container cradmin-legacy-container-focus cradmin-legacy-container-focus-warning
                    devilry-admin-delete-groups-confirm-no-groups">
            {% trans "No students found." %}
        </div>
    {% else %}
        <div class="container">
            <div class="devilry-dashboard-container">
                <strong>
                    <p>
                        {% blocktrans trimmed with delete_count=num_to_be_deleted total_count=num_candidates_total num_excluded=num_excluded context='admin delete groups confirm' %}
                            {{ delete_count }} students can be deleted. {{ num_excluded }} students have been excluded.
                        {% endblocktrans %}
                    </p>
                </strong>
            </div>
        </div>
        {{ block.super }}
        <div class="container text-right">
            {% crispy form formhelper %}
        </div>
    {% endif %}
{% endblock content %}