from karmaworld.apps.courses.forms import CourseForm
from karmaworld.apps.courses.models import Course
from karmaworld.apps.courses.models import School
+from karmaworld.apps.notes.models import Note
class CourseListView(ListView, ModelFormMixin, ProcessFormView):
""" Add the CourseForm to ListView context """
# get the original context
context = super(CourseListView, self).get_context_data(**kwargs)
+ # get the total number of notes
+ context['note_count'] = Note.objects.count()
+ # get the course form for the form at the bottom of the homepage
context['course_form'] = kwargs.get('course_form', CourseForm())
if context['course_form'].errors:
# if there was an error in the form
<div class="row">
<div id="subhead" class="ten columns offset-by-one">
<img src='{{ STATIC_URL }}img/noun_project_6858.svg' alt="Pieter J. Smits, from The Noun Project">
- <span>Share and access a growing database of college lecture notes</span>
+ <span>Access a growing database of {{ note_count }} college lecture notes</span>
</div>
</div>
</div>