diff --git a/photologue/templates/photologue/gallery_archive.html b/photologue/templates/photologue/gallery_archive.html index 4cd683d..206dd58 100644 --- a/photologue/templates/photologue/gallery_archive.html +++ b/photologue/templates/photologue/gallery_archive.html @@ -32,4 +32,4 @@ SPDX-License-Identifier: GPL-3.0-or-later {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/photologue/templates/photologue/gallery_archive_year.html b/photologue/templates/photologue/gallery_archive_year.html index 8be8f21..54cdb95 100644 --- a/photologue/templates/photologue/gallery_archive_year.html +++ b/photologue/templates/photologue/gallery_archive_year.html @@ -9,22 +9,27 @@ SPDX-License-Identifier: GPL-3.0-or-later {% block title %}{% blocktrans with show_year=year|date:"Y" %}Galleries for {{ show_year }}{% endblocktrans %}{% endblock %} {% block content %} -
- -
- {% if object_list %} -
- {% for gallery in object_list %} -
- {% include "photologue/includes/gallery_sample.html" %} -
- {% endfor %} +
+ +
+ {% if object_list %} +
+ {% for gallery in object_list %} +
+ {% include "photologue/includes/gallery_sample.html" %}
- {% else %} -

{% trans "No galleries were found." %}

- {% endif %} -
-
-{% endblock %} \ No newline at end of file + {% endfor %} +
+ {% else %} +

{% trans "No galleries were found." %}

+ {% endif %} +
+
+{% endblock %} diff --git a/photologue/views.py b/photologue/views.py index 93b9c9b..af1249d 100644 --- a/photologue/views.py +++ b/photologue/views.py @@ -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