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.
This commit is contained in:
Fabien Basmaison 2021-04-18 15:59:02 +02:00
parent a507ad0d6a
commit 66c72c8b41
3 changed files with 46 additions and 23 deletions

View file

@ -67,31 +67,16 @@
</div> </div>
{% endif %} {% endif %}
<section class="content is-clipped"> <section class="is-clipped">
<dl> {% with book=book %}
{% if book.isbn_13 %} <div class="content">
<div class="is-flex is-justify-content-space-between is-align-items-center"> {% include 'book/publisher_info.html' %}
<dt>{% trans "ISBN:" %}</dt>
<dd itemprop="isbn">{{ book.isbn_13 }}</dd>
</div> </div>
{% endif %}
{% if book.oclc_number %} <div class="my-3">
<div class="is-flex is-justify-content-space-between is-align-items-center"> {% include 'book/book_identifiers.html' %}
<dt>{% trans "OCLC Number:" %}</dt>
<dd>{{ book.oclc_number }}</dd>
</div> </div>
{% endif %} {% endwith %}
{% if book.asin %}
<div class="is-flex is-justify-content-space-between is-align-items-center">
<dt>{% trans "ASIN:" %}</dt>
<dd>{{ book.asin }}</dd>
</div>
{% endif %}
</dl>
{% include 'book/publisher_info.html' with book=book %}
{% if book.openlibrary_key %} {% if book.openlibrary_key %}
<p><a href="https://openlibrary.org/books/{{ book.openlibrary_key }}" target="_blank" rel="noopener">{% trans "View on OpenLibrary" %}</a></p> <p><a href="https://openlibrary.org/books/{{ book.openlibrary_key }}" target="_blank" rel="noopener">{% trans "View on OpenLibrary" %}</a></p>

View file

@ -0,0 +1,27 @@
{% spaceless %}
{% load i18n %}
<dl>
{% if book.isbn_13 %}
<div class="is-flex">
<dt class="mr-1">{% trans "ISBN:" %}</dt>
<dd itemprop="isbn">{{ book.isbn_13 }}</dd>
</div>
{% endif %}
{% if book.oclc_number %}
<div class="is-flex">
<dt class="mr-1">{% trans "OCLC Number:" %}</dt>
<dd>{{ book.oclc_number }}</dd>
</div>
{% endif %}
{% if book.asin %}
<div class="is-flex">
<dt class="mr-1">{% trans "ASIN:" %}</dt>
<dd>{{ book.asin }}</dd>
</div>
{% endif %}
</dl>
{% endspaceless %}

View file

@ -25,7 +25,18 @@
{{ book.title }} {{ book.title }}
</a> </a>
</h2> </h2>
{% include 'book/publisher_info.html' with book=book %}
{% with book=book %}
<div class="columns is-multiline">
<div class="column is-half content">
{% include 'book/publisher_info.html' %}
</div>
<div class="column is-half ">
{% include 'book/book_identifiers.html' %}
</div>
</div>
{% endwith %}
</div> </div>
<div class="column is-3"> <div class="column is-3">
{% include 'snippets/shelve_button/shelve_button.html' with book=book switch_mode=True %} {% include 'snippets/shelve_button/shelve_button.html' with book=book switch_mode=True %}