commit
5589e5d209
|
@ -615,6 +615,7 @@ class DownloadPageTest(TestCase):
|
|||
|
||||
e1 = models.Edition()
|
||||
e1.work = w
|
||||
e1.unglued = True
|
||||
e2 = models.Edition()
|
||||
e2.work = w
|
||||
e1.save()
|
||||
|
@ -623,7 +624,7 @@ class DownloadPageTest(TestCase):
|
|||
eb1 = models.Ebook()
|
||||
eb1.url = "http://example.com"
|
||||
eb1.edition = e1
|
||||
eb1.unglued = True
|
||||
eb1.format = 'epub'
|
||||
|
||||
eb2 = models.Ebook()
|
||||
eb2.url = "http://example2.com"
|
||||
|
@ -634,5 +635,5 @@ class DownloadPageTest(TestCase):
|
|||
|
||||
anon_client = Client()
|
||||
response = anon_client.get("/work/%s/download/" % w.id)
|
||||
self.assertContains(response, "http://example.com", count=2)
|
||||
self.assertContains(response, "http://example.com", count=3)
|
||||
self.assertContains(response, "http://example2.com", count=2)
|
|
@ -6,7 +6,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block extra_js %}
|
||||
<script type="text/javascript" src="/static/js/wishlist.js"></script>
|
||||
<script type="text/javascript" src="/static/js/readmill.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -51,7 +51,7 @@
|
|||
</div>
|
||||
{% if unglued_ebooks or other_ebooks %}
|
||||
<div class="border">
|
||||
<h3>How to download</h3>
|
||||
<a href="http://www.defectivebydesign.org/drm-free" style="float:right;"><img src="https://static.fsf.org/dbd/DRM-free/DRM-free150.png" alt="DefectiveByDesign.org" width="150" height="150" border="0" align="middle" /></a><h3>How to download</h3>
|
||||
<p>Ebooks you find at Unglue.it may be read on any device, and you're welcome to convert them to whatever electronic format is most useful to you. While we can't cover every possible combination of readers, software, and formats you might use, here's some help for the most common cases.</p>
|
||||
|
||||
<h4>Any device</h4>
|
||||
|
@ -59,6 +59,10 @@
|
|||
|
||||
<p>If this doesn't work, use the instructions below for your device.</p>
|
||||
|
||||
<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="{{ unglued_epub_url }}"; data-buy-url="{{ base_url }}{% url work work.id %}"; data-display="small" onload="/static/js/readmill.js"></div>
|
||||
|
||||
<h4>Android devices</h4>
|
||||
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png">Aldiko</p>
|
||||
|
||||
|
@ -114,9 +118,11 @@
|
|||
<p>Need help with something not listed here? Email us at <a href="mailto:support@gluejar.com?Subject=Ebook%20downloading%20help">support@gluejar.com</a>.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<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 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>
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block base_js %}
|
||||
<script type="text/javascript" src="{{ jquery_home }}"></script>
|
||||
{% block extra_js %}
|
||||
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
|
||||
<script type="text/javascript" src="/static/js/wishlist.js"></script>
|
||||
<script type="text/javascript" src="/static/js/tabs4.js"></script>
|
||||
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
|
||||
<script type="text/javascript" src="/static/js/counter.js"></script>
|
||||
<script type="text/javascript" src="/static/js/embed.js"></script>
|
||||
<script type="text/javascript" src="/static/js/readmill.js"></script>
|
||||
|
||||
<script>
|
||||
var $j = jQuery.noConflict();
|
||||
|
|
|
@ -2081,10 +2081,13 @@ def download(request, work_id):
|
|||
|
||||
unglued_ebooks = work.ebooks().filter(edition__unglued=True)
|
||||
other_ebooks = work.ebooks().filter(edition__unglued=False)
|
||||
unglued_epub_url = unglued_ebooks.filter(format='epub')[0].url
|
||||
|
||||
context.update({
|
||||
'unglued_ebooks': unglued_ebooks,
|
||||
'other_ebooks': other_ebooks
|
||||
'other_ebooks': other_ebooks,
|
||||
'unglued_epub_url': unglued_epub_url,
|
||||
'base_url': settings.BASE_URL
|
||||
})
|
||||
|
||||
return render(request, "download.html", context)
|
||||
|
|
|
@ -8,6 +8,10 @@ $j(document).ready(function() {
|
|||
event.preventDefault();
|
||||
$j("#lightbox").load( $j(this).attr("href") + " #lightbox_content");
|
||||
|
||||
if ($j(this).attr("href").substr(-9,8) == "download") {
|
||||
jQuery.getScript('/static/js/readmill.js');
|
||||
}
|
||||
|
||||
// fade-out rest of page elements on expand
|
||||
$j('#js-topsection').css({"opacity": "0.07"});
|
||||
$j('.launch_top').css({"opacity": "0.07"});
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
(function() {
|
||||
var st = document.createElement('script'); st.type = 'text/javascript'; st.async = true;
|
||||
st.src = 'https://platform.readmill.com/send.js';
|
||||
var p = document.getElementsByTagName('script')[0]; p.parentNode.insertBefore(st, p);
|
||||
})();
|
Loading…
Reference in New Issue