summaryrefslogtreecommitdiff
path: root/app/posts/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-01-27 20:37:10 -0500
committerluxagraf <sng@luxagraf.net>2020-01-27 20:37:10 -0500
commit6e8b62d8c38f6ca366f240ea45ad738ebfd62943 (patch)
treeb8c695cdd5c7f1f7729fa6750ed49c1eb2eae3e8 /app/posts/views.py
parent09abece4982e8dceabe1dd8d678639205a4a6208 (diff)
abstracted breadcrumbs into seperate template
Diffstat (limited to 'app/posts/views.py')
-rw-r--r--app/posts/views.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/posts/views.py b/app/posts/views.py
index fc85fa7..47c8c86 100644
--- a/app/posts/views.py
+++ b/app/posts/views.py
@@ -4,7 +4,7 @@ from django.contrib.syndication.views import Feed
from django.apps import apps
from django.conf import settings
-from utils.views import PaginatedListView
+from utils.views import PaginatedListView, LuxDetailView
from .models import Post
from taxonomy.models import Category
@@ -40,8 +40,17 @@ class EssayListView(PostList):
queryset = super(EssayListView, self).get_queryset()
return queryset.filter(post_type__in=[2,]).filter(status__exact=1).order_by('-pub_date').prefetch_related('location').prefetch_related('featured_image')
+ def get_context_data(self, **kwargs):
+ '''
+ override for custom breadcrumb path
+ '''
+ # Call the base implementation first to get a context
+ context = super(EssayListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ('Essays',)
+ return context
-class PostDetailView(DetailView):
+
+class PostDetailView(LuxDetailView):
model = Post
slug_field = "slug"
@@ -62,6 +71,7 @@ class PostDetailView(DetailView):
obj = self.get_object()
return ["posts/%s_detail.html" % obj.get_post_type_display(), 'posts/post_detail.html']
+
class PostDetailViewTXT(PostDetailView):
template_name = "posts/entry_detail.txt"