Merge branch 'main' into add-edit-book

This commit is contained in:
Mouse Reeve
2021-09-29 12:53:46 -07:00
15 changed files with 4761 additions and 4357 deletions

View File

@ -253,12 +253,27 @@
<div class="block">
<h2 class="title is-4">{% trans "Physical Properties" %}</h2>
<div class="field">
<label class="label" for="id_physical_format">{% trans "Format:" %}</label>
{{ form.physical_format }}
{% for error in form.physical_format.errors %}
<p class="help is-danger">{{ error | escape }}</p>
{% endfor %}
<div class="columns">
<div class="column is-one-third">
<div class="field">
<label class="label" for="id_physical_format">{% trans "Format:" %}</label>
<div class="select">
{{ form.physical_format }}
</div>
{% for error in form.physical_format.errors %}
<p class="help is-danger">{{ error | escape }}</p>
{% endfor %}
</div>
</div>
<div class="column">
<div class="field">
<label class="label" for="id_physical_format_detail">{% trans "Format details:" %}</label>
{{ form.physical_format_detail }}
{% for error in form.physical_format_detail.errors %}
<p class="help is-danger">{{ error | escape }}</p>
{% endfor %}
</div>
</div>
</div>
<div class="field">

View File

@ -4,13 +4,15 @@
{% load humanize %}
<p>
{% with format=book.physical_format pages=book.pages %}
{% 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 %}
<meta itemprop="bookFormat" content="{{ format }}">
<meta itemprop="bookFormat" content="{{ format_property }}">
{% endif %}
{% if pages %}