regluit/frontend/templates/download.html

355 lines
22 KiB
HTML

{% extends "base.html" %}
{% with work.title as title %}
{% block title %}
— Downloads for {{ work.title }}
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/readmill.js"></script>
<script type="text/javascript" src="/static/js/embed.js"></script>
<script type="text/javascript" src="/static/js/download_page.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
// actually trigger the download_page function
$j(document).trigger('prettifyDownload');
});
</script>
{% endblock %}
{% block content %}
<div class="download_container">
<div id="lightbox_content">
<div class="border">
<h2>Downloads for <I><a href="{% url work work.id %}">{{ work.title }}</a></i></h2>
<div class="sharing not_unglued">
<h3 class="jsmod-title"><span>Share</span></h3>
<ul class="social menu">
{% with site.domain as domain %}
<a href="https://www.facebook.com/sharer.php?u=https://{{ site.domain }}{% url work work.id|urlencode:"" %}"><li class="facebook first"><span>Facebook</span></li></a>
<a href="https://twitter.com/intent/tweet?url={{ request.build_absolute_uri|urlencode:"" }}&amp;text=I%27m%20enjoying%20{{ work.title|urlencode }}%2C%20a%20free%2C%20non%2DDRM%20ebook%2E%20You%20can%20too%21"><li class="twitter"><span>Twitter</span></li></a>
{% endwith %}
<a href="{% url emailshare '' %}?next={% url work work.id %}"><li class="email"><span>Email</span></li></a>
<a href="#" id="embed2"><li class="embed"><span>Embed</span></li></a>
<div id="widgetcode2">Copy/paste this into your site:<br /><textarea rows="7" cols="22">&lt;iframe src="https://{{ request.META.HTTP_HOST }}/api/widget/{{ work.first_isbn_13 }}/" width="152" height="325" frameborder="0"&gt;&lt;/iframe&gt;</textarea></div>
</ul>
</div>
{% if unglued_ebooks %}
<div class="unglued">
<h3>Read the unglued edition!</h3>
<div class="ebook_download">
{% for ebook in unglued_ebooks %}
<a href="{% url download_ebook ebook.id %}">
<img src="{{ ebook.rights_badge }}" alt="{{ ebook.rights}}" title="{{ ebook.rights}}" /></a>
<a href="{% url download_ebook ebook.id %}"><img src="/static/images/{{ ebook.format }}32.png" height="32" alt="{{ ebook.format }}" title="{{ ebook.format }}" /></a>
<a href="{% url download_ebook ebook.id %}">{{ ebook.format }}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if other_ebooks %}
<div class="not_unglued">
{% if unglued_ebook %}
<h4>Other freely available editions</h4>
{% else %}
<h4>Freely available editions</h4>
{% endif %}
{% for ebook in other_ebooks %}
<a href="{% url download_ebook ebook.id %}">
<img src="{{ ebook.rights_badge }}" alt="{{ ebook.rights}}" title="{{ ebook.rights}}" /></a>
<a href="{% url download_ebook ebook.id %}"><img src="/static/images/{{ ebook.format }}32.png" height="32" alt="{{ ebook.format }} at {{ebook.provider}}" title="{{ ebook.format }} at {{ebook.provider}}" /></a>
<a href="{% url download_ebook ebook.id %}">{{ ebook.format }} at {{ ebook.provider }}</a>
{% ifequal ebook.format 'mobi' %} (use for Kindle){% endifequal %}
{% ifequal ebook.format 'epub' %} (use for Nook, Apple, Sony){% endifequal %}
{% if not forloop.last %}<br /><br />{% endif %}
{% endfor %}
</div>
{% endif %}
<div class="clearfix"></div>
</div>
{% if unglued_ebooks or other_ebooks %}
<div class="border">
<h3>Need instructions?</h3>
<div class="instructions">
<div id="iOS_app_div"{% if iOS_app %} class="active"{% endif %}>
<p>
Looks like you're using an embedded browser in an iOS app (maybe you followed a link in Twitter or Facebook?).
</p>
<p>
{% if formats.epub %}
Embedded browsers don't always know how to handle ebooks. We recommend downloading the <a href="{% url download_ebook formats.epub.id %}">epub file</a> using Safari.
{% else %}{% if formats.pdf %}
Embedded browsers don't always know how to handle ebooks. We recommend downloading the <a href="{% url download_ebook formats.pdf.id %}">pdf</a> file using Safari.
{% else %}{% if formats.html %}
You can read the <a href="{% url download_ebook formats.html.id %}">HTML version</a> of this book right here in this browser.
{% else %}{% if formats.text %}
You can read the <a href="{% url download_ebook formats.text.id %}">text version</a> of this book right here in this browser.
{% else %}
This ebook is only available in .mobi. Your best bet is to download the Amazon Kindle app to this device and then use the Send-to-Kindle option above.
{% endif %}{% endif %}{% endif %}{% endif %}
</p>
<p class="other_instructions_paragraph">
Not on iOS? Try the instructions for <a href="#" id="android" class="other_instructions">Android</a>, <a href="#" id="desktop" class="other_instructions">desktop computers</a>, or <a href="#" id="ereader" class="other_instructions">ereaders (Kindle, Nook, Kobo, etc.)</a>.
</p>
</div>
<div id="ios_div"{% if iOS %}{% if not iOS_app %} class="active"{% endif %}{% endif %}>
<h4>iOS devices</h4>
{% if formats.epub %}
<p>
You may already have an app which reads ebooks. Download the <a href="{% url download_ebook formats.epub.id %}">epub file</a> and see if you're offered an option for opening the file. If so, you're done! If not...
</p>
<p class="ebook_download logo"><img src="/static/images/ibooks_logo.jpeg" alt="iBooks Logo" />iBooks</p>
<ul>
<li><a href="http://itunes.apple.com/us/app/ibooks/id364709193?mt=8">Download the free iBooks app</a> from the App Store.</li>
<li>Download the <a href="{% url download_ebook formats.epub.id %}">epub file</a>.</li>
<li>You will be given the option of opening the file in iBooks.</li>
</ul>
{% else %}{% if formats.pdf %}
<p>
You may already have an app which reads ebooks. Download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a> and see if you're offered an option for opening the file. If so, you're done! If not...
</p>
<p class="ebook_download logo"><img src="/static/images/ibooks_logo.jpeg" alt="iBooks Logo" />iBooks</p>
<ul>
<li><a href="http://itunes.apple.com/us/app/ibooks/id364709193?mt=8">Download the free iBooks app</a> from the App Store.</li>
<li>Download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a>.</li>
<li>You will be given the option of opening the file in iBooks.</li>
</ul>
{% else %}{% if formats.html %}
<p>
Download the <a href="{% url download_ebook formats.html.id %}">HTML version</a>.
</p>
{% else %}{% if formats.text %}
<p>
Download the <a href="{% url download_ebook formats.text.id %}">text version</a>.
</p>
{% else %}
<p>
This ebook is only available in .mobi. Your best bet is to install the free Amazon Kindle app from the Apple Store and then use the Send-to-Kindle option above.
</p>
{% endif %}{% endif %}{% endif %}{% endif %}
<p class="other_instructions_paragraph">
Not on iOS? Try the instructions for <a href="#" id="android" class="other_instructions">Android</a>, <a href="#" id="desktop" class="other_instructions">desktop computers</a>, or <a href="#" id="ereader" class="other_instructions">ereaders (Kindle, Nook, Kobo, etc.)</a>.
</p>
</div>
<div id="android_div"{% if android %}class="active"{% endif %}>
<h4>Android devices</h4>
{% if formats.epub %}
<p>
You may already have an app which reads ebooks. Download the <a href="{% url download_ebook formats.epub.id %}">epub file</a> and see if you're offered an option for opening the file. If so, you're done! If not...
</p>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png" alt="Aldiko Logo" />Aldiko</p>
<ul>
<li><a href="http://www.aldiko.com/download.html">Download the free Aldiko app.</a></li>
<li>Download the <a href="{% url download_ebook formats.epub.id %}">epub file</a>.</li>
<li>When the download is complete, tap it in your notifications menu. It will be added to Aldiko, ready to read next time you open the app.</li>
</ul>
{% else %}{% if formats.pdf %}
<p>
You may already have an app which reads ebooks. Download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a> and see if you're offered an option for opening the file. If so, you're done! If not...
</p>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png" alt="Aldiko Logo" />Aldiko</p>
<ul>
<li><a href="http://www.aldiko.com/download.html">Download the free Aldiko app.</a></li>
<li>Download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a>.</li>
<li>When the download is complete, tap it in your notifications menu. It will be added to Aldiko, ready to read next time you open the app.</li>
</ul>
{% else %}{% if formats.html %}
<p>
Download the <a href="{% url download_ebook formats.html.id %}">HTML version</a>.
</p>
{% else %}{% if formats.text %}
<p>
Download the <a href="{% url download_ebook formats.text.id %}">text version</a>.
</p>
{% else %}
<p>
This ebook is only available in .mobi. Your best bet is to install the free Amazon Kindle app from Google Play and then use the Send-to-Kindle option above.
</p>
{% endif %}{% endif %}{% endif %}{% endif %}
<p class="other_instructions_paragraph">
Not on Android? Try the instructions for <a href="#" id="ios" class="other_instructions">iPhone/iPad</a>, <a href="#" id="desktop" class="other_instructions">desktop computers</a>, or <a href="#" id="ereader" class="other_instructions">ereaders (Kindle, Nook, Kobo, etc.)</a>.
</p>
</div>
<div id="desktop_div"{% if desktop %} class="active"{% endif %}>
<h4>PC, Mac, or Linux</h4>
{% if formats.pdf %}
<p>
You probably already have an app which reads PDFs. Download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a> and open it.
</p>
{% else %}{% if formats.epub %}
<p class="ebook_download logo"><img src="/static/images/calibre_logo.png" alt="Calibre Logo" />Calibre</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app.</a></li>
<li>Download the <a href="{% url download_ebook formats.epub.id %}">epub file</a>.</li>
<li>Open the file in Calibre.</li>
</ul>
{% else %}{% if formats.mobi %}
<p class="ebook_download logo"><img src="/static/images/calibre_logo.png" alt="Calibre Logo" />Calibre</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app.</a></li>
<li>Download the <a href="{% url download_ebook formats.mobi.id %}">mobi file</a>.</li>
<li>Open the file in Calibre.</li>
</ul>
{% else %}{% if formats.html %}
<p>
You can read the <a href="{% url download_ebook formats.html.id %}">HTML version</a> right here in your browser.
</p>
{% else %}
<p>
You can read the <a href="{% url download_ebook formats.text.id %}">text version</a> right here in your browser.
</p>
{% endif %}{% endif %}{% endif %}{% endif %}
<p class="other_instructions_paragraph">
Not on a desktop computer? Try the instructions for <a href="#" id="ios" class="other_instructions">iPhone/iPad</a>, <a href="#" id="android" class="other_instructions">Android</a>, or <a href="#" id="ereader" class="other_instructions">ereaders (Kindle, Nook, Kobo, etc.)</a>.
</p>
</div>
<div id="ereader_div"{% if desktop %}class="active"{% endif %}>
<h4>Ereaders (Kindle, Nook, Kobo, etc.)</h4>
{% if formats.mobi or formats.pdf or formats.epub %}
<ul>
<li>
{% if formats.mobi %}
<b>Kindle</b>: download the <a href="{% url download_ebook formats.mobi.id %}">mobi file</a> to your computer.
{% else %}{% if formats.pdf %}
<b>Kindle</b>: download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a> to your computer.
{% else %}
<b>Kindle</b>: We're sorry; we don't have a version suitable for Kindle.
{% endif %}{% endif %}
{% if formats.epub %}
<b>All other ereaders</b>: download the <a href="{% url download_ebook formats.epub.id %}">epub file</a> to your computer.
{% else %}{% if formats.pdf %}
<b>All other ereaders</b>: download the <a href="{% url download_ebook formats.pdf.id %}">pdf file</a> to your computer.
{% else %}
<b>All other ereaders</b>: We're sorry; we don't have a version suitable for your device.
{% endif %}{% endif %}
</li>
<li>Plug the ereader into your computer with a USB cable.</li>
<li>Using the Finder (Mac) or Windows Explorer (Windows), drag and drop the ebook file into the Documents folder on your device. (It may also be called My Documents or My Stuff, depending on your ereader.)</li>
<li>Eject your device from the Finder or Explorer and disconnect the USB.</li>
<li>You may need to reboot your device to see the new book.</li>
</ul>
{% else %}
<p>
We're sorry; we don't have a file format suitable for ereaders.
</p>
{% endif %}
<p class="other_instructions_paragraph">
Not using an ereader? Try the instructions for <a href="#" id="ios" class="other_instructions">iPhone/iPad</a>, <a href="#" id="android" class="other_instructions">Android</a>, or <a href="#" id="desktop" class="other_instructions">desktop computers</a>.
</p>
</div>
</div>
{% if kindle_ebook_id %}
<div id="kindle_div">
<h4>Send to Kindle</h4>
{% if request.user.is_authenticated and request.user.profile.kindle_email %}
<div class="yes_js">
<p>Sending...<img src="/static/images/loading.gif"></p>
<p>(For large files, this may take some time.)</p>
<p>If your Kindle email has changed, you can <a href="{% url kindle_config %}">add the new one to Unglue.it here</a>.</p>
</div>
<div class="no_js">
<p>
<form method="POST" action="{% url send_to_kindle kindle_ebook_id 0 %}">
<input type="submit" value="Send it!">
</form>
</p>
<p>(For large files, this may take some time.)</p>
<p>If your Kindle email has changed, you can <a href="{% url kindle_config %}">add the new one to Unglue.it here</a>.</p>
</div>
{% else %}
<ul>
<li>
Add kindle@gluejar.com to your approved personal document list under Personal Document Settings at your <a href="http://amazon.com/myk" target="_blank">Amazon Manage Your Kindle page</a>.
</li>
<li>
Then, enter your Kindle address below.
</li>
</ul>
<div class="yes_js">
<form method="POST" action="{% url send_to_kindle kindle_ebook_id 1 %}">
<label for="kindle_email">Your Kindle email address</label>
<input type="text" name="kindle_email">
<input type="submit" value="Send it!">
</form>
<p>
(This may take a moment.)
</p>
</div>
<div class="no_js">
<form method="POST" action="{% url send_to_kindle kindle_ebook_id 0 %}">
<label for="kindle_email">Your Kindle email address</label>
<input type="text" name="kindle_email">
<input type="submit" value="Send it!">
</form>
<p>
(This may take a moment.)
</p>
</div>
{% endif %}
</div>
{% endif %}
{% comment %}
will need to deal with readmill handling later
{% if readmill_epub_url %}
<div id="readmill_div">
<h4>Readmill users</h4>
<p>
If you're a <a href="http://readmill.com/">Readmill</a> member, you can send unglued ebooks to your iPad with one click. Here you go:
</p>
<div class="send-to-readmill" data-download-url="{{ readmill_epub_url }}" data-buy-url="{{ base_url }}{% url work work.id %}" data-display="small"></div>
<p>
If you're not, Readmill is a reading app designed for beauty, sharing, and conversation. You can <a href="https://readmill.com/">learn more and get Readmill here</a>.
</p>
</div>
{% endif %}
{% endcomment %}
{% comment %}
If we're going to be providing mobi as the norm, let's not bother with these instructions.
<div class="instructions">
<h4>Converting epubs for Kindle</h4>
<p>Kindles can read plain text, MOBI, PDF, and HTML files. They cannot read epub books (the format unglued ebooks are released in). However, you can convert epubs to mobi files using free software.</p>
<ul>
<li><a href="http://calibre-ebook.com/download">Download the free Calibre app</a> to a desktop or laptop computer.</li>
<li>Download your book from this page onto the desktop or laptop.</li>
<li>Open the ebook file in Calibre.</li>
<li>Convert the epub to a mobi file: select the file; click on "convert books"; and set the output format to mobi.</li>
<li>When the conversion is done, put the file on your device using the instructions for ereaders above. If you've set up your Kindle email address at Amazon.com, you can also email it to yourself using the "Connect/share" button, without needing to plug your Kindle in. Calibre will walk you through the process of setting up your Kindle email in Calibre.</li>
</ul>
</div>
{% endcomment %}
<br />
<h4>Need more help?</h4>
<p>Email us at <a href="mailto:support@gluejar.com?Subject=Ebook%20downloading%20help">support@gluejar.com</a>.</p>
<div>
<a href="http://www.defectivebydesign.org/drm-free"><img src="https://static.fsf.org/dbd/DRM-free/DRM-free150.png" alt="DefectiveByDesign.org" border="0" align="middle" /></a> All downloads from Unglue.it are DRM free. Hooray!
</div>
</div>
{% else %}
<div class="border">
<p id="content-block">There are no freely available downloads of <I>{{ work.title }}</I> right now. {% if not work in request.user.wishlist.works.all %}Would you like there to be? <a class="add-wishlist"><span class="work_id" id="w{{ work.id }}">Add this book to your wishlist.</span></a>{% else %}Ask your friends to add it to their wishlists!{% endif %}</p>
<p>If you know of a Creative-Commons-licensed or US public domain edition of this book, you can add it through the <a href="{% url work work.id %}?tab=4">Rights tab of the book page</a>.</p>
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% endwith %}