148 lines
7.9 KiB
HTML
148 lines
7.9 KiB
HTML
{% extends "admin/components/base.html" %}
|
|
|
|
{% block content %}
|
|
<h1>Dashboard</h1>
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-sm">
|
|
<div class="card m-3">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Current Exams</h5>
|
|
{% if current_tests %}
|
|
<div class="card-text">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Exam Code
|
|
</th>
|
|
<th>
|
|
Expiry Date
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for test in current_tests %}
|
|
<tr>
|
|
<td>
|
|
<a href="{{ url_for('admin._view_test', id=test.id) }}">{{ test.get_code() }}</a>
|
|
</td>
|
|
<td>
|
|
{{ test.end_date.strftime('%d %b %Y') }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<a href="{{ url_for('admin._tests', filter='active') }}" class="btn btn-primary">View Exams</a>
|
|
{% else %}
|
|
<div class="alert alert-primary">
|
|
There are currently no active exams.
|
|
</div>
|
|
<a href="{{ url_for('admin._tests', filter='create') }}" class="btn btn-primary">Create Exam</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm">
|
|
<div class="card m-3">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Recent Results</h5>
|
|
{% if recent_results %}
|
|
<div class="card-text">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Name
|
|
</th>
|
|
<th>
|
|
Date Submitted
|
|
</th>
|
|
<th>
|
|
Result
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for result in recent_results %}
|
|
<tr>
|
|
<td>
|
|
<a href="{{ url_for('admin._view_entry', id=result.id) }}">{{ result.get_surname() }}, {{ result.get_first_name() }}</a>
|
|
</td>
|
|
<td>
|
|
{{ result.end_time.strftime('%d %b %Y %H:%M') }}
|
|
</td>
|
|
<td>
|
|
{{ (100*result.result['score']/result.result['max'])|round|int }}% ({{ result.result.grade }})
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<a href="{{ url_for('admin._view_entries') }}" class="btn btn-primary">View Results</a>
|
|
{% else %}
|
|
<div class="alert alert-primary">
|
|
There are currently no exam results to preview.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row g-3">
|
|
<div class="col-sm">
|
|
<div class="card m-3">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Upcoming Exams</h5>
|
|
{% if upcoming_tests %}
|
|
<div class="card-text">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
Exam Code
|
|
</th>
|
|
<th>
|
|
Expiry Date
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for test in upcoming_tests %}
|
|
<tr>
|
|
<td>
|
|
<a href="{{ url_for('admin._view_test', id=test.id) }}">{{ test.get_code() }}</a>
|
|
</td>
|
|
<td>
|
|
{{ test.end_date.strftime('%d %b %Y') }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<a href="{{ url_for('admin._tests', filter='scheduled') }}" class="btn btn-primary">View Exams</a>
|
|
{% else %}
|
|
<div class="alert alert-primary">
|
|
There are currently no upcoming exams.
|
|
</div>
|
|
<a href="{{ url_for('admin._tests', filter='create') }}" class="btn btn-primary">Create Exam</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm">
|
|
<div class="card m-3">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Help</h5>
|
|
<p class="card-text">This web app was developed by Vivek Santayana. If there are any issues with the app, any bugs you need to report, or any features you would like to request, please feel free to <a href="https://git.vsnt.uk/viveksantayana/ska-referee-test/issues">open an issue at the Git Repository</a>.</p>
|
|
<a href="https://git.vsnt.uk/viveksantayana/ska-referee-test/issues" class="btn btn-primary">Open an Issue</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |