Merge branch 'master' into relaunch

pull/1/head
Raymond Yee 2012-09-14 17:05:29 -07:00
commit da2f1e0665
7 changed files with 39 additions and 3 deletions

View File

@ -483,6 +483,9 @@ class Work(models.Model):
@property
def googlebooks_id(self):
preferred_id=self.preferred_edition.googlebooks_id
if preferred_id:
return preferred_id
try:
return self.identifiers.filter(type='goog')[0].value
except IndexError:
@ -497,6 +500,9 @@ class Work(models.Model):
@property
def goodreads_id(self):
preferred_id=self.preferred_edition.goodreads_id
if preferred_id:
return preferred_id
try:
return self.identifiers.filter(type='gdrd')[0].value
except IndexError:
@ -648,6 +654,9 @@ class Work(models.Model):
self.save()
def first_isbn_13(self):
preferred_id=self.preferred_edition.isbn_13
if preferred_id:
return preferred_id
try:
return self.identifiers.filter(type='isbn')[0].value
except IndexError:

View File

@ -100,7 +100,7 @@
</div>
<div class="launch_top">
It's here: our first unglued edition. You can now <a href="/work/81724/download/" class="hijax">download <I>Oral Literature in Africa</I></a>.
It's here: our first unglued edition. You can now <a href="/work/81724/">download <I>Oral Literature in Africa</I></a>.<br /><br />Campaigns to unglue more books <a href="http://blog.unglue.it/2012/09/13/update-on-unglue-it-relaunch/">will relaunch soon</a>.
</div>
{% block topsection %}{% endblock %}
{% block content %}{% endblock %}

View File

@ -13,7 +13,7 @@
<div class="download_container">
<div id="lightbox_content">
<div class="border">
<h2>Downloads for {{ work.title }}</h2>
<h2>Downloads for <I><a href="{% url work work.id %}">{{ work.title }}</a></i></h2>
{% if unglued_ebooks %}
<div class="unglued">
<h3>Read the unglued edition!</h3>

View File

@ -105,6 +105,9 @@
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content h2 a {
font-size: 18.75px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;

View File

@ -230,6 +230,9 @@
#lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content h2 a {
font-size: 18.75px;
}
#lightbox_content .ebook_download a {
margin: auto 5px auto 0;
font-size: 15px;

View File

@ -55,7 +55,7 @@ $j().ready(function() {
// we're going to have to tell /wishlist/ that we're feeding it a different identifier
contentblock.on("click", "div.remove-wishlist-workpage", function () {
var span = $j(this).find("span");
var work_id = span.attr('id').substring(1)
var work_id = span.attr('id').substring(1);
// provide feedback
span.html('Removing...');
@ -70,3 +70,19 @@ $j().ready(function() {
});
});
});
var $k = jQuery.noConflict();
// allows user to re-add on work page after erroneously removing, without page reload
// can't bind this to document ready because the .add-wishlist-workpage div doesn't exist until remove-wishlist is executed
$k(document).on("click", ".add-wishlist-workpage span", function() {
var span = $k(this);
var work_id = span.attr("class");
if (!work_id) return;
jQuery.post('/wishlist/', {'add_work_id': work_id}, function(data) {
span.fadeOut();
var newSpan = $k('<span class="on-wishlist">On Wishlist!</span>').hide();
span.replaceWith(newSpan);
newSpan.fadeIn('slow');
newSpan.removeAttr("id");
});
});

View File

@ -16,6 +16,11 @@
#lightbox_content h2, #lightbox_content h3, #lightbox_content h4 {
margin-top: 15px;
}
#lightbox_content h2 a {
font-size: @font-size-larger*1.25;
}
#lightbox_content .ebook_download {