fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6c9c6aa
)
rework book box caching
author
Jan Szejko
<janek37@gmail.com>
Wed, 11 Jul 2018 11:24:36 +0000
(13:24 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Wed, 11 Jul 2018 11:24:36 +0000
(13:24 +0200)
src/catalogue/templates/catalogue/book_detail.html
patch
|
blob
|
history
src/catalogue/templates/catalogue/book_short.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
cf26b12
..
865aca2
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_detail.html
+++ b/
src/catalogue/templates/catalogue/book_detail.html
@@
-13,10
+13,7
@@
{% block bodyid %}book-detail{% endblock %}
{% block body %}
{% block bodyid %}book-detail{% endblock %}
{% block body %}
- {% 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' %}
{% work_list book_children %}
{% work_list book_children %}
diff --git
a/src/catalogue/templates/catalogue/book_short.html
b/src/catalogue/templates/catalogue/book_short.html
index
fff3fc0
..
4f186e8
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_short.html
+++ b/
src/catalogue/templates/catalogue/book_short.html
@@
-1,5
+1,6
@@
{% spaceless %}
{% load i18n %}
{% spaceless %}
{% load i18n %}
+ {% load cache %}
{% load catalogue_tags %}
{% load book_shelf_tags from social_tags %}
{% load static %}
{% load catalogue_tags %}
{% load book_shelf_tags from social_tags %}
{% load static %}
@@
-28,6
+29,8
@@
{% block cover-area-extra %}{% endblock %}
</div>
{% block cover-area-extra %}{% endblock %}
</div>
+ {% get_current_language as LANGUAGE_CODE %}
+ {% cache 86400 book_box_head_tags book.pk LANGUAGE_CODE %}
<div class="book-box-head">
<div class="author">
{% for tag in tags.author %}
<div class="book-box-head">
<div class="author">
{% for tag in tags.author %}
@@
-94,9
+97,11
@@
{% endif %}
{% endwith %}
</div>
{% endif %}
{% endwith %}
</div>
+ {% endcache %}
</div>
{% book_shelf_tags book.pk %}
</div>
{% book_shelf_tags book.pk %}
+ {% cache 86400 book_box_tools book.pk book|status:request.user LANGUAGE_CODE %}
{% if book|status:request.user != 'closed' %}
<ul class="book-box-tools">
<li class="book-box-read">
{% if book|status:request.user != 'closed' %}
<ul class="book-box-tools">
<li class="book-box-read">
@@
-142,6
+147,7
@@
{% else %}
<p class="book-box-tools">{% trans "For now this work is only available for our subscribers." %}</p>
{% endif %}
{% else %}
<p class="book-box-tools">{% trans "For now this work is only available for our subscribers." %}</p>
{% endif %}
+ {% endcache %}
{% block book-box-extra-info %}{% endblock %}
{% block box-append %}{% endblock %}
</div>
{% block book-box-extra-info %}{% endblock %}
{% block box-append %}{% endblock %}
</div>
diff --git
a/src/catalogue/templates/catalogue/book_text.html
b/src/catalogue/templates/catalogue/book_text.html
index
5894fe8
..
e958d70
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_text.html
+++ b/
src/catalogue/templates/catalogue/book_text.html
@@
-110,9
+110,6
@@
</div>
<div class="box" id="book-short">
</div>
<div class="box" id="book-short">
- {% get_current_language as LANGUAGE_CODE %}
- {% cache 86400 book_short book.pk book|status:user LANGUAGE_CODE %}
- {% include 'catalogue/book_short.html' %}
- {% endcache %}
+ {% include 'catalogue/book_short.html' %}
</div>
{% endblock footer %}
</div>
{% endblock footer %}
diff --git
a/src/catalogue/templates/catalogue/work-list.html
b/src/catalogue/templates/catalogue/work-list.html
index
178654c
..
5e3f3b9
100755
(executable)
--- a/
src/catalogue/templates/catalogue/work-list.html
+++ b/
src/catalogue/templates/catalogue/work-list.html
@@
-1,7
+1,6
@@
{% spaceless %}
{% load cache %}
{% spaceless %}
{% load cache %}
- {% load i18n %}
{% load pagination_tags %}
{% load class_name from catalogue_tags %}
{% load status from catalogue_tags %}
{% load pagination_tags %}
{% load class_name from catalogue_tags %}
{% load status from catalogue_tags %}
@@
-13,10
+12,7
@@
{% for item in object_list %}
<li class='{{ item|class_name }}-item'>
{% if item|class_name == 'Book' %}
{% for item in object_list %}
<li class='{{ item|class_name }}-item'>
{% 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 %}
+ {% include "catalogue/book_short.html" with book=item %}
{% else %}
{% ssi_include item.short_html_url_name pk=item.pk %}
{% endif %}
{% else %}
{% ssi_include item.short_html_url_name pk=item.pk %}
{% endif %}