Use cache
This commit is contained in:
@ -2,12 +2,17 @@
|
||||
{% load humanize %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% load cache %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "About" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block about_content %}
|
||||
{# seven day cache #}
|
||||
{% cache 604800 about_page %}
|
||||
{% get_book_superlatives as superlatives %}
|
||||
<section class="content pb-4">
|
||||
<h2>
|
||||
{% blocktrans with site_name=site.name %}Welcome to {{ site_name }}!{% endblocktrans %}
|
||||
@ -22,7 +27,7 @@
|
||||
|
||||
<div class="columns">
|
||||
{% if top_rated %}
|
||||
{% with book=top_rated.default_edition rating=top_rated.rating %}
|
||||
{% with book=superlatives.top_rated.default_edition rating=top_rated.rating %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
@ -41,7 +46,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if wanted %}
|
||||
{% with book=wanted.default_edition %}
|
||||
{% with book=superlatives.wanted.default_edition %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
@ -60,7 +65,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if controversial %}
|
||||
{% with book=controversial.default_edition %}
|
||||
{% with book=superlatives.controversial.default_edition %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
@ -131,4 +136,6 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
|
@ -3,6 +3,7 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load humanize %}
|
||||
{% load cache %}
|
||||
|
||||
{% with status_type=status.status_type %}
|
||||
<div
|
||||
@ -15,6 +16,7 @@
|
||||
|
||||
<div class="columns is-gapless">
|
||||
{% if not hide_book %}
|
||||
{% cache 259200 content_status_book status.id %}
|
||||
{% with book=status.book|default:status.mention_books.first %}
|
||||
{% if book %}
|
||||
<div class="column is-cover">
|
||||
@ -34,6 +36,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endcache %}
|
||||
{% endif %}
|
||||
|
||||
<article class="column ml-3-tablet my-3-mobile">
|
||||
|
@ -3,8 +3,10 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load markdown %}
|
||||
{% load i18n %}
|
||||
{% load cache %}
|
||||
|
||||
{% if not hide_book %}
|
||||
{% cache 259200 generated_status_book status.id %}
|
||||
{% with book=status.book|default:status.mention_books.first %}
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<a class="column is-cover is-narrow" href="{{ book.local_path }}">
|
||||
@ -24,6 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endcache %}
|
||||
{% endif %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
Reference in New Issue
Block a user