2021-09-29 20:18:27 +00:00
{% load i18n %}
{% if form.non_field_errors %}
< div class = "block" >
< p class = "notification is-danger" > {{ form.non_field_errors }}< / p >
< / div >
{% endif %}
{% csrf_token %}
< input type = "hidden" name = "last_edited_by" value = "{{ request.user.id }}" >
< div class = "columns" >
< div class = "column is-half" >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Metadata" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_title" >
{% trans "Title:" %}
< / label >
< input type = "text" name = "title" value = "{{ form.title.value|default:'' }}" maxlength = "255" class = "input" required = "" id = "id_title" aria-describedby = "desc_title" >
{% include 'snippets/form_errors.html' with errors_list=form.title.errors id="desc_title" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_subtitle" >
{% trans "Subtitle:" %}
< / label >
< input type = "text" name = "subtitle" value = "{{ form.subtitle.value|default:'' }}" maxlength = "255" class = "input" id = "id_subtitle" aria-describedby = "desc_subtitle" >
{% include 'snippets/form_errors.html' with errors_list=form.subtitle.errors id="desc_subtitle" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_description" >
{% trans "Description:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.description }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.description.errors id="desc_description" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "columns" >
< div class = "column is-two-thirds" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_series" >
{% trans "Series:" %}
< / label >
< input type = "text" class = "input" name = "series" id = "id_series" value = "{{ form.series.value|default:'' }}" aria-describedby = "desc_series" >
{% include 'snippets/form_errors.html' with errors_list=form.series.errors id="desc_series" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< div class = "column is-one-third" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_series_number" >
{% trans "Series number:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.series_number }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.series_number.errors id="desc_series_number" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_languages" >
{% trans "Languages:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.languages }}
2021-11-29 22:29:22 +00:00
< span class = "help" id = "desc_languages_help" >
{% trans "Separate multiple values with commas." %}
< / span >
{% include 'snippets/form_errors.html' with errors_list=form.languages.errors id="desc_languages" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / section >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Publication" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_publishers" >
{% trans "Publisher:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.publishers }}
2021-11-29 22:29:22 +00:00
< span class = "help" id = "desc_publishers_help" >
{% trans "Separate multiple values with commas." %}
< / span >
{% include 'snippets/form_errors.html' with errors_list=form.publishers.errors id="desc_publishers" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_first_published_date" >
{% trans "First published date:" %}
< / label >
< input type = "date" name = "first_published_date" class = "input" id = "id_first_published_date" { % if form . first_published_date . value % } value = "{{ form.first_published_date.value|date:'Y-m-d' }}" { % endif % } aria-describedby = "desc_first_published_date" >
{% include 'snippets/form_errors.html' with errors_list=form.first_published_date.errors id="desc_first_published_date" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_published_date" >
{% trans "Published date:" %}
< / label >
< input type = "date" name = "published_date" class = "input" id = "id_published_date" { % if form . published_date . value % } value = "{{ form.published_date.value|date:'Y-m-d'}}" { % endif % } aria-describedby = "desc_published_date" >
{% include 'snippets/form_errors.html' with errors_list=form.published_date.errors id="desc_published_date" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / section >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Authors" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
{% if book.authors.exists %}
< fieldset >
{% for author in book.authors.all %}
< div class = "is-flex is-justify-content-space-between" >
< label class = "label mb-2" >
2021-11-29 22:29:22 +00:00
< input type = "checkbox" name = "remove_authors" value = "{{ author.id }}" { % if author . id | stringformat: " i " in remove_authors % } checked { % endif % } aria-describedby = "desc_remove_author_{{author.id}}" >
2021-09-29 20:18:27 +00:00
{% blocktrans with name=author.name %}Remove {{ name }}{% endblocktrans %}
< / label >
2021-11-29 22:29:22 +00:00
< p class = "help" id = "desc_remove_author_{{author.id}}" >
2021-09-29 20:18:27 +00:00
< a href = "{{ author.local_path }}" > {% blocktrans with name=author.name %}Author page for {{ name }}{% endblocktrans %}< / a >
< / p >
< / div >
{% endfor %}
< / fieldset >
{% endif %}
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_add_author" >
{% trans "Add Authors:" %}
< / label >
2021-11-21 22:18:18 +00:00
{% for author in add_author %}
< label class = "label is-sr-only" for = "id_add_author{% if not forloop.first %}-{{forloop.counter}}{% endif %}" > {% trans "Add Author" %}< / label >
< input class = "input" type = "text" name = "add_author" id = "id_add_author{% if not forloop.first %}-{{forloop.counter}}{% endif %}" placeholder = "{% trans 'Jane Doe' %}" value = "{{ author }}" { % if confirm_mode % } readonly { % endif % } >
{% empty %}
< label class = "label is-sr-only" for = "id_add_author" > {% trans "Add Author" %}< / label >
< input class = "input" type = "text" name = "add_author" id = "id_add_author" placeholder = "{% trans 'Jane Doe' %}" value = "{{ author }}" { % if confirm_mode % } readonly { % endif % } >
{% endfor %}
2021-09-29 20:18:27 +00:00
< / div >
2021-11-30 22:21:28 +00:00
< span class = "help" > < button class = "button is-small" type = "button" data-duplicate = "id_add_author" id = "another_author_field" > {% trans "Add Another Author" %}< / button > < / span >
2021-09-29 20:18:27 +00:00
< / div >
< / section >
< / div >
< div class = "column is-half" >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Cover" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
< div class = "columns" >
{% if book.cover %}
< div class = "column is-3 is-cover" >
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-xl-mobile is-w-auto-tablet' size_mobile='xlarge' size='large' %}
< / div >
{% endif %}
< div class = "column" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_cover" >
{% trans "Upload cover:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.cover }}
< / div >
< div class = "field" >
< label class = "label" for = "id_cover_url" >
{% trans "Load cover from url:" %}
< / label >
2021-11-29 22:29:22 +00:00
< input class = "input" name = "cover-url" id = "id_cover_url" type = "url" value = "{{ cover_url|default:'' }}" aria-describedby = "desc_cover" >
2021-09-29 20:18:27 +00:00
< / div >
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.cover.errors id="desc_cover" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / div >
< / section >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Physical Properties" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
< div class = "columns" >
< div class = "column is-one-third" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_physical_format" >
{% trans "Format:" %}
< / label >
2021-09-29 20:18:27 +00:00
< div class = "select" >
{{ form.physical_format }}
< / div >
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.physical_format.errors id="desc_physical_format" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< div class = "column" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_physical_format_detail" >
{% trans "Format details:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.physical_format_detail }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.physical_format_detail.errors id="desc_physical_format_detail" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_pages" >
{% trans "Pages:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.pages }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.pages.errors id="desc_pages" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / section >
< section class = "block" >
2021-11-29 22:29:22 +00:00
< h2 class = "title is-4" >
{% trans "Book Identifiers" %}
< / h2 >
2021-09-29 20:18:27 +00:00
< div class = "box" >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_isbn_13" >
{% trans "ISBN 13:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.isbn_13 }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.isbn_13.errors id="desc_isbn_13" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_isbn_10" >
{% trans "ISBN 10:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.isbn_10 }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.isbn_10.errors id="desc_isbn_10" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_openlibrary_key" >
{% trans "Openlibrary ID:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.openlibrary_key }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.openlibrary_key.errors id="desc_openlibrary_key" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_inventaire_id" >
{% trans "Inventaire ID:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.inventaire_id }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.inventaire_id.errors id="desc_inventaire_id" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_oclc_number" >
{% trans "OCLC Number:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.oclc_number }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.oclc_number.errors id="desc_oclc_number" %}
2021-09-29 20:18:27 +00:00
< / div >
< div class = "field" >
2021-11-29 22:29:22 +00:00
< label class = "label" for = "id_asin" >
{% trans "ASIN:" %}
< / label >
2021-09-29 20:18:27 +00:00
{{ form.asin }}
2021-11-29 22:29:22 +00:00
{% include 'snippets/form_errors.html' with errors_list=form.ASIN.errors id="desc_ASIN" %}
2021-09-29 20:18:27 +00:00
< / div >
< / div >
< / section >
< / div >
< / div >