From 428d87a3510687714cd5139f6726bfa511999c0f Mon Sep 17 00:00:00 2001
From: Mouse Reeve
- {% firstof book.physical_format_detail book.physical_format as format %}
- {% firstof book.physical_format book.physical_format_detail as format_property %}
- {% with pages=book.pages %}
- {% if format %}
- {% comment %}
- @todo The bookFormat property is limited to a list of values whereas the book edition is free text.
- @see https://schema.org/bookFormat
- {% endcomment %}
-
- {% endif %}
+ {% if format_property %}
+
+ {% endif %}
- {% if pages %}
-
- {% endif %}
+ {% if pages %}
+
+ {% endif %}
- {% if format and not pages %}
- {% blocktrans %}{{ format }}{% endblocktrans %}
- {% elif format and pages %}
- {% blocktrans %}{{ format }}, {{ pages }} pages{% endblocktrans %}
- {% elif pages %}
- {% blocktrans %}{{ pages }} pages{% endblocktrans %}
- {% endif %}
- {% endwith %}
+ {% if format and not pages %}
+ {% blocktrans %}{{ format }}{% endblocktrans %}
+ {% elif format and pages %}
+ {% blocktrans %}{{ format }}, {{ pages }} pages{% endblocktrans %}
+ {% elif pages %}
+ {% blocktrans %}{{ pages }} pages{% endblocktrans %}
+ {% endif %}
{% if book.isbn_13 %}
+{% endif %}
{% endspaceless %}
diff --git a/bookwyrm/templates/book/publisher_info.html b/bookwyrm/templates/book/publisher_info.html
index 42cb4098..da3d7d1d 100644
--- a/bookwyrm/templates/book/publisher_info.html
+++ b/bookwyrm/templates/book/publisher_info.html
@@ -3,31 +3,29 @@
{% load i18n %}
{% load humanize %}
+{% firstof book.physical_format_detail book.physical_format as format %}
+{% firstof book.physical_format book.physical_format_detail as format_property %}
+{% with pages=book.pages %}
+{% if format or pages %}
- {% with date=book.published_date|naturalday publisher=book.publishers|join:', ' %} - {% if date or book.first_published_date %} - - {% endif %} + {% if date or book.first_published_date %} + + {% endif %} - {% comment %} - @todo The publisher property needs to be an Organization or a Person. We’ll be using Thing which is the more generic ancestor. - @see https://schema.org/Publisher - {% endcomment %} - {% if book.publishers %} - {% for publisher in book.publishers %} - - {% endfor %} - {% endif %} + {% comment %} + @todo The publisher property needs to be an Organization or a Person. We’ll be using Thing which is the more generic ancestor. + @see https://schema.org/Publisher + {% endcomment %} + {% if book.publishers %} + {% for publisher in book.publishers %} + + {% endfor %} + {% endif %} - {% if date and publisher %} - {% blocktrans %}Published {{ date }} by {{ publisher }}.{% endblocktrans %} - {% elif date %} - {% blocktrans %}Published {{ date }}{% endblocktrans %} - {% elif publisher %} - {% blocktrans %}Published by {{ publisher }}.{% endblocktrans %} - {% endif %} - {% endwith %} + {% if date and publisher %} + {% blocktrans %}Published {{ date }} by {{ publisher }}.{% endblocktrans %} + {% elif date %} + {% blocktrans %}Published {{ date }}{% endblocktrans %} + {% elif publisher %} + {% blocktrans %}Published by {{ publisher }}.{% endblocktrans %} + {% endif %}
+{% endif %} +{% endwith %} {% endspaceless %}