Cache more templates

This commit is contained in:
Mark Veidemanis 2023-02-11 14:54:57 +00:00
parent eba4142960
commit bb5b473898
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
4 changed files with 148 additions and 140 deletions

View File

@ -1,7 +1,11 @@
{% load pretty %}
{% include 'mixins/partials/notify.html' %}
{% if live is not None %}
{% load cache %}
{% cache 600 generic_detail request.user.id object live %}
{% include 'mixins/partials/notify.html' %}
{% if live is not None %}
<h1 class="title">Live {{ context_object_name_singular }} info</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
@ -34,9 +38,9 @@
{% endblock %}
</tbody>
</table>
{% endif %}
{% endif %}
{% if object is not None %}
{% if object is not None %}
<h1 class="title">{{ title_singular }} info</h1>
<table class="table is-fullwidth is-hoverable">
<thead>
@ -69,4 +73,5 @@
{% endblock %}
</tbody>
</table>
{% endif %}
{% endif %}
{% endcache %}

View File

@ -1,14 +1,18 @@
{% include 'mixins/partials/notify.html' %}
{% if page_title is not None %}
<h1 class="title is-4">{{ page_title }}</h1>
{% endif %}
{% if page_subtitle is not None %}
<h1 class="subtitle">{{ page_subtitle }}</h1>
{% endif %}
{% load crispy_forms_tags %}
{% load cache %}
{% load crispy_forms_bulma_field %}
<form
{% cache 600 object_form request.user.id form %}
{% include 'mixins/partials/notify.html' %}
{% if page_title is not None %}
<h1 class="title is-4">{{ page_title }}</h1>
{% endif %}
{% if page_subtitle is not None %}
<h1 class="subtitle">{{ page_subtitle }}</h1>
{% endif %}
{% load crispy_forms_tags %}
{% load crispy_forms_bulma_field %}
<form
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{{ submit_url }}"
hx-target="#modals-here"
@ -23,12 +27,6 @@
</button>
{% endif %}
<button type="submit" class="button modal-close-button">Submit</button>
</form>
</form>
{% endcache %}

View File

@ -1,11 +1,15 @@
{% include 'mixins/partials/notify.html' %}
{% if page_title is not None %}
{% load cache %}
{% cache 600 object request.user.id object %}
{% include 'mixins/partials/notify.html' %}
{% if page_title is not None %}
<h1 class="title is-4">{{ page_title }}</h1>
{% endif %}
{% if page_subtitle is not None %}
{% endif %}
{% if page_subtitle is not None %}
<h1 class="subtitle">{{ page_subtitle }}</h1>
{% endif %}
<div class="buttons">
{% endif %}
<div class="buttons">
{% if submit_url is not None %}
<button
@ -39,7 +43,8 @@
</span>
</button>
{% endif %}
</div>
</div>
{% include detail_template %}
{% include detail_template %}
{% endcache %}

View File

@ -1,6 +1,6 @@
{% load cache %}
{% cache 60 objects request.user.id object_list %}
{% cache 600 objects request.user.id object_list %}
{% include 'mixins/partials/notify.html' %}
{% if page_title is not None %}
<h1 class="title is-4">{{ page_title }}</h1>