diff --git a/cmsmanage/urls.py b/cmsmanage/urls.py index d119c4b..a9eb61a 100644 --- a/cmsmanage/urls.py +++ b/cmsmanage/urls.py @@ -23,6 +23,7 @@ urlpatterns = [ path("", lambda request: redirect("/tasks/"), name="root"), path("tasks/", include("tasks.urls")), path("rentals/", include("rentals.urls")), + path("paperwork/", include("paperwork.urls")), path("admin/", admin.site.urls), path( "auth/", diff --git a/paperwork/templates/paperwork/member_certifications.dj.html b/paperwork/templates/paperwork/member_certifications.dj.html new file mode 100644 index 0000000..ddf2a65 --- /dev/null +++ b/paperwork/templates/paperwork/member_certifications.dj.html @@ -0,0 +1,31 @@ +{% extends "base.dj.html" %} + +{% block content %} +

+ You have been issued the following Claremont MakerSpace Member Certifications: +

+
+ + + + + + + + + + + + {% for certification in certifications %} + + + + + + + + {% endfor %} + +
CertificationVersionDepartmentCertified ByDate
{{ certification.certification_version.definition.certification_name }}{{ certification.certification_version.version }}{{ certification.certification_version.definition.department }}{{ certification.certified_by }}{{ certification.date }}
+
+{% endblock %} diff --git a/paperwork/urls.py b/paperwork/urls.py new file mode 100644 index 0000000..1527d01 --- /dev/null +++ b/paperwork/urls.py @@ -0,0 +1,13 @@ +from django.urls import path + +from . import views + +app_name = "paperwork" + +urlpatterns = [ + path( + "certifications/by_uid/", + views.member_certifications, + name="member_certifications", + ), +] diff --git a/paperwork/views.py b/paperwork/views.py index 91ea44a..c833056 100644 --- a/paperwork/views.py +++ b/paperwork/views.py @@ -1,3 +1,12 @@ from django.shortcuts import render -# Create your views here. +from membershipworks.models import Member +from .models import Certification + + +def member_certifications(request, uid: str): + context = { + "member": Member.objects.get(uid=uid), + "certifications": Certification.objects.filter(member_id=uid), + } + return render(request, "paperwork/member_certifications.dj.html", context)