{% load i18n static %}<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
    {% block extrastyle %}{% endblock %}
    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
    {% block extrahead %}{% endblock %}
    {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head>
{% load i18n %}
<body>

    <div id="container">
        <!-- Header -->
        <div id="header">
            <div id="branding">
                <h1>Student Portal</h1>
            </div>
            {% block usertools %}
            <div id="user-tools">
                {% block welcome-msg %}
                {% trans 'Welcome,' %}
                <strong>{{ applicant.name }}</strong>.
                {% endblock %}
                {% block userlinks %}
                {% if user.has_usable_password %}
                <a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
                {% endif %}
                <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
                {% endblock %}
            </div>
            {% endblock %}
            {% block nav-global %}{% endblock %}
        </div>
        <!-- Content -->
        <div id="content" class="{% block coltype %}colM{% endblock %}">
            {% block content %}
            {% if form.errors %}
            <p style="color: red;">
                Please correct the error{{ form.errors|pluralize }} below.
            </p>
            {% endif %}
            <p> <b>Name:</b> {{applicant.name}}<br>
                <b>Rank:</b> {{applicant.rank}}<br>
                <b>Allocated choice:</b> 
                {% for choice in applicant.alloted_choice.all %}
                    {{choice}}
                {% endfor %}
            </p>
            <form action="/allocation/submit" method="post">{% csrf_token %}

                {{ formset.management_form }}
                {% for form in formset %}
                {{ form }}<br>
                <!-- {{ form.applicant }} {{ form.choice }} {{ form.priority }}<br> -->
                {% endfor %}
                <input type="submit" value="Submit">
            </form>
            {% endblock %}
            <br class="clear" />
        </div>
        <!-- END Content -->

        {% block footer %}<div id="footer"></div>{% endblock %}
    </div>
    
</body>
</html>