Added glossary and acknowledgement pages, and reworked the structure of the theory pages.

This commit is contained in:
2014-03-01 23:08:25 +10:00
parent adb505cc93
commit 5657a9cb38
13 changed files with 219 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ from django.views import generic
from itertools import chain
from operator import attrgetter
from three_d_viewer.models import Sample, Category, Mineral
from three_d_viewer.models import Sample, Category, Mineral, GlossaryEntry
register = template.Library()
@@ -137,4 +137,13 @@ class FossilDetailView(generic.DetailView):
result = chain(result, child.active_samples)
context['active_samples'] = sorted(result, key=attrgetter('name'))
return context
return context
class GlossaryView(generic.ListView):
model = GlossaryEntry
template_name = 'three_d_viewer/glossary.html'
def get_context_data(self, **kwargs):
context = super(GlossaryView, self).get_context_data(**kwargs)
context['entries'] = GlossaryEntry.objects.all()
return context