Complete supervisor model and start improving forms

This commit is contained in:
Ross
2022-11-28 09:50:07 +00:00
parent 653baa85ff
commit 747bf93373
27 changed files with 309 additions and 183 deletions
@@ -6,7 +6,7 @@
<a href="{% url 'generic:cid_group_create' %}">Create new group</a>
</p>
{% for group in groups %}
<p><a href="{% url 'generic:cid_group_detail' group.pk %}">{{group.name}}</a>
<p><a href="{% url 'generic:cid_group_detail' group.pk %}"><h4>{{group.name}}</h4></a>
<button class="small-url-button" data-url="{% url 'generic:group_email' pk=group.pk %}
">Email candidate details</button>
<button class="small-url-button" data-url="{% url 'generic:group_email_resend' pk=group.pk %}
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'generic/base.html' %}
{% load crispy_forms_tags %}
{% load render_table from django_tables2 %}
{% block css %}
{% endblock %}
@@ -12,7 +13,7 @@
<h3>Filter CID Users </h3>
</summary>
<form action="" method="get">
{{ filter.form }}
{{ filter.form |crispy}}
<input class="btn btn-primary btn-sm mt-1 mb-1" type="submit" />
</form>
</details>
@@ -28,13 +28,19 @@
</table>
<input type="submit" class="submit-button" value="Submit" name="submit">
<p>Users can be added to the group <a href="{% url 'generic:manage_cids' %}">here</a></p>
<h3>Users</h3>
{% if cidusergroup.GetGroupUsers %}
{{cidusergroup.GetGroupUsers}}
{% else %}
No users currently added to group.
{% endif %}
<ul>
{% for user in cidusergroup.ciduser_set.all %}
<li><a href="{% url 'generic:update_cid' user.pk %}">{{user.cid}}</a>: {{user.name}} [{{user.email}} {{user.last_name}}] {{user.userprofile.grade}}</li>
{% empty %}
<li>Group currently has no users.</li>
{% endfor %}
</ul>
Count: {{cidusergroup.ciduser_set.count}}
</form>
@@ -20,7 +20,7 @@
{% endfor %}
</ol>
{% else %}
This exam is not associated with any user groups. Edit and add a group to enable user management.
This exam is not associated with any user groups. <a href="{% url exam.app_name|add:':exam_update' exam.pk %}">Edit and add a group</a> to enable user management.
{% endif %}
<script>
@@ -1,5 +1,6 @@
{% extends "generic/supervisor_base.html" %}
<!-- {% load static from static %} -->
{% load crispy_forms_tags %}
{% block css %}
<style>
@@ -25,7 +26,7 @@ Use this form to create / edit a supervisor
{% csrf_token %}
<table>
{{ form.as_table }}
{{ form|crispy }}
</table>
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
@@ -5,8 +5,8 @@
<ul>
{% for supervisor in object_list %}
<li><a href="{% url 'generic:supervisor_detail' pk=supervisor.pk %}">Supervisor: {{supervisor.name}}</a>
<br/>{{supervisor.email}}
<li><a href="{% url 'generic:supervisor_detail' pk=supervisor.pk %}">{{supervisor.name}}</a>
<br/>{{supervisor.email}} [{{supervisor.site}}]
</li>
{% endfor %}
</ul>
@@ -1,7 +0,0 @@
<h2>Exam: {{ exam.name }}</h2>
<h3>Candidate: {{ cid|default_if_none:request.user.username }}</h3>
{% if view_all_results %}
<div class="alert alert-info" role="alert">
Exam state: Active [{{exam.active}}] / Published [{{exam.publish_results}}]
</div>
{% endif %}
@@ -1,5 +1,6 @@
{% extends "generic/base.html" %}
<!-- {% load static from static %} -->
{% load crispy_forms_tags %}
{% block css %}
{% endblock %}
@@ -18,29 +19,32 @@
{% else %}
<h2>Add New Group</h2>
{% endif %}
Use this form to create / edit a CID user group.
<form action="" method="post" enctype="multipart/form-data" id="condition-form">
Use this form to create / edit a User group.<br/>
<form action="" method="post" enctype="multipart/form-data" id="condition-form" class="inline-form">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
{{ form|crispy }}
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
<div>
<h3>Users</h3>
<ul>
{% for user in userusergroup.users.all %}
<li>{{user}}</li>{% empty %}
<li><a href="{% url 'account_profile' user.username %}">{{user.username}}</a> [{{user.first_name}} {{user.last_name}}] {{user.userprofile.grade}}</li>
{% empty %}
<li>Group currently has no users.</li>
{% endfor %}
</ul>
Count: {{userusergroup.users.count}}
</div>
{% comment %} {% if userusergroup.users.all %}
{% comment %} {% if userusergroup.users.all %}
{{userusergroup.GetGroupUsers}}
{% else %}
No users currently added to group.
{% endif %} {% endcomment %}
</form>
{% endblock %}