Always list all years in archive views
This commit is contained in:
parent
3afbc2b7e1
commit
f29719ef78
3 changed files with 30 additions and 19 deletions
|
|
@ -37,6 +37,12 @@ class GalleryDateView(LoginRequiredMixin):
|
|||
else:
|
||||
return qs.filter(photos__is_public=True).distinct()
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
"""Always show all years in archive"""
|
||||
context = super().get_context_data(**kwargs)
|
||||
context['date_list'] = self.get_queryset().dates(self.date_field, 'year', 'DESC')
|
||||
return context
|
||||
|
||||
|
||||
class GalleryArchiveIndexView(GalleryDateView, ArchiveIndexView):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue