From 00e4023b3db50534296b0f3c808ddd22f01ef484 Mon Sep 17 00:00:00 2001 From: lxf Date: Sat, 1 Jan 2022 14:15:09 -0500 Subject: loc: fixed walk/track changes and updated templates --- app/locations/views.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'app/locations/views.py') diff --git a/app/locations/views.py b/app/locations/views.py index 7487a17..666e9a3 100644 --- a/app/locations/views.py +++ b/app/locations/views.py @@ -100,11 +100,11 @@ class LocationDetail(DetailView): return context -class TrackDetail(DetailView): +class TrackDetailView(DetailView): model = Track def get_context_data(self, **kwargs): - context = super(WalkDetail, self).get_context_data(**kwargs) + context = super(TrackDetailView, self).get_context_data(**kwargs) context['entry_list'] = Post.objects.filter( Q(location=self.get_object().location) | Q(location__in=Location.objects.filter(parent=self.get_object().location)) @@ -113,12 +113,20 @@ class TrackDetail(DetailView): Q(location=self.get_object().location) | Q(location__in=Location.objects.filter(parent=self.get_object().location)) ).order_by('ap_id', 'ap__apclass__kind').distinct("ap") + context['breadcrumbs'] = ("walks",self.object.date_walked.year,self.object.title) return context -class TrackList(PaginatedListView): +class TrackListView(PaginatedListView): """ Return list of Walks """ model = Track - template_name = 'locations/walk_list.html' + + def get_context_data(self, **kwargs): + ''' + Add breadcrumb path + ''' + context = super(TrackListView, self).get_context_data(**kwargs) + context['breadcrumbs'] = ("walks",) + return context -- cgit v1.2.3-70-g09d2