Skip to content

Commit

Permalink
Factor out book series info into separate template
Browse files Browse the repository at this point in the history
  • Loading branch information
Minnozz committed Mar 23, 2024
1 parent 0282e20 commit 2d2ccd5
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 27 deletions.
3 changes: 3 additions & 0 deletions bookwyrm/templates/snippets/book_series.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
8 changes: 2 additions & 6 deletions bookwyrm/templates/snippets/book_titleby.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@

{% 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 %}

{% else %}
<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 %}
4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endwith %}
4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/quotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endwith %}
4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endspaceless %}
4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/reading.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

{% endif %}

{% if book.series %}
({{book.series}} {%if book.series_number %}#{{book.series_number}}) {% endif %}
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endspaceless %}
4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endwith %}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endspaceless %}

4 changes: 1 addition & 3 deletions bookwyrm/templates/snippets/status/headers/to_read.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

{% endif %}

{% if book.series %}
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
{% endif %}
{% include 'snippets/book_series.html' with book=book %}

{% endspaceless %}

0 comments on commit 2d2ccd5

Please sign in to comment.