From 66c72c8b41fb489aee28cd62ccefef00ba98d81d Mon Sep 17 00:00:00 2001 From: Fabien Basmaison Date: Sun, 18 Apr 2021 15:59:02 +0200 Subject: [PATCH 1/2] Add book identifiers to list of Editions: - Add template for identifiers. - Remove `space-between` that adds too much space on narrow views. - Apply the `content` class only on publisher infos to avoid applying automatic styles to the description list. --- bookwyrm/templates/book/book.html | 29 +++++-------------- bookwyrm/templates/book/book_identifiers.html | 27 +++++++++++++++++ bookwyrm/templates/book/editions.html | 13 ++++++++- 3 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 bookwyrm/templates/book/book_identifiers.html diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index d263e0e07..f1aaaf51a 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -67,31 +67,16 @@ {% endif %} -
-
- {% if book.isbn_13 %} -
-
{% trans "ISBN:" %}
-
{{ book.isbn_13 }}
+
+ {% with book=book %} +
+ {% include 'book/publisher_info.html' %}
- {% endif %} - {% if book.oclc_number %} -
-
{% trans "OCLC Number:" %}
-
{{ book.oclc_number }}
+
+ {% include 'book/book_identifiers.html' %}
- {% endif %} - - {% if book.asin %} -
-
{% trans "ASIN:" %}
-
{{ book.asin }}
-
- {% endif %} -
- - {% include 'book/publisher_info.html' with book=book %} + {% endwith %} {% if book.openlibrary_key %}

{% trans "View on OpenLibrary" %}

diff --git a/bookwyrm/templates/book/book_identifiers.html b/bookwyrm/templates/book/book_identifiers.html new file mode 100644 index 000000000..d71ea4096 --- /dev/null +++ b/bookwyrm/templates/book/book_identifiers.html @@ -0,0 +1,27 @@ +{% spaceless %} + +{% load i18n %} + +
+ {% if book.isbn_13 %} +
+
{% trans "ISBN:" %}
+
{{ book.isbn_13 }}
+
+ {% endif %} + + {% if book.oclc_number %} +
+
{% trans "OCLC Number:" %}
+
{{ book.oclc_number }}
+
+ {% endif %} + + {% if book.asin %} +
+
{% trans "ASIN:" %}
+
{{ book.asin }}
+
+ {% endif %} +
+{% endspaceless %} diff --git a/bookwyrm/templates/book/editions.html b/bookwyrm/templates/book/editions.html index 91259465e..339e835f2 100644 --- a/bookwyrm/templates/book/editions.html +++ b/bookwyrm/templates/book/editions.html @@ -25,7 +25,18 @@ {{ book.title }} - {% include 'book/publisher_info.html' with book=book %} + + {% with book=book %} +
+
+ {% include 'book/publisher_info.html' %} +
+ +
+ {% include 'book/book_identifiers.html' %} +
+
+ {% endwith %}
{% include 'snippets/shelve_button/shelve_button.html' with book=book switch_mode=True %} From 415d6c4e3f485009b3803777fb633ed4215b56c4 Mon Sep 17 00:00:00 2001 From: Fabien Basmaison Date: Sun, 18 Apr 2021 18:24:32 +0200 Subject: [PATCH 2/2] Remove spacing between publisher info blocks. --- bookwyrm/templates/book/editions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/templates/book/editions.html b/bookwyrm/templates/book/editions.html index 339e835f2..70f067f76 100644 --- a/bookwyrm/templates/book/editions.html +++ b/bookwyrm/templates/book/editions.html @@ -28,7 +28,7 @@ {% with book=book %}
-
+
{% include 'book/publisher_info.html' %}