a few minor changes

This commit is contained in:
Ross
2024-09-01 18:54:27 +01:00
parent 98d45fbdfc
commit cf9b514597
4 changed files with 41 additions and 11 deletions
@@ -1,16 +1,35 @@
<ul>
<h3>Email to send</h3>
<table>
<tr>
<th>Username</th>
<th>Supervisor</th>
</tr>
{% for user in users %}
<tr>
<td>{{user.username}}</td>
<td>{{user.userprofile.supervisor}}</td>
</tr>
{% endfor %}
</table>
<br/>
{% for user, status in status.items %}
<li class='{% if status.0 %}text-success{% else %}text-warning{% endif %}'>
{{user.username}} {% if status.0 %}success{% else %}failed [{{status.1}}]{% endif %} ({{status.2}})
<button hx-get="{% url exam.app_name|add:':exam_user_report_email' exam_id=exam.pk user_id=user.pk %}"
hx-prompt="Enter any additional emails"
hx-confirm="Are you sure you wish to delete your account?"
hx-confirm="Are you sure you wish to resend all emails?"
hx-trigger="click, click from:#resend-all"
>Resend</button>
</li>
{% empty %}
No emails sent.
<p>No emails sent.</p>
{% endfor %}
</ul>
<button id="resend-all">Resend all</button>
@@ -131,7 +131,10 @@
{% block breakdown %}{% endblock breakdown %}
<details>
<details
hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}"
hx-trigger="revealed"
hx-target="#user-details">
<summary>Email results</summary>
User results emailed: {{exam.exam_results_emailed|default:"Never"}}<br/>
<button id="email-results-button"
@@ -149,7 +152,8 @@
>Email unsent user results</button>
<button id="email-results-check-button" title="Check the status of emailed results"
hx-get="{% url exam.app_name|add:':exam_report_email_status' exam_id=exam.pk %}"
hx-target="#user-details">Check email status</button>
hx-trigger="click"
hx-target="#user-details">Refresh email status</button>
<p>Note: currently only works with registered users</p>
<div id="user-details"></div>
</details>