summaryrefslogtreecommitdiff
path: root/app/posts/views
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf>2021-01-30 17:41:42 -0500
committerluxagraf <sng@luxagraf>2021-01-30 17:41:42 -0500
commite36adb590425ee6fb15a03ef690b6a279c49250a (patch)
tree533ee7cd8cb26bcca8e7a69a639ec0aacb8d8c9c /app/posts/views
parentc7fee3786a0221fb3a7032491b0a2d512f0b27c4 (diff)
views: cleaned up some view code and streamlined breadcrumbs
Diffstat (limited to 'app/posts/views')
-rw-r--r--app/posts/views/field_note_views.py9
-rw-r--r--app/posts/views/guide_views.py7
-rw-r--r--app/posts/views/jrnl_views.py1
3 files changed, 16 insertions, 1 deletions
diff --git a/app/posts/views/field_note_views.py b/app/posts/views/field_note_views.py
index e635ac5..15ce3ff 100644
--- a/app/posts/views/field_note_views.py
+++ b/app/posts/views/field_note_views.py
@@ -13,6 +13,14 @@ class FieldNoteListView(PaginatedListView):
Return a list of Notes in reverse chronological order
"""
queryset = Post.objects.filter(post_type=PostType.FIELD_NOTE,status=1).order_by('-pub_date')
+
+ def get_context_data(self, **kwargs):
+ '''
+ Add breadcrumb path
+ '''
+ context = super(FieldNoteListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ("field notes",)
+ return context
class FieldNoteDetailView(LuxDetailView):
@@ -37,3 +45,4 @@ class FieldNoteMonthArchiveView(MonthArchiveView):
date_field = "pub_date"
make_object_list = True
template_name = "posts/fieldnote_archive_list_date.html"
+
diff --git a/app/posts/views/guide_views.py b/app/posts/views/guide_views.py
index 5b15af1..aea91dd 100644
--- a/app/posts/views/guide_views.py
+++ b/app/posts/views/guide_views.py
@@ -36,7 +36,12 @@ class GuideTopicListView(PaginatedListView):
def get_context_data(self, **kwargs):
context = super(GuideTopicListView, self).get_context_data(**kwargs)
- context['topic'] = Category.objects.get(slug=self.kwargs['topic'])
+ topic = Category.objects.get(slug=self.kwargs['topic'])
+ context['topic'] = topic
+ context['breadcrumbs'] = ('Guides', topic.name )
+
+
+ Category.objects.get(slug=self.kwargs['topic'])
return context
diff --git a/app/posts/views/jrnl_views.py b/app/posts/views/jrnl_views.py
index 0dc2dc8..bfc0a42 100644
--- a/app/posts/views/jrnl_views.py
+++ b/app/posts/views/jrnl_views.py
@@ -30,6 +30,7 @@ class JrnlListView(PaginatedListView):
context['breadcrumbs'] = ['jrnl',]
return context
+
class JrnlCountryListView(PaginatedListView):
"""
Return a list of Entries by Country in reverse chronological order