summaryrefslogtreecommitdiff
path: root/app/posts
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
parentc7fee3786a0221fb3a7032491b0a2d512f0b27c4 (diff)
views: cleaned up some view code and streamlined breadcrumbs
Diffstat (limited to 'app/posts')
-rw-r--r--app/posts/urls/guide_urls.py15
-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
4 files changed, 16 insertions, 16 deletions
diff --git a/app/posts/urls/guide_urls.py b/app/posts/urls/guide_urls.py
index 8927034..47cc3c5 100644
--- a/app/posts/urls/guide_urls.py
+++ b/app/posts/urls/guide_urls.py
@@ -12,25 +12,10 @@ urlpatterns = [
{'page':1},
name="guide-base"
),
- path(r'field-test/', include('posts.urls.review_urls', namespace='reviews')),
- re_path(r'^field-test/$', RedirectView.as_view(url='/field-tests/')),
- #path(r'field-tests/', include('posts.urls', namespace='review-list')),
- #path(r'review/', include('posts.review_urls')),
- re_path(r'^review/$', RedirectView.as_view(url='/guides/')),
path(
r'<str:topic>/',
views.GuideTopicListView.as_view(),
{'page':1},
name="guides-by-topic"
),
- #path(
- # r'<str:slug>',
- # views.EntryDetailView.as_view(),
- # name="detail"
- #),
- #re_path(
- # r'<int:page>/',
- # views.EntryList.as_view(),
- # name="list"
- #),
]
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