Improvements to user management

This commit is contained in:
Ross
2022-11-14 14:25:24 +00:00
parent 02eb812122
commit 6e6ba178b5
27 changed files with 515 additions and 20 deletions
+1
View File
@@ -22,6 +22,7 @@
<a href="{% url 'generic:cid_group_view' %}">Cid Groups</a> /
<a href="{% url 'generic:user_group_view' %}">User Groups</a> /
<a href="{% url 'accounts_list' %}">Manage Users</a> /
<a href="{% url 'generic:supervisor' %}">Manage Supervisors</a>
{% endif %}
{% endblock %}
@@ -91,13 +91,13 @@
<summary>Email results</summary>
User results emailed: {{exam.exam_results_emailed|default:"Never"}}<br/>
<button id="email-results-button"
title="Email results to users and their supervisors"
title="Email results to users and their supervisor"
hx-get="{% url exam.app_name|add:':exam_report_email' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
hx-prompt="Please enter an additional email to send to (user and supervisor will automatically be used if available) if required"
>Email user results</button>
<button id="email-unsent-results-button" title="Email results to users and their supervisors"
<button id="email-unsent-results-button" title="Email results to users and their supervisor"
hx-get="{% url exam.app_name|add:':exam_report_email_unsent' exam_id=exam.pk %}"
hx-target="#user-details"
hx-confirm="This will email results, please make sure scores have been refreshed before continuing"
+12
View File
@@ -0,0 +1,12 @@
{% extends 'generic/base.html' %}
{% block navigation %}
{{block.super}}
<br/>
Supervisors: <a href="{% url 'generic:supervisor' %}">View all</a>
<a href="{% url 'generic:supervisor_create' %}">Create new</a>
{% endblock %}
{% block js %}
{% endblock %}
+27
View File
@@ -0,0 +1,27 @@
{% extends 'generic/supervisor_base.html' %}
{% block content %}
<h2>Supervisor: {{object.name}}</h2>
{{object.email}}
<br/>User account: {{object.user}}
<br/>Site: {{object.site}}
<br/>Trainee(s): {% for trainee in object.trainee.all %}
<a href="{% url 'account_profile' trainee.user.username %}">{{trainee.user}}
{% endfor %}
<div>
<a href="{% url 'generic:supervisor_edit' pk=object.pk %}"> Edit</a>
<a href="{% url 'generic:supervisor_delete' pk=object.pk %}"> Delete</a>
</div>
{% endblock %}
{% block js %}
<style>
td, th { padding-left: 10px }
</style>
{% endblock %}
@@ -0,0 +1,32 @@
{% extends "generic/supervisor_base.html" %}
<!-- {% load static from static %} -->
{% block css %}
<style>
</style>
{% endblock %}
{% block js %}
<!--<script type="text/javascript" src="/admin/jsi18n/"></script>-->
{{form.media}}
<script type="text/javascript">
</script>
<!-- {{ form.media }} -->
{% endblock %}
{% block content %}
<h2>Edit Supervisor / {{object.cid}}</h2>
Use this form to create / edit a supervisor
{% if errors %}
<div class="alert alert-info" role="alert">{{errors}}</a></div>
{% endif %}
<form action="" method="post" enctype="multipart/form-data" id="condition-form">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
{% endblock %}
+20
View File
@@ -0,0 +1,20 @@
{% extends 'generic/supervisor_base.html' %}
{% block content %}
<h2>Supervisors</h2>
<ul>
{% for supervisor in object_list %}
<li><a href="{% url 'generic:supervisor_detail' pk=supervisor.pk %}">Supervisor: {{supervisor.name}}</a>
<br/>{{supervisor.email}}
</li>
{% endfor %}
</ul>
{% endblock %}
{% block js %}
<style>
td, th { padding-left: 10px }
</style>
{% endblock %}
+29
View File
@@ -0,0 +1,29 @@
{% extends "generic/base.html" %}
<!-- {% load static from static %} -->
{% block css %}
{% endblock %}
{% block js %}
<!--<script type="text/javascript" src="/admin/jsi18n/"></script>-->
{{form.media}}
<script type="text/javascript">
</script>
<!-- {{ form.media }} -->
{% endblock %}
{% block content %}
<h2>Edit User / {{ciduser.cid}}</h2>
Use this form to create a user.
{% if errors %}
<div class="alert alert-info" role="alert">{{errors}}</a></div>
{% endif %}
<form action="" method="post" enctype="multipart/form-data" id="condition-form">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
{% endblock %}