diff --git a/app/item/views.py b/app/item/views.py index fb8aa52..e35ca27 100644 --- a/app/item/views.py +++ b/app/item/views.py @@ -43,7 +43,7 @@ def index(request): return render(request, 'index.html', context) -def archive(request): +def archive(request, week=None): context = default_context(request) qs = models.Item.public() week, archive = models.Item.public() diff --git a/app/templates/archive.html b/app/templates/archive.html index d1a1884..3aee3fd 100644 --- a/app/templates/archive.html +++ b/app/templates/archive.html @@ -1,10 +1,17 @@ {% extends "base.html" %} {% block content %} +
{% for item in items %} {% ifchanged item.week %}

{{ item.year }} week {{ item.week }}

{% endifchanged %} {% include "listitem.html" with item=item %} {% endfor %} + {% if archive %} +
+ previous weeks +
+ {% endif %} +
{% endblock %} diff --git a/app/templates/index.html b/app/templates/index.html index 12b71c8..1a2e5f0 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -4,8 +4,6 @@ {{ settings.SITENAME }} {% endblock %} {% block content %} -
{% for item in items %} {% include "listitem.html" with item=item %}