From c742d70c5285e01898721fc1a5ffe236781c7828 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 29 Jul 2019 16:13:14 +0200 Subject: [PATCH] Uncrazy the caching, part 1. --- src/ajaxable/templates/ajaxable/form.html | 3 +- .../templates/catalogue/book_detail.html | 6 ++-- .../templates/catalogue/book_text.html | 1 - .../templates/catalogue/custom_pdf_form.html | 3 +- .../templates/catalogue/related_books.html | 3 +- .../catalogue/snippets/like_button.html | 3 +- .../templates/catalogue/tag_catalogue.html | 6 ++-- src/contact/templates/contact/form.html | 3 +- .../templates/newsletter/subscribe_form.html | 5 ++- .../newsletter/unsubscribe_form.html | 5 ++- src/polls/templates/polls/tags/poll.html | 5 ++- src/social/templates/social/sets_form.html | 5 ++- src/wolnelektury/templates/auth/login.html | 3 +- .../templates/auth/login_register.html | 1 - src/wolnelektury/templates/base/app.html | 4 +-- .../templates/base/superbase.html | 4 +-- src/wolnelektury/templates/main_page.html | 34 ------------------- 17 files changed, 25 insertions(+), 69 deletions(-) diff --git a/src/ajaxable/templates/ajaxable/form.html b/src/ajaxable/templates/ajaxable/form.html index 0af34f4cc..0c97b6527 100755 --- a/src/ajaxable/templates/ajaxable/form.html +++ b/src/ajaxable/templates/ajaxable/form.html @@ -1,11 +1,10 @@ {% load i18n %} -{% load ssi_csrf_token from ssify %}

{{ title }}

- {% ssi_csrf_token %} + {% csrf_token %} {% if honeypot %} {% load honeypot %} {% render_honeypot_field %} diff --git a/src/catalogue/templates/catalogue/book_detail.html b/src/catalogue/templates/catalogue/book_detail.html index ecae89e82..a5be89bad 100644 --- a/src/catalogue/templates/catalogue/book_detail.html +++ b/src/catalogue/templates/catalogue/book_detail.html @@ -1,7 +1,6 @@ {% extends "base/base.html" %} {% load i18n %} {% load common_tags catalogue_tags %} -{% load ssify %} {% load build_absolute_uri from fnp_common %} {% load cache %} @@ -33,7 +32,6 @@ {% cache 86400 book_mini_box rel.pk %} {% include 'catalogue/book_mini_box.html' with book=rel %} {% endcache %} - {#% ssi_include 'catalogue_book_mini' pk=rel.pk %#} {% endfor %} {% endif %} @@ -56,7 +54,9 @@ {% for author in book.authors %} {% endfor %} diff --git a/src/catalogue/templates/catalogue/book_text.html b/src/catalogue/templates/catalogue/book_text.html index 42eb1fa5a..27eadb0a3 100644 --- a/src/catalogue/templates/catalogue/book_text.html +++ b/src/catalogue/templates/catalogue/book_text.html @@ -91,7 +91,6 @@ {% cache 86400 book_mini_box other_version.pk %} {% include 'catalogue/book_mini_box.html' with book=other_version no_link=True %} {% endcache %} - {#% ssi_include 'catalogue_book_mini_nolink' pk=other_version.pk %#} {% endfor %} diff --git a/src/catalogue/templates/catalogue/custom_pdf_form.html b/src/catalogue/templates/catalogue/custom_pdf_form.html index 3abc22d28..ef865bc04 100644 --- a/src/catalogue/templates/catalogue/custom_pdf_form.html +++ b/src/catalogue/templates/catalogue/custom_pdf_form.html @@ -1,12 +1,11 @@ {% load i18n %} {% load honeypot %} -{% load ssi_csrf_token from ssify %} {% load ajaxable_tags %}

{% trans "Download custom PDF" %}

- {% ssi_csrf_token %} + {% csrf_token %} {% render_honeypot_field %}
    {{ form.nofootnotes|pretty_checkbox }} diff --git a/src/catalogue/templates/catalogue/related_books.html b/src/catalogue/templates/catalogue/related_books.html index 74e680f59..db0fd357c 100755 --- a/src/catalogue/templates/catalogue/related_books.html +++ b/src/catalogue/templates/catalogue/related_books.html @@ -12,7 +12,6 @@ {% cache 86400 book_mini_box book.pk %} {% include 'catalogue/book_mini_box.html' %} {% endcache %} - {#% ssi_include 'catalogue_book_mini' pk=book.pk %#} {% endfor %} {% if random %} @@ -25,4 +24,4 @@ {% ssi_include 'picture_mini' pk=random_pic_pk %} {{ random_pic_pk.endif }} {% endif %} -{% endspaceless %} \ No newline at end of file +{% endspaceless %} diff --git a/src/catalogue/templates/catalogue/snippets/like_button.html b/src/catalogue/templates/catalogue/snippets/like_button.html index 6f0902e58..9b333c402 100644 --- a/src/catalogue/templates/catalogue/snippets/like_button.html +++ b/src/catalogue/templates/catalogue/snippets/like_button.html @@ -1,4 +1,3 @@ -{% load ssify %} {% load likes_book from social_tags %} {% likes_book book.pk as likes %}
    @@ -10,7 +9,7 @@ - {% ssi_csrf_token %} + {% csrf_token %}
    diff --git a/src/catalogue/templates/catalogue/tag_catalogue.html b/src/catalogue/templates/catalogue/tag_catalogue.html index 5f7e61b8d..73a5b14f4 100644 --- a/src/catalogue/templates/catalogue/tag_catalogue.html +++ b/src/catalogue/templates/catalogue/tag_catalogue.html @@ -1,7 +1,7 @@ {% extends "base/base.html" %} {% load i18n %} +{% load cache %} {% load plain_list from catalogue_tags %} -{% load ssi_include from ssify %} {% block titleextra %}{{ title }}{% endblock %} @@ -12,7 +12,9 @@ {% for tag in best %} - {% ssi_include "catalogue_tag_box" pk=tag.pk %} + {% cache 86400 catalogue_tag_box rel.pk %} + {% include 'catalogue/tag_box.html' %} + {% endcache %} {% endfor %} diff --git a/src/contact/templates/contact/form.html b/src/contact/templates/contact/form.html index fc1427ff3..346de58ff 100644 --- a/src/contact/templates/contact/form.html +++ b/src/contact/templates/contact/form.html @@ -1,7 +1,6 @@ {% extends form.base_template|default:"base/base.html" %} {% load chunks %} {% load honeypot %} -{% load ssi_csrf_token from ssify %} {% block title %}{{ form.form_title }}{% endblock %} @@ -16,7 +15,7 @@
    - {% ssi_csrf_token %} + {% csrf_token %} {% render_honeypot_field %} {% block form %} diff --git a/src/newsletter/templates/newsletter/subscribe_form.html b/src/newsletter/templates/newsletter/subscribe_form.html index c0379f014..53d79010a 100644 --- a/src/newsletter/templates/newsletter/subscribe_form.html +++ b/src/newsletter/templates/newsletter/subscribe_form.html @@ -1,13 +1,12 @@ {% extends "base/base.html" %} {% load i18n %} -{% load ssify %} {% load honeypot %} {% load ajaxable_tags %} {% block body %}

    {{ page_title }}

    - {% ssi_csrf_token %} + {% csrf_token %} {% render_honeypot_field %}
    1. {{ form.email|pretty_field }}
    2. @@ -16,4 +15,4 @@
    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/newsletter/templates/newsletter/unsubscribe_form.html b/src/newsletter/templates/newsletter/unsubscribe_form.html index 3372d2f4c..d7a6f70af 100644 --- a/src/newsletter/templates/newsletter/unsubscribe_form.html +++ b/src/newsletter/templates/newsletter/unsubscribe_form.html @@ -1,16 +1,15 @@ {% extends "base/base.html" %} {% load i18n %} -{% load ssify %} {% load honeypot %} {% block body %}

    {{ page_title }}

    - {% ssi_csrf_token %} + {% csrf_token %} {% render_honeypot_field %}
      {{ form.as_ul }}
    -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/polls/templates/polls/tags/poll.html b/src/polls/templates/polls/tags/poll.html index 4c4d2b50d..b4a4e7f7b 100644 --- a/src/polls/templates/polls/tags/poll.html +++ b/src/polls/templates/polls/tags/poll.html @@ -1,5 +1,4 @@ {% load i18n %} -{% load ssi_csrf_token from ssify %} {% if poll %} {% if voted_already %} @@ -19,10 +18,10 @@ {% else %}

    {{poll.question}}

    -
    {% ssi_csrf_token %} + {% csrf_token %} {{ form.vote }}
    {% endif %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/src/social/templates/social/sets_form.html b/src/social/templates/social/sets_form.html index 05f8e4361..a003f67df 100644 --- a/src/social/templates/social/sets_form.html +++ b/src/social/templates/social/sets_form.html @@ -1,16 +1,15 @@ {% load i18n %} -{% load ssi_csrf_token from ssify %}

    {{ title }}

    - {% ssi_csrf_token %} + {% csrf_token %} - {% ssi_csrf_token %} + {% csrf_token %}
      {{ form.as_ul }} diff --git a/src/wolnelektury/templates/auth/login.html b/src/wolnelektury/templates/auth/login.html index 296571348..c32df0f79 100644 --- a/src/wolnelektury/templates/auth/login.html +++ b/src/wolnelektury/templates/auth/login.html @@ -1,11 +1,10 @@ {% load i18n %} -{% load ssi_csrf_token from ssify %}

      {{ title }}

      - {% ssi_csrf_token %} + {% csrf_token %}
        {{ form.as_ul }} diff --git a/src/wolnelektury/templates/auth/login_register.html b/src/wolnelektury/templates/auth/login_register.html index 6be20540a..50e2ea075 100644 --- a/src/wolnelektury/templates/auth/login_register.html +++ b/src/wolnelektury/templates/auth/login_register.html @@ -1,7 +1,6 @@ {% extends "auth/login.html" %} {% load i18n %} {% load honeypot %} -{% load ssi_csrf_token from ssify %} {% block extra %} {{ block.super }} diff --git a/src/wolnelektury/templates/base/app.html b/src/wolnelektury/templates/base/app.html index e0a729b71..c10cc4c63 100644 --- a/src/wolnelektury/templates/base/app.html +++ b/src/wolnelektury/templates/base/app.html @@ -5,7 +5,7 @@ {% load static from staticfiles %} {% load catalogue_tags funding_tags reporting_stats %} {% load piwik_tags %} - {% load ssi_include ssi_csrf_token from ssify %} + {% load ssi_include from ssify %} {% load user_username user_is_staff from common_tags %} {% load cache %} {% get_current_language as LANGUAGE_CODE %} @@ -49,7 +49,7 @@
        {% for lang in LANGUAGES %} - {% ssi_csrf_token %} + {% csrf_token %} diff --git a/src/wolnelektury/templates/base/superbase.html b/src/wolnelektury/templates/base/superbase.html index a34006b73..b03392fed 100644 --- a/src/wolnelektury/templates/base/superbase.html +++ b/src/wolnelektury/templates/base/superbase.html @@ -5,7 +5,7 @@ {% load static from staticfiles %} {% load catalogue_tags funding_tags reporting_stats %} {% load piwik_tags %} - {% load ssi_include ssi_csrf_token from ssify %} + {% load ssi_include from ssify %} {% load user_username user_is_staff from common_tags %} {% load cache %} {% get_current_language as LANGUAGE_CODE %} @@ -69,7 +69,7 @@
        {% for lang in LANGUAGES %} - {% ssi_csrf_token %} + {% csrf_token %} diff --git a/src/wolnelektury/templates/main_page.html b/src/wolnelektury/templates/main_page.html index c3064127f..c1e6a9c4a 100644 --- a/src/wolnelektury/templates/main_page.html +++ b/src/wolnelektury/templates/main_page.html @@ -57,40 +57,6 @@ {% trans "See motifs catalog" %} - {% comment %} -
        -

        Autorzy

        - - {% ssi_include "catalogue_tag_box" pk=author.pk %} - - Zobacz katalog autorów -
        - -
        -

        Gatunki

        - - {% ssi_include "catalogue_tag_box" pk=genre.pk %} - - Zobacz katalog gatunków -
        - -
        -

        Rodzaje

        - - {% ssi_include "catalogue_tag_box" pk=kind.pk %} - - Zobacz katalog rodzajów -
        - -
        -

        Epoki

        - - {% ssi_include "catalogue_tag_box" pk=epoch.pk %} - - Zobacz katalog epok -
        - {% endcomment %} - {% if collection %}

        {% trans "Collections" %}

        -- 2.20.1