From 0eedef1eafceaaa3f4f78b014236bf642be2807b Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 15 Mar 2022 13:44:36 +0100 Subject: [PATCH] Simplify transitional files a bit. --- .../templates/catalogue/{2021 => 2022}/book_detail.html | 2 +- src/catalogue/templatetags/catalogue_tags.py | 2 +- src/catalogue/views.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/catalogue/templates/catalogue/{2021 => 2022}/book_detail.html (99%) diff --git a/src/catalogue/templates/catalogue/2021/book_detail.html b/src/catalogue/templates/catalogue/2022/book_detail.html similarity index 99% rename from src/catalogue/templates/catalogue/2021/book_detail.html rename to src/catalogue/templates/catalogue/2022/book_detail.html index 8c9beb329..149be1263 100644 --- a/src/catalogue/templates/catalogue/2021/book_detail.html +++ b/src/catalogue/templates/catalogue/2022/book_detail.html @@ -429,7 +429,7 @@ {% endif %} - {% related_books_2021 book taken=book.other_versions|length as related_books %} + {% related_books_2022 book taken=book.other_versions|length as related_books %} {% for rel in related_books %}
diff --git a/src/catalogue/templatetags/catalogue_tags.py b/src/catalogue/templatetags/catalogue_tags.py index 8915807e1..8124b349c 100644 --- a/src/catalogue/templatetags/catalogue_tags.py +++ b/src/catalogue/templatetags/catalogue_tags.py @@ -401,7 +401,7 @@ def related_books(context, instance, limit=6, random=1, taken=0): @register.simple_tag -def related_books_2021(instance, limit=4, taken=0): +def related_books_2022(instance, limit=4, taken=0): limit -= taken max_books = limit diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 9da3ebbf8..e83b18ca4 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -294,7 +294,7 @@ def book_detail(request, slug): return render( request, - 'catalogue/2021/book_detail.html' if new_layout.value else 'catalogue/book_detail.html', + 'catalogue/2022/book_detail.html' if new_layout.value else 'catalogue/book_detail.html', { 'book': book, 'book_children': book.children.all().order_by('parent_number', 'sort_key'), -- 2.20.1