Factor out book series info into separate template

This commit is contained in:
Bart Schuurmans 2024-03-23 19:35:24 +01:00
parent 0282e20b89
commit 2d2ccd51df
9 changed files with 12 additions and 27 deletions

View file

@ -0,0 +1,3 @@
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}

View file

@ -9,8 +9,7 @@
{% if book.authors.exists %}
{% blocktrans trimmed with path=book.local_path title=book|book_title %}
<a href="{{ path }}">{{ title }}
</a>
<a href="{{ path }}">{{ title }}</a>
by
{% endblocktrans %}&nbsp;{% include 'snippets/authors.html' with book=book limit=3 %}
@ -18,10 +17,7 @@ by
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endcache %}
{% endspaceless %}

View file

@ -18,8 +18,6 @@ commented on <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -18,8 +18,6 @@ quoted <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -20,8 +20,6 @@ finished reading <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -20,8 +20,6 @@ started reading <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}} {%if book.series_number %}#{{book.series_number}}) {% endif %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -18,8 +18,6 @@ reviewed <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endwith %}

View file

@ -20,9 +20,7 @@ stopped reading <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}

View file

@ -20,8 +20,6 @@ wants to read <a href="{{ book_path }}">{{ book }}</a>
{% endif %}
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}
{% endspaceless %}