2016-05-11 14:41:50 +00:00
< div class = "clearfix" >
2016-08-26 14:28:23 +00:00
{% if ebook_form and show_ebook_form %}
< div id = "add_ebook" >
2015-03-10 18:19:05 +00:00
{% if alert %}< div class = "yikes" > {{alert}}< / div > {% endif %}
2016-08-26 14:28:23 +00:00
{% if edition.ebooks.all.0 %}
< h2 > eBooks for this Edition< / h2 >
{% for ebook in edition.ebooks.all %}
{% if ebook.active %}
2016-08-24 19:41:29 +00:00
< a href = "{% url 'download_ebook' ebook.id %}" > {{ ebook.format }}< / a > {{ebook.rights}} at {{ebook.provider}}.
2016-09-23 18:53:54 +00:00
{% if ebook.version_label %} {{ ebook.version_label }} (v{{ ebook.version_iter }}). {% endif %}
2016-08-24 19:41:29 +00:00
Downloaded {{ ebook.download_count }} times since {{ ebook.created }}< br / >
2016-08-26 14:28:23 +00:00
{% endif %}
{% endfor %}
{% endif %}
2014-03-11 21:34:27 +00:00
2016-08-26 14:28:23 +00:00
< h2 > Add an eBook for this Edition:< / h2 >
2014-03-11 21:34:27 +00:00
2016-08-26 14:28:23 +00:00
< span > If you know that this edition is available as a public domain or Creative Commons ebook, you can enter the link here and "unglue" it. Right now, we're only accepting URLs that point to Internet Archive, Wikisources, Wikibooks, Hathitrust, Project Gutenberg, OApen, raw files at Github, or Google Books.< / span >
< form method = "POST" action = "#add_ebook" enctype = "multipart/form-data" >
{% csrf_token %}
{{ ebook_form.edition.errors }}{{ ebook_form.edition }}{{ ebook_form.user.errors }}{{ ebook_form.user }}{{ ebook_form.provider.errors }}{{ ebook_form.provider }}
< br / >
2018-07-30 16:56:12 +00:00
{{ ebook_form.url.errors }}{{ ebook_form.non_field_errors }}< span > Add a Link URL: {{ ebook_form.url }}< / span > < br / >
2016-08-26 14:28:23 +00:00
or...< br / >
{{ ebook_form.file.errors }}< span > Upload an ebook file: {{ ebook_form.file }}< / span > < br / > < br / >
{{ ebook_form.format.errors }}< span > File Format: {{ ebook_form.format }}< / span >
2016-09-23 18:53:54 +00:00
{{ ebook_form.rights.errors }}< span > License: {{ ebook_form.rights }}< / span > < br / > < br / >
< span > Version Label (optional): {% if edition.work.versions %}
< select id = 'version_label' >
< option value = "" > (no label) < / option >
{% for vers in edition.work.versions %}< option value = "{{ vers }}" > {{ vers }}< / option > {% endfor %}
< / select > or add a new version label:
2016-08-26 14:28:23 +00:00
{% endif %}
2016-09-23 18:53:54 +00:00
{{ ebook_form.new_version_label.errors }} {{ ebook_form.new_version_label }} < / span > < br / >
2016-08-26 14:28:23 +00:00
< br / > < input type = "submit" name = "add_ebook" value = "add link/upload ebook" / >
< / form >
< h3 > Note on versions< / h4 >
< p >
2016-09-23 18:53:54 +00:00
If you want ebooks from two editions with the same format and provider to display, give them different version labels.
2016-08-26 14:28:23 +00:00
< / p >
< / div >
{% else %}
< div > Adding ebook links is disabled for this work.< / div >
2014-03-11 21:34:27 +00:00
{% endif %}
< / div >