Skip to content

Commit

Permalink
examiner: Add course count to search template
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobGM committed Jan 26, 2019
1 parent 17a42d3 commit d89f188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examiner/templates/examiner/search.html
Expand Up @@ -23,7 +23,7 @@ <h1 class="my-2" style="font-size: 3em; font-weight: bold;">
</h1>
<h4 id="exam-count" style="color: grey;">
<i>
{{ exam_count }} eksamener
{{ exam_count }} PDFer, {{ course_count }} fag
</i>
</h4>

Expand Down
5 changes: 5 additions & 0 deletions examiner/views.py
Expand Up @@ -143,6 +143,11 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
add_context(request=self.request, context=context)
context['exam_count'] = Pdf.objects.count()
context['course_count'] = (
DocumentInfoSource
.objects.distinct('document_info__course_code')
.count()
)
return context


Expand Down

0 comments on commit d89f188

Please sign in to comment.