Add CidUserExam management features: forms, views, and templates for exam records
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{% extends "generic/base.html" %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Edit CidUserExam record</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<button class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -21,17 +21,25 @@
|
||||
<ol class="cid-candidate-list">
|
||||
{% for cid in cid_users %}
|
||||
|
||||
<li class="cid-user" data-cid={{cid.cid}}><div class="cid-data">
|
||||
<i class="bi bi-clock-history"
|
||||
title="View user exam history"
|
||||
hx-get="{% url exam.app_name|add:':exam_user_status_cid' exam.id cid.cid %}"
|
||||
hx-target=".modal-content"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#history-modal"
|
||||
_="on htmx:afterOnLoad put {{cid.cid}} into #history-user.innerHTML "
|
||||
></i>
|
||||
<a href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a> [{{cid.passcode}}]</div><div class="cid-name">{{cid.name}}</div> <div class="cid-email">Email: {{cid.email}}</div>
|
||||
</li>
|
||||
<li class="cid-user" data-cid={{cid.cid}}>
|
||||
<div class="cid-data d-flex align-items-center">
|
||||
<i class="bi bi-clock-history me-2"
|
||||
title="View user exam history"
|
||||
hx-get="{% url exam.app_name|add:':exam_user_status_cid' exam.id cid.cid %}"
|
||||
hx-target=".modal-content"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#history-modal"
|
||||
_="on htmx:afterOnLoad put {{cid.cid}} into #history-user.innerHTML "
|
||||
></i>
|
||||
<span class="d-inline-flex align-items-center flex-nowrap">
|
||||
<a class="cid-link me-1" href="{% url 'generic:update_cid' cid.pk %}">{{cid.cid}}</a>
|
||||
<span class="text-muted">[{{cid.passcode}}]</span>
|
||||
<a title="View CID exam details" class="ms-2 d-inline-block cid-detail-link" hx-get="{% url 'generic:cid_user_exam_partial' exam.app_name exam.id cid.cid %}" hx-target=".modal-content" data-bs-toggle="modal" data-bs-target="#history-modal" role="button"><i class="bi bi-box-arrow-up-right"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cid-name">{{cid.name}}</div>
|
||||
<div class="cid-email">Email: {{cid.email}}</div>
|
||||
</li>
|
||||
|
||||
{% endfor %}
|
||||
</ol>
|
||||
@@ -132,6 +140,11 @@
|
||||
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
/* Ensure action links are inline-block and don't overlap following content */
|
||||
.cid-data .cid-detail-link, .cid-data .cid-link { display: inline-block; }
|
||||
.cid-name { margin-top: 0.25rem; }
|
||||
</style>
|
||||
{% endblock js %}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="p-3">
|
||||
<h4>CidUserExam: {% if cid_user_exam.cid_user %}{{ cid_user_exam.cid_user.cid }}{% elif cid_user_exam.user_user %}{{ cid_user_exam.user_user.username }}{% else %}-{% endif %}</h4>
|
||||
<table class="table table-sm">
|
||||
<tbody>
|
||||
<tr><th>CID</th><td>{% if cid_user_exam.cid_user %}{{ cid_user_exam.cid_user.cid }}{% else %}-{% endif %}</td></tr>
|
||||
<tr><th>User</th><td>{% if cid_user_exam.user_user %}{{ cid_user_exam.user_user.username }}{% else %}-{% endif %}</td></tr>
|
||||
<tr><th>Start time</th><td>{{ cid_user_exam.start_time }}</td></tr>
|
||||
<tr><th>End time</th><td>{{ cid_user_exam.end_time }}</td></tr>
|
||||
<tr><th>Completed</th><td>{{ cid_user_exam.completed }}</td></tr>
|
||||
<tr><th>Manual submission</th><td>{{ cid_user_exam.manual_submission }}</td></tr>
|
||||
<tr><th>Share with supervisor</th><td>{{ cid_user_exam.share_with_supervisor }}</td></tr>
|
||||
<tr><th>Results emailed status</th><td>{{ cid_user_exam.results_emailed_status }}</td></tr>
|
||||
<tr><th>CID User email</th><td>{% if cid_user_exam.cid_user %}{{ cid_user_exam.cid_user.email }}{% else %}-{% endif %}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex justify-content-end">
|
||||
{% if cid_user_exam %}
|
||||
<a class="btn btn-sm btn-outline-primary me-2" href="{% url 'generic:update_cid_user_exam' cid_user_exam.pk %}">Edit</a>
|
||||
{% endif %}
|
||||
<button class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user