fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7b2b193
)
vary template cache on language
author
Jan Szejko
<janek37@gmail.com>
Tue, 3 Jul 2018 10:09:29 +0000
(12:09 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Tue, 3 Jul 2018 14:29:14 +0000
(16:29 +0200)
src/catalogue/templates/catalogue/book_detail.html
patch
|
blob
|
history
src/catalogue/templates/catalogue/book_text.html
patch
|
blob
|
history
src/catalogue/templates/catalogue/work-list.html
patch
|
blob
|
history
diff --git
a/src/catalogue/templates/catalogue/book_detail.html
b/src/catalogue/templates/catalogue/book_detail.html
index
3b13624
..
cf26b12
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_detail.html
+++ b/
src/catalogue/templates/catalogue/book_detail.html
@@
-13,7
+13,8
@@
{% block bodyid %}book-detail{% endblock %}
{% block body %}
{% block bodyid %}book-detail{% endblock %}
{% block body %}
- {% cache 86400 book_wide book.pk book|status:user %}
+ {% get_current_language as LANGUAGE_CODE %}
+ {% cache 86400 book_wide book.pk book|status:user LANGUAGE_CODE %}
{% include 'catalogue/book_wide.html' %}
{% endcache %}
{% include 'catalogue/book_wide.html' %}
{% endcache %}
diff --git
a/src/catalogue/templates/catalogue/book_text.html
b/src/catalogue/templates/catalogue/book_text.html
index
f697e4e
..
5894fe8
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_text.html
+++ b/
src/catalogue/templates/catalogue/book_text.html
@@
-110,7
+110,8
@@
</div>
<div class="box" id="book-short">
</div>
<div class="box" id="book-short">
- {% cache 86400 catalogue_book_short book.pk book|status:user %}
+ {% get_current_language as LANGUAGE_CODE %}
+ {% cache 86400 book_short book.pk book|status:user LANGUAGE_CODE %}
{% include 'catalogue/book_short.html' %}
{% endcache %}
</div>
{% include 'catalogue/book_short.html' %}
{% endcache %}
</div>
diff --git
a/src/catalogue/templates/catalogue/work-list.html
b/src/catalogue/templates/catalogue/work-list.html
index
03833c1
..
178654c
100755
(executable)
--- a/
src/catalogue/templates/catalogue/work-list.html
+++ b/
src/catalogue/templates/catalogue/work-list.html
@@
-1,7
+1,10
@@
{% spaceless %}
{% spaceless %}
+ {% load cache %}
+ {% load i18n %}
{% load pagination_tags %}
{% load class_name from catalogue_tags %}
{% load pagination_tags %}
{% load class_name from catalogue_tags %}
+ {% load status from catalogue_tags %}
{% load ssi_include from ssify %}
{% autopaginate object_list 10 %}
{% load ssi_include from ssify %}
{% autopaginate object_list 10 %}
@@
-9,7
+12,14
@@
<ol class='work-list'>
{% for item in object_list %}
<li class='{{ item|class_name }}-item'>
<ol class='work-list'>
{% for item in object_list %}
<li class='{{ item|class_name }}-item'>
- {% ssi_include item.short_html_url_name pk=item.pk %}
+ {% if item|class_name == 'Book' %}
+ {% get_current_language as LANGUAGE_CODE %}
+ {% cache 86400 book_short item.pk item|status:request.user LANGUAGE_CODE %}
+ {% include "catalogue/book_short.html" with book=item %}
+ {% endcache %}
+ {% else %}
+ {% ssi_include item.short_html_url_name pk=item.pk %}
+ {% endif %}
</li>
{% endfor %}
</ol>
</li>
{% endfor %}
</ol>