diff --git a/generic/admin.py b/generic/admin.py
index b444062b..d1f81ddf 100644
--- a/generic/admin.py
+++ b/generic/admin.py
@@ -17,6 +17,7 @@ from .models import (
UserGrades,
UserProfile,
Supervisor,
+ ExamCollection,
Site
)
@@ -37,4 +38,5 @@ admin.site.register(CidUserGroup)
admin.site.register(UserProfile)
admin.site.register(UserGrades)
admin.site.register(Supervisor)
-admin.site.register(Modality)
\ No newline at end of file
+admin.site.register(Modality)
+admin.site.register(ExamCollection)
\ No newline at end of file
diff --git a/generic/migrations/0012_examcollection_author.py b/generic/migrations/0012_examcollection_author.py
new file mode 100644
index 00000000..d30fafc9
--- /dev/null
+++ b/generic/migrations/0012_examcollection_author.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.1.4 on 2024-01-29 10:11
+
+from django.conf import settings
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('generic', '0011_examcollection'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='examcollection',
+ name='author',
+ field=models.ManyToManyField(blank=True, help_text='Author/Manager(s) of the exam collection', to=settings.AUTH_USER_MODEL),
+ ),
+ ]
diff --git a/generic/models.py b/generic/models.py
index 268320ba..2c20f382 100644
--- a/generic/models.py
+++ b/generic/models.py
@@ -1523,3 +1523,23 @@ class ExamCollection(models.Model):
date = models.DateField(blank=True,null=True)
+ author = models.ManyToManyField(
+ settings.AUTH_USER_MODEL,
+ blank=True,
+ help_text="Author/Manager(s) of the exam collection",
+ )
+
+ def __str__(self):
+ return f"{self.name} [{self.date}]"
+
+ def get_author_objects(self):
+ """Returns a comma seperated text list of authors"""
+ authors = [i for i in self.author.all()]
+ return authors
+
+ def get_authors(self):
+ """Returns a comma seperated text list of authors"""
+ authors = ", ".join([i.username for i in self.author.all()])
+ if not authors:
+ return "None"
+ return authors
\ No newline at end of file
diff --git a/generic/templates/generic/base.html b/generic/templates/generic/base.html
index 5fb8a198..559b5139 100755
--- a/generic/templates/generic/base.html
+++ b/generic/templates/generic/base.html
@@ -22,7 +22,8 @@
Cid Groups /
User Groups /
Manage Users /
- Manage Supervisors
+ Manage Supervisors /
+ Collections
{% endif %}
{% endblock %}
diff --git a/generic/templates/generic/examcollection_base.html b/generic/templates/generic/examcollection_base.html
new file mode 100644
index 00000000..ee20e988
--- /dev/null
+++ b/generic/templates/generic/examcollection_base.html
@@ -0,0 +1,9 @@
+{% extends 'generic/base.html' %}
+
+
+{% block navigation %}
+ {{block.super}}
+
Test
+ {% comment %} Collections / {% endcomment %}
+
+{% endblock %}
\ No newline at end of file
diff --git a/generic/templates/generic/examcollection_detail.html b/generic/templates/generic/examcollection_detail.html
new file mode 100755
index 00000000..512ea833
--- /dev/null
+++ b/generic/templates/generic/examcollection_detail.html
@@ -0,0 +1,15 @@
+{% extends 'generic/examcollection_base.html' %}
+
+{% block content %}
+
+