[paperwork] Add very basic per-member certification view
This commit is contained in:
parent
c23397c102
commit
f3a262f56f
@ -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/",
|
||||
|
31
paperwork/templates/paperwork/member_certifications.dj.html
Normal file
31
paperwork/templates/paperwork/member_certifications.dj.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% extends "base.dj.html" %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
You have been issued the following Claremont MakerSpace Member Certifications:
|
||||
</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Certification</th>
|
||||
<th>Version</th>
|
||||
<th>Department</th>
|
||||
<th>Certified By</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for certification in certifications %}
|
||||
<tr>
|
||||
<td>{{ certification.certification_version.definition.certification_name }}</td>
|
||||
<td>{{ certification.certification_version.version }}</td>
|
||||
<td>{{ certification.certification_version.definition.department }}</td>
|
||||
<td>{{ certification.certified_by }}</td>
|
||||
<td>{{ certification.date }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
13
paperwork/urls.py
Normal file
13
paperwork/urls.py
Normal file
@ -0,0 +1,13 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "paperwork"
|
||||
|
||||
urlpatterns = [
|
||||
path(
|
||||
"certifications/by_uid/<str:uid>",
|
||||
views.member_certifications,
|
||||
name="member_certifications",
|
||||
),
|
||||
]
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user