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

{% block title %}
    {% blocktrans trimmed with assignmentname=assignment.long_name %}
        Examiners on {{ assignmentname }}
    {% endblocktrans %}
{% endblock title %}

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

{% block pageheader-inner %}
    <a href="{% cradmin_instance_appindex_url 'overview' %}" class="devilry-page-header-backlink">
        <span class="sr-only">
            {% trans "Back to assignment overview" %}
        </span>
        <span class="{% cradmin_icon 'devilry-pageheader-back' %}" aria-hidden="true"></span>
    </a>
    <h1>
        {% blocktrans trimmed with assignmentname=assignment.long_name %}
            Examiners on {{ assignmentname }}
        {% endblocktrans %}
    </h1>
    <p>
        {% trans "You can bulk-organize examiners using the button below, or click on an examiner to manually organize students for each examiner." %}
    </p>
{% endblock pageheader-inner %}

{% block content %}
    {% if students_without_examiners_exists %}
        <div class="container">
            <div class="devilry-dashboard-container">
                <p id="id_devilry_admin_assignment_examineroverview" class="alert-paragraph">
                    <span class="alert-paragraph__title alert-paragraph__title--warning">
                        {% trans 'warning' %}:
                    </span>
                    <strong>
                        {% trans 'There are still students on the assignment with no examiners assigned to them' context 'devilry admin assignment examineroverview' %}
                    </strong>
                </p>
            </div>
        </div>
    {% endif %}
    {% if examiner_count == 0 %}
        <div class="container">
            <div id="devilry_admin_assignment_examiners_overview_no_relatedexaminers"
                    class="alert alert-warning devilry-alert-with-button">
                <p>
                    {% blocktrans trimmed with period=assignment.period.get_path %}
                        You have no users registered as examiner for {{ period }}. You need to add users
                        as examiners on the semester page for the course before you can use them as examiners
                        for assignments.
                    {% endblocktrans %}
                </p>
                <a href="{% cradmin_url instanceid='devilry_admin_periodadmin' appname='examiners' roleid=assignment.period.id viewname='INDEX' %}"
                        class="btn btn-default">
                    {% trans "Add examiners" %}
                </a>
            </div>
        </div>
    {% else %}
        <div class="container">
            <p id="devilry_admin_assignment_examiners_overview_buttonbar"
                    class="devilry-buttonbar">
                <a id="devilry_admin_assignment_examiners_overview_button_bulk_organize_examiners"
                        class="btn btn-default"
                        href="{% cradmin_instance_appindex_url 'bulk_organize_examiners' %}">
                    {% trans "Bulk-organize examiners" %}
                </a>
            </p>
        </div>

        {{ block.super }}

        <div class="container">
            <div class="row">
                <div class="col-sm-8 col-lg-9">
                    <p class="devilry-listbuilderlist-footer">
                        {% blocktrans trimmed with period=assignment.period.get_path %}
                            Only users registered as examiner for {{ period }} is available as examiners for assignments.
                        {% endblocktrans %}
                        <a href="{% cradmin_url instanceid='devilry_admin_periodadmin' appname='examiners' roleid=assignment.period.id viewname='INDEX' %}">
                            {% trans "Add more examiners" %}</a>.
                    </p>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock content %}
