regluit/frontend/templates/new_edition.html

138 lines
5.4 KiB
HTML

{% extends "basedocumentation.html" %}
{% block extra_extra_head %}
{{ block.super }}
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen">
{{ form.media.css }}
<script type="text/javascript" src="{{ jquery_ui_home }}" ></script>
{{ form.media.js }}
{% endblock %}
{% block doccontent %}
{% if admin %}
{% if edition.pk %}
<h2>Edit Edition / Add Ebook Links for <a href="{% url work edition.work.id %}">{{ edition.work }}</a></h2>
{% else %}
<h2>Create New Edition</h2>
{% endif %}
{% else %}
{% if edition.pk %}
<h2>Add Ebook Links for <a href="{% url work edition.work.id %}">{{ edition.work }}</a></h2>
{% endif %}
{% endif %}
{% if admin %}
<p>Title and ISBN 13 are required; the rest is optional, though a cover image link is strongly recommended.</p>
<form enctype="multipart/form-data" method="POST" action="#">
{% csrf_token %}
{{ form.work }}
{{ form.non_field_errors }}
<div>
<p><b>Title</b>: {{ form.title.errors }}{{ form.title }}</p>
<p><b>Publisher Name</b> : {{ form.publisher_name.errors }}{{ form.publisher_name }}<br />(If you change this, click another form element before submitting)</p>
<p>
<b>Authors</b>:
{% if edition.pk and edition.authors or edition.new_author_names %}
<ul>
{% if edition.pk and edition.authors %}
{% for author in edition.authors.all %}
<li>{{ author.name }}<input type="submit" name="delete_author_{{ author.id }}" value="x" style="height: 20px;padding: .2em .6em;background-color: lightgray;margin-left: 1em;" title="delete author"></li>
{% endfor %}
{% endif %}
{% for author in edition.new_author_names %}
<li>{{ author }}<input type="hidden" name="new_author" value="{{ author }}" /></li>
{% endfor %}
</ul>
{% else %}
(None listed)
{% endif %}
</p>
<p><b>Add an Author</b> (<I>Firstname Lastname</I>): {{ form.add_author.errors }}{{ form.add_author }}
<input type="submit" name="add_author_submit" value="Add Author" id="submit_author"></p>
<p><b>Language</b>: {{ form.language.errors }}{{ form.language }}</p>
<h4> Identifiers </h4>
{% if id_msg %} <span class="errorlist">{{ id_msg }} </span>{% endif %}
<p> Enter 'delete' to remove the identifier. </p>
<p><b>ISBN-13</b>: {{ form.isbn.errors }}{{ form.isbn }}</p>
<p><b>OCLC Number</b>: {{ form.oclc.errors }}{{ form.oclc }}</p>
<p><b>Google Books ID</b>: {{ form.goog.errors }}{{ form.goog }}</p>
<p><b>GoodReads ID</b>: {{ form.gdrd.errors }}{{ form.gdrd }}</p>
<p><b>LibraryThing ID</b>: {{ form.thng.errors }}{{ form.thng }}</p>
{% if request.user.is_staff %}
<p><b>HTTP ID</b>: {{ form.http.errors }}{{ form.http }}</p>
{% endif %}
<p><b>Description</b>: <br />
{{ form.description.errors }}{{ form.description }}<br />
(<i>{% if work.last_campaign %}
{% ifequal work.last_campaign.type 3 %}
This will appear in the Description tab on the book page.
{% else %}
The campaign pitch will override this description.
{% endifequal %}
{% else %}
This will appear in the Description tab on the book page.
{% endif %}
</i>)</p>
<p><b>Publication Date</b> (<I>four-digit year</I>): {{ form.publication_date.errors }}{{ form.publication_date }}</p>
{% comment %}
this has been removed since there's no point in exposing subject functionality when we're not doing anything with it -- will just confuse people.
<p><b>Subjects</b>:
<ul>
{% if edition.work.pk and edition.work.subjects %}
{% for subject in edition.work.subjects.all %}
<li>{{ subject.name }}</li>
{% endfor %}
{% endif %}
{% for new_subject in edition.new_subjects %}
<li>{{ new_subject }}<input type="hidden" name="new_subject" value="{{ new_subject }}" /></li>
{% endfor %}
</ul>
<b>Add a Subject</b>: {{ form.add_subject.errors }}{{ form.add_subject }}
<input type="submit" name="add_subject_submit" value="Add Subject" id="submit_subject"></p>
{% endcomment %}
<p><b>Cover Image</b>: <br />
{% if edition.cover_image %}
<img src="{{edition.cover_image}}" /><br />
{% else %}
[ no cover specified for this edition ]<br />
{% endif %}
{{ form.cover_image.errors }}{{ form.cover_image }}{{ form.cover_image.help_text }}
(<i>Enter a URL for an image, ideally 120px wide. </i>)<br />
OR...<br />
{{ form.coverfile.errors }}{{ form.coverfile }}{{ form.coverfile.help_text }}
(<i>upload a cover image file, ideally 120px wide. </i>)<br />
</p>
</div>
<input type="submit" name="create_new_edition" value="{% if edition.pk %}Save Edits{% else %}Create Edition{% endif %}" id="submit">
</form>
{% if edition.work %}
<h2>More Edition Management</h2>
<div><a href="{% url merge edition.work.id %}">Merge other works into this one</a></div>
<div><a href="{% url work_editions edition.work.id %}">Remove editions from this work</a></div>
{% if request.user.is_staff %}
<div><a href="{% url feature edition.work.id %}">Feature this work today</a></div>
{% endif %}
<br />
{% endif %}
{% else %}
{% if edition.work %}
{% include 'edition_display.html' %}
{% else %}
Sorry, there's no work specified.
{% endif %}
{% endif %}
{% include 'edition_upload.html' %}
{% endblock %}