2020-03-28 22:06:16 +00:00
|
|
|
{% extends 'layout.html' %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
2020-03-30 00:02:17 +00:00
|
|
|
{% load humanize %}
|
2021-10-31 23:26:17 +00:00
|
|
|
{% load utilities %}
|
2021-02-28 18:00:36 +00:00
|
|
|
|
2021-03-02 17:01:31 +00:00
|
|
|
{% block title %}{% if book %}{% blocktrans with book_title=book.title %}Edit "{{ book_title }}"{% endblocktrans %}{% else %}{% trans "Add Book" %}{% endif %}{% endblock %}
|
2021-02-28 18:00:36 +00:00
|
|
|
|
2020-03-28 22:06:16 +00:00
|
|
|
{% block content %}
|
2021-01-14 22:13:23 +00:00
|
|
|
<header class="block">
|
|
|
|
<h1 class="title level-left">
|
2021-03-02 17:01:31 +00:00
|
|
|
{% if book %}
|
2021-03-05 01:09:49 +00:00
|
|
|
{% blocktrans with book_title=book.title %}Edit "{{ book_title }}"{% endblocktrans %}
|
2021-03-02 17:01:31 +00:00
|
|
|
{% else %}
|
|
|
|
{% trans "Add Book" %}
|
|
|
|
{% endif %}
|
2021-01-14 22:13:23 +00:00
|
|
|
</h1>
|
2021-03-08 17:28:22 +00:00
|
|
|
{% if book %}
|
2021-06-02 16:17:53 +00:00
|
|
|
<dl>
|
2021-10-01 16:24:26 +00:00
|
|
|
<dt class="is-pulled-left mr-5 has-text-weight-semibold">{% trans "Added:" %}</dt>
|
|
|
|
<dd class="ml-2">{{ book.created_date | naturaltime }}</dd>
|
2021-06-02 16:17:53 +00:00
|
|
|
|
2021-10-01 16:24:26 +00:00
|
|
|
<dt class="is-pulled-left mr-5 has-text-weight-semibold">{% trans "Updated:" %}</dt>
|
|
|
|
<dd class="ml-2">{{ book.updated_date | naturaltime }}</dd>
|
2021-06-02 16:17:53 +00:00
|
|
|
|
|
|
|
{% if book.last_edited_by %}
|
2021-10-01 16:24:26 +00:00
|
|
|
<dt class="is-pulled-left mr-5 has-text-weight-semibold">{% trans "Last edited by:" %}</dt>
|
|
|
|
<dd class="ml-2"><a href="{{ book.last_edited_by.remote_id }}">{{ book.last_edited_by.display_name }}</a></dd>
|
2021-06-02 16:17:53 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</dl>
|
2021-03-08 17:28:22 +00:00
|
|
|
{% endif %}
|
2021-01-14 22:13:23 +00:00
|
|
|
</header>
|
2020-03-28 22:06:16 +00:00
|
|
|
|
2021-08-21 18:38:57 +00:00
|
|
|
<form
|
|
|
|
class="block"
|
|
|
|
{% if book %}
|
|
|
|
name="edit-book"
|
|
|
|
action="{{ book.local_path }}/{% if confirm_mode %}confirm{% else %}edit{% endif %}"
|
|
|
|
{% else %}
|
|
|
|
name="create-book"
|
|
|
|
action="/create-book{% if confirm_mode %}/confirm{% endif %}"
|
|
|
|
{% endif %}
|
|
|
|
method="post"
|
|
|
|
enctype="multipart/form-data"
|
|
|
|
>
|
2021-03-05 01:09:49 +00:00
|
|
|
{% if confirm_mode %}
|
2021-09-29 20:18:27 +00:00
|
|
|
<div class="box">
|
|
|
|
<h2 class="title is-4">{% trans "Confirm Book Info" %}</h2>
|
|
|
|
<div class="columns mb-4">
|
|
|
|
{% if author_matches %}
|
|
|
|
<input type="hidden" name="author-match-count" value="{{ author_matches|length }}">
|
|
|
|
<div class="column is-half">
|
|
|
|
{% for author in author_matches %}
|
2021-10-29 05:13:05 +00:00
|
|
|
<fieldset>
|
|
|
|
<legend class="title is-5 mb-1">
|
2021-10-31 06:58:15 +00:00
|
|
|
{% blocktrans with name=author.name %}Is "{{ name }}" one of these authors?{% endblocktrans %}
|
2021-10-29 05:13:05 +00:00
|
|
|
</legend>
|
|
|
|
{% with forloop.counter0 as counter %}
|
2021-09-29 20:18:27 +00:00
|
|
|
{% for match in author.matches %}
|
2021-10-31 06:58:15 +00:00
|
|
|
<label class="label">
|
2021-09-29 20:18:27 +00:00
|
|
|
<input type="radio" name="author_match-{{ counter }}" value="{{ match.id }}" required>
|
|
|
|
{{ match.name }}
|
2021-06-02 16:17:53 +00:00
|
|
|
</label>
|
2021-10-31 06:58:15 +00:00
|
|
|
<p class="help ml-5 mb-2">
|
2021-11-21 21:49:22 +00:00
|
|
|
{% with book_title=match.book_set.first.title alt_title=match.bio %}
|
|
|
|
{% if book_title %}
|
|
|
|
<a href="{{ match.local_path }}" target="_blank">{% trans "Author of " %}<em>{{ book_title }}</em></a>
|
|
|
|
{% else %}
|
|
|
|
<a href="{{ match.id }}" target="_blank">{% trans "Author of " %}<em>{{ alt_title }}</em></a>
|
|
|
|
{% endif %}
|
|
|
|
{% endwith %}
|
2021-06-02 16:17:53 +00:00
|
|
|
</p>
|
2021-10-31 23:26:17 +00:00
|
|
|
<p class="help ml-5">
|
|
|
|
{{ author.existing_isnis|get_isni_bio:match }}
|
|
|
|
</p>
|
2021-11-01 08:50:49 +00:00
|
|
|
{{ author.existing_isnis|get_isni:match }}
|
2021-09-29 20:18:27 +00:00
|
|
|
{% endfor %}
|
2021-10-31 06:58:15 +00:00
|
|
|
<label class="label mt-2">
|
2021-09-29 20:18:27 +00:00
|
|
|
<input type="radio" name="author_match-{{ counter }}" value="{{ author.name }}" required> {% trans "This is a new author" %}
|
|
|
|
</label>
|
|
|
|
{% endwith %}
|
|
|
|
</fieldset>
|
2021-03-07 22:19:22 +00:00
|
|
|
{% endfor %}
|
2020-11-09 20:35:18 +00:00
|
|
|
</div>
|
2021-09-29 20:18:27 +00:00
|
|
|
{% else %}
|
|
|
|
<p class="column is-half">{% blocktrans with name=add_author %}Creating a new author: {{ name }}{% endblocktrans %}</p>
|
2021-09-29 18:36:35 +00:00
|
|
|
{% endif %}
|
2021-04-27 18:44:06 +00:00
|
|
|
|
2021-09-29 20:18:27 +00:00
|
|
|
{% if not book %}
|
|
|
|
<div class="column is-half">
|
|
|
|
<fieldset>
|
|
|
|
<legend class="title is-5 mb-1">
|
|
|
|
{% trans "Is this an edition of an existing work?" %}
|
|
|
|
</legend>
|
|
|
|
{% for match in book_matches %}
|
|
|
|
<label class="label">
|
|
|
|
<input type="radio" name="parent_work" value="{{ match.parent_work.id }}"> {{ match.parent_work.title }}
|
|
|
|
</label>
|
2020-11-24 21:37:35 +00:00
|
|
|
{% endfor %}
|
2021-09-29 20:18:27 +00:00
|
|
|
<label>
|
|
|
|
<input type="radio" name="parent_work" value="0" required> {% trans "This is a new work" %}
|
|
|
|
</label>
|
|
|
|
</fieldset>
|
2021-06-02 16:17:53 +00:00
|
|
|
</div>
|
2021-09-29 20:18:27 +00:00
|
|
|
{% endif %}
|
2020-11-24 21:37:35 +00:00
|
|
|
</div>
|
|
|
|
|
2021-09-29 20:18:27 +00:00
|
|
|
<button class="button is-primary" type="submit">{% trans "Confirm" %}</button>
|
|
|
|
<a href="#" class="button" data-back>
|
|
|
|
<span>{% trans "Back" %}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2021-05-18 23:10:43 +00:00
|
|
|
|
2021-09-29 20:18:27 +00:00
|
|
|
<hr class="block">
|
|
|
|
{% endif %}
|
2021-05-18 23:10:43 +00:00
|
|
|
|
2021-09-29 20:23:52 +00:00
|
|
|
{% include "book/edit/edit_book_form.html" %}
|
2020-04-02 15:44:53 +00:00
|
|
|
|
2021-03-08 22:11:08 +00:00
|
|
|
{% if not confirm_mode %}
|
2020-09-30 03:36:43 +00:00
|
|
|
<div class="block">
|
2021-02-28 02:48:10 +00:00
|
|
|
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
2021-10-16 14:11:12 +00:00
|
|
|
{% if book %}
|
2021-06-02 16:17:53 +00:00
|
|
|
<a class="button" href="{{ book.local_path }}">{% trans "Cancel" %}</a>
|
2021-10-16 14:11:12 +00:00
|
|
|
{% else %}
|
|
|
|
<a href="/" class="button" data-back>
|
|
|
|
<span>{% trans "Cancel" %}</span>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2020-04-04 20:46:10 +00:00
|
|
|
</div>
|
2021-03-08 22:11:08 +00:00
|
|
|
{% endif %}
|
2020-03-30 00:02:17 +00:00
|
|
|
</form>
|
2020-03-28 22:06:16 +00:00
|
|
|
|
|
|
|
{% endblock %}
|