From: Jan Szejko Date: Thu, 10 May 2018 15:25:37 +0000 (+0200) Subject: no ssi for book wide X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/a0fa09c8c73de6236ccf296d5b54cb08ed5e97e4?ds=inline no ssi for book wide --- diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html index e3f4d7336..22c230b4e 100644 --- a/src/catalogue/templates/catalogue/book_detail.html +++ b/src/catalogue/templates/catalogue/book_detail.html @@ -13,7 +13,9 @@ {% block bodyid %}book-detail{% endblock %} {% block body %} - {% ssi_include 'catalogue_book_wide' pk=book.pk %} + {% cache 86400 book_wide book.pk book|status:user %} + {% include 'catalogue/book_wide.html' %} + {% endcache %} {% work_list book_children %} diff --git a/src/catalogue/templates/catalogue/book_wide.html b/src/catalogue/templates/catalogue/book_wide.html index 88cc0be32..b4faeab50 100644 --- a/src/catalogue/templates/catalogue/book_wide.html +++ b/src/catalogue/templates/catalogue/book_wide.html @@ -9,8 +9,8 @@ {% block cover-area-extra %} - {% if extra_info.license %} - {% license_icon extra_info.license %} + {% if book.extra_info.license %} + {% license_icon book.extra_info.license %} {% endif %} {% endblock %} diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 5273ab429..0a5ab5867 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -426,17 +426,9 @@ def book_short(request, pk): ))(ssi_expect(pk, int))) def book_wide(request, pk): book = get_object_or_404(Book, pk=pk) - extra_info = book.extra_info return render(request, 'catalogue/book_wide.html', { 'book': book, - 'parents': book.parents(), - 'tags': split_tags(book.tags.exclude(category__in=('set', 'theme'))), - 'show_lang': book.language_code() != settings.LANGUAGE_CODE, - - 'main_link': reverse('book_text', args=[book.slug]) if book.html_file else None, - 'extra_info': extra_info, - 'hide_about': extra_info.get('about', '').startswith('http://wiki.wolnepodreczniki.pl'), })