Merge branch 'relaunch' into relaunch_ry

pull/1/head
Raymond Yee 2012-09-24 09:09:11 -07:00
commit 4a82d59a49
8 changed files with 35 additions and 11 deletions

View File

@ -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)

View File

@ -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,11 @@
<p>If this doesn't work, use the instructions below for your device.</p>
{% if unglued_epub_url %}
<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>
{% endif %}
<h4>Android devices</h4>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png">Aldiko</p>
@ -114,9 +119,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>

View File

@ -181,6 +181,10 @@ Creative Commons offers a variety of other licenses, many of them with even less
<a id="blogs"></a><h2>Blog Coverage (Highlights)</h2>
<div class="pressarticles">
<div>
<a href="http://boingboing.net/2012/09/20/words-on-the-water.html">Words on the Water</a><br />
Boing Boing - September 20, 2012<br />
</div>
<div>
<a href="http://openfolklore.org/news/world-oral-literature-project-open-book-publishers-and-unglueit-release-new-open-edition-oral-l">First Book Comes Unglued</a><br />
Open Folklore - September 12, 2012<br />

View File

@ -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();

View File

@ -2010,10 +2010,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 = work.ebooks().filter(format='epub')[0].url if work.ebooks().filter(format='epub').count() else None
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)

View File

@ -24,7 +24,7 @@ https://github.com/aladagemre/django-notification/tarball/master
fabric
paramiko
pyasn1
pycrypto
pycrypto==2.5
django-maintenancemode
django-smtp-ssl
django-ckeditor

View File

@ -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"});

5
static/js/readmill.js Normal file
View File

@ -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);
})();