don't link cover to google books if own cover
parent
c7071e2f44
commit
c5bb7220f2
|
@ -1120,7 +1120,13 @@ class Work(models.Model):
|
|||
@property
|
||||
def openlibrary_url(self):
|
||||
return "http://openlibrary.org" + self.openlibrary_id
|
||||
|
||||
|
||||
def uses_google_cover(self):
|
||||
if self.preferred_edition and self.preferred_edition.cover_image:
|
||||
return False
|
||||
else:
|
||||
return self.googlebooks_id
|
||||
|
||||
def cover_image_small(self):
|
||||
if self.preferred_edition and self.preferred_edition.cover_image_small():
|
||||
return self.preferred_edition.cover_image_small()
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<div class="js-maincol-inner">
|
||||
<div id="content-block">
|
||||
<div class="book-detail">
|
||||
{% if work.googlebooks_id %}
|
||||
{% if work.uses_google_cover %}
|
||||
<div id="book-detail-img">
|
||||
<a href="{{ work.googlebooks_url }}">
|
||||
<img src="{{ work.cover_image_thumbnail }}" alt="Find {{ work.title }} at Google Books" title="Find {{ work.title }} at Google Books" width="131" height="192" /></a>
|
||||
|
|
Loading…
Reference in New Issue