Added results CRUD and result detailed view
This commit is contained in:
@@ -1 +1,138 @@
|
||||
{% extends "admin/components/base.html" %}
|
||||
{% extends "admin/components/datatable.html" %}
|
||||
{% block title %} SKA Referee Test | View Results {% endblock %}
|
||||
{% block content %}
|
||||
{% include "admin/components/client-alerts.html" %}
|
||||
<h1>View Results</h1>
|
||||
{% if entries %}
|
||||
<table id="results-table" class="table table-striped" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-priority="1">
|
||||
Name
|
||||
</th>
|
||||
<th data-priority="4">
|
||||
Club
|
||||
</th>
|
||||
<th data-priority="5">
|
||||
Exam Code
|
||||
</th>
|
||||
<th data-priority="3">
|
||||
Status
|
||||
</th>
|
||||
<th data-priority="4">
|
||||
Submitted
|
||||
</th>
|
||||
<th data-priority="2">
|
||||
Result
|
||||
</th>
|
||||
<th data-priority="3">
|
||||
Grade
|
||||
</th>
|
||||
<th data-priority="1">
|
||||
Details
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
<tr class="table-row">
|
||||
<td>
|
||||
{{ entry.name.surname }}, {{ entry.name.first_name }}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'club' in entry %}
|
||||
{{ entry.club }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ '—'.join([entry.test_code[:4], entry.test_code[4:8], entry.test_code[8:]]) }}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'status' in entry %}
|
||||
{{ entry.status }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'submission_time' in entry %}
|
||||
{{ entry.submission_time.strftime('%d %b %Y') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'results' in entry %}
|
||||
{{ entry.results.score }}%
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'results' in entry %}
|
||||
{{ entry.results.grade }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="row-actions">
|
||||
<a
|
||||
href="{{ url_for('admin_views.view_entry', _id = entry._id ) }}"
|
||||
class="btn btn-primary entry-details"
|
||||
data-_id="{{entry._id}}"
|
||||
title="View Details"
|
||||
>
|
||||
<i class="bi bi-file-medical-fill button-icon"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-primary alert-db-empty">
|
||||
<i class="bi bi-info-circle-fill" aria-title="Alert" title="Alert"></i>
|
||||
There are no exam attempts to view.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% if entries %}
|
||||
{% block custom_data_script %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#results-table').DataTable({
|
||||
'searching': false,
|
||||
'columnDefs': [
|
||||
{'sortable': false, 'targets': [7]},
|
||||
{'searchable': false, 'targets': [7]}
|
||||
],
|
||||
'order': [[4, 'desc'], [0, 'asc']],
|
||||
'buttons': [
|
||||
{
|
||||
extend: 'print',
|
||||
exportOptions: {
|
||||
columns: [0, 1, 3, 4, 5, 6]
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
exportOptions: {
|
||||
columns: [0, 1, 3, 4, 5, 6]
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
exportOptions: {
|
||||
columns: [0, 1, 3, 4, 5, 6]
|
||||
}
|
||||
}
|
||||
],
|
||||
'responsive': 'true',
|
||||
'colReorder': 'true',
|
||||
'fixedHeader': 'true',
|
||||
'searchBuilder': {
|
||||
depthLimit: 2,
|
||||
columns: [1, 5, 6],
|
||||
},
|
||||
dom: 'BQlfrtip'
|
||||
});
|
||||
// $('.buttons-pdf').html('<span class="glyphicon glyphicon-file" data-toggle="tooltip" title="Export To Excel"/>') -->
|
||||
} );
|
||||
$('#results-table').show();
|
||||
$(window).trigger('resize');
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endif %}
|
Reference in New Issue
Block a user