tjdests/tjdests/templates/destinations/student_list.html
2021-04-27 20:55:02 -04:00

144 lines
7.7 KiB
HTML

{% extends "base.html" %}
{% load bootstrap_pagination %}
{% block content %}
<h2>Student Destinations</h2>
<p><b>Note</b>: All data is self-reported. We do not make any claim as to the accuracy of this data.</p>
{% if college or search_query %}
<p>
Only showing students {% if college %}reporting applications to {{ college }}
{% if search_query %}and {% endif %}{% endif %}{% if search_query %}matching {{ search_query }}{% endif %}.
Navigate <a href="{% url "destinations:students" %}">here</a> to reset.
</p>
{% endif %}
<div class="container pb-3">
<form method="get">
<div class="form-floating mb-3">
<div class="input-group">
<div class="input-group-text"><label for="search"><i class="fas fa-search" aria-label="Search"></i></label></div>
{% if college %}<input type="hidden" name="college" value="{{ college.id }}">{% endif %}
<input type="search" name="q" placeholder="Search" id="search" data-toggle="tooltip" data-bs-placement="bottom" title="Filter by first name, last name, and biography" aria-label="Search" class="form-control" value="{{ search_query }}">
</div>
</div>
</form>
</div>
<div class="row py-3">
<div class="col justify-content-center">
{% bootstrap_paginate page_obj range=10 extra_pagination_classes="justify-content-center flex-wrap" %}
</div>
</div>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Test scores</th>
<th scope="col">Biography</th>
<th scope="col">Decisions</th>
</tr>
</thead>
<tbody>
{% for senior in object_list %}
<tr>
<td>{{ senior }}</td>
<td>
{# Test scores #}
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Test</th>
<th scope="col">Score</th>
</tr>
</thead>
<tbody>
{% for score in senior.testscore_set.all %}
<tr>
<td>{{ score.get_exam_type_display }}</td>
<td>{{ score.exam_score }}</td>
</tr>
{% empty %}
<tr>
<td>There are no test scores to display.</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
<td class="text-wrap text-break" style="max-width: 400px;">{{ senior.biography|striptags|linebreaks }}</td>
<td>
{# Decisions #}
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Type<br>Result</th>
<th scope="col">College Name</th>
</tr>
</thead>
<tbody>
{% for decision in senior.decision_set.all %}
<tr>
<td class="d-flex-inline">
<span class="justify-content-center d-flex pb-1" data-toggle="tooltip" title="{{ decision.get_decision_type_display }}" aria-label="{{ decision.get_decision_type_display }}">{{ decision.decision_type }}</span>
<div class="justify-content-center d-flex">
{# First, the deferred indicator #}
{% if "DEFER" in decision.admission_status %}
<i class="fas fa-clock ps-1" data-toggle="tooltip" title="Deferred" aria-label="Deferred"></i>
{% endif %}
{# Now, the waitlist indicator #}
{% if "WAITLIST" in decision.admission_status or "WL" in decision.admission_status %}
<i class="fas fa-clipboard-list ps-1" data-toggle="tooltip" title="Waitlisted" aria-label="Waitlisted"></i>
{% endif %}
{# Admits #}
{% if "ADMIT" in decision.admission_status %}
{# Accepts get a different check #}
{% if senior.attending_decision == decision %}
<i class="fas fa-check-double ps-1" data-toggle="tooltip" title="Accepted, attending" aria-label="Accepted, attending"></i>
{% else %}
<i class="fas fa-check ps-1" data-toggle="tooltip" title="Accepted" aria-label="Accepted"></i>
{% endif %}
{% endif %}
{# Rejects #}
{% if "DENY" in decision.admission_status %}
<i class="fas fa-times ps-1" data-toggle="tooltip" title="Denied" aria-label="Denied"></i>
{% endif %}
</div>
</td>
<td>{{ decision.college.name }}<br>{{ decision.college.location }}</td>
</tr>
{% empty %}
<tr>
<td>There are no decisions to display.</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
</tr>
{% empty %}
<tr>
<td>There is no data to display.</td>
<td></td>
<td></td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row py-3">
<div class="col justify-content-center">
{% bootstrap_paginate page_obj range=10 extra_pagination_classes="justify-content-center flex-wrap" %}
</div>
</div>
{% endblock %}