summaryrefslogtreecommitdiff
path: root/app/sightings/views.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-09-24 09:23:38 -0400
committerluxagraf <sng@luxagraf.net>2023-09-24 09:23:38 -0400
commit9a49497c662f493398150933a183a284a47ea60e (patch)
treeed2aa2ac0c4da1de29dffd327ce13f3c8da537d6 /app/sightings/views.py
parentb42ddf2d3be18f9f67ded22775cc1823b55454fd (diff)
dialog: tweaked templates for life list and year list views
Diffstat (limited to 'app/sightings/views.py')
-rw-r--r--app/sightings/views.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/app/sightings/views.py b/app/sightings/views.py
index 1c42fd4..24c341d 100644
--- a/app/sightings/views.py
+++ b/app/sightings/views.py
@@ -12,16 +12,38 @@ class SightingListView(PaginatedListView):
qs_ids = Sighting.objects.order_by('ap__id', '-pub_date').distinct('ap').values_list('id', flat=True)
return Sighting.objects.filter(id__in=qs_ids).order_by('-pub_date').prefetch_related('ap')
+ def get_context_data(self, **kwargs):
+ context = super(SightingListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
class LifeListView(ListView):
- template_name = 'archives/life-list.html'
+ template_name = 'sightings/life-list.html'
def get_queryset(self):
return Sighting.objects.filter(ap__apclass__kind=1).order_by('ap__id').distinct('ap')
+ def get_context_data(self, **kwargs):
+ context = super(LifeListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
+
+class NotLifeListView(ListView):
+ template_name = 'sightings/not_life_list.html'
+
+ def get_queryset(self):
+ return AP.objects.filter(apclass__kind=1).filter(have_seen=False)
+
+ def get_context_data(self, **kwargs):
+ context = super(NotLifeListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
class YearListView(ListView):
- template_name = 'archives/life-list.html'
+ template_name = 'sightings/life-list.html'
def get_queryset(self):
return Sighting.objects.filter(ap__apclass__kind=1).filter(pub_date__year=self.kwargs['year']).order_by('ap__id').distinct('ap')