diff options
Diffstat (limited to 'app/utils')
-rw-r--r-- | app/utils/views.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/app/utils/views.py b/app/utils/views.py index f1e947a..b337cc5 100644 --- a/app/utils/views.py +++ b/app/utils/views.py @@ -6,16 +6,15 @@ from django.views.generic import ListView, DetailView from django.apps import apps from django.shortcuts import render from django.template import RequestContext +from django.template.defaultfilters import slugify from media.models import LuxImage, LuxVideo, LuxAudio from recordings.models import Audio BREADCRUMBS = { - 'SrcPost':'SRC', 'AP':'dialogue', 'Book':'Book Notes', - 'Entry':'Jrnl', 'NewsletterMailing':'lttr', 'LuxImage':'lttr', 'Sighting':'dialogue' @@ -38,13 +37,6 @@ class PaginatedListView(ListView): request.base_path = path return super(PaginatedListView, self).dispatch(request, *args, **kwargs) - def get_context_data(self, **kwargs): - ''' - Adds breadcrumb path to every view - ''' - # Call the base implementation first to get a context - context = super(PaginatedListView, self).get_context_data(**kwargs) - print('model=', self.model) try: context['breadcrumbs'] = (BREADCRUMBS[self.model.__name__],) except KeyError: @@ -71,7 +63,7 @@ class LuxDetailView(DetailView): context['breadcrumbs'] = (self.object.get_post_type_display()+"s",) else: context['breadcrumbs'] = (self.object.get_post_type_display(),) - context['crumb_url'] = "/%ss/" % self.object.get_post_type_display() + context['crumb_url'] = "/%ss/" % slugify(self.object.get_post_type_display()) else: context['breadcrumbs'] = (self.object._meta.verbose_name_plural,) try: |