mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 00:26:33 +00:00
Merge pull request #3261 from bSolt/book-series-3256
Add book series by title in feed posts
This commit is contained in:
commit
caebebeb37
10 changed files with 34 additions and 3 deletions
|
@ -45,18 +45,22 @@
|
|||
{% endif %}
|
||||
|
||||
{% if book.series %}
|
||||
<meta itemprop="position" content="{{ book.series_number }}">
|
||||
{% spaceless %}
|
||||
<span itemprop="isPartOf" itemscope itemtype="https://schema.org/BookSeries">
|
||||
{% if book.authors.exists %}
|
||||
<a href="{% url 'book-series-by' book.authors.first.id %}?series_name={{ book.series | urlencode }}"
|
||||
itemprop="url">
|
||||
{% endif %}
|
||||
<span itemprop="name">{{ book.series }}</span>
|
||||
{% if book.series_number %} #{{ book.series_number }}{% endif %}
|
||||
{% if book.authors.exists %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if book.series_number %}
|
||||
<span>, #</span>
|
||||
<span itemprop="position">{{ book.series_number }}</span>
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
|
3
bookwyrm/templates/snippets/book_series.html
Normal file
3
bookwyrm/templates/snippets/book_series.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{% if book.series %}
|
||||
({{book.series}}{%if book.series_number %}, #{{book.series_number}}{% endif %})
|
||||
{% endif %}
|
|
@ -9,12 +9,15 @@
|
|||
|
||||
{% if book.authors.exists %}
|
||||
{% blocktrans trimmed with path=book.local_path title=book|book_title %}
|
||||
<a href="{{ path }}">{{ title }}</a> by
|
||||
<a href="{{ path }}">{{ title }}</a>
|
||||
by
|
||||
{% endblocktrans %} {% include 'snippets/authors.html' with book=book limit=3 %}
|
||||
|
||||
{% else %}
|
||||
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endcache %}
|
||||
{% endspaceless %}
|
||||
|
|
|
@ -17,4 +17,7 @@ commented on <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endwith %}
|
||||
|
|
|
@ -17,4 +17,7 @@ quoted <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endwith %}
|
||||
|
|
|
@ -19,4 +19,7 @@ finished reading <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
|
|
@ -19,4 +19,7 @@ started reading <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
|
|
@ -17,4 +17,7 @@ reviewed <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endwith %}
|
||||
|
|
|
@ -19,5 +19,8 @@ stopped reading <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
||||
|
|
|
@ -19,4 +19,7 @@ wants to read <a href="{{ book_path }}">{{ book }}</a>
|
|||
{% endblocktrans %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/book_series.html' with book=book %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
|
Loading…
Reference in a new issue