get works with ebooks into unglued tab

pull/1/head
eric 2012-01-16 12:10:38 -05:00
parent e94219fd0e
commit 97c9c03ba7
2 changed files with 13 additions and 6 deletions

View File

@ -287,6 +287,9 @@ class Work(models.Model):
campaign = self.last_campaign()
if campaign:
status = campaign.status
else:
if self.first_ebook() or self.first_epub():
status = "Available"
else:
status = "No campaign yet"
return status

View File

@ -1,4 +1,4 @@
<div class="thewholebook listview tabs {% if status == 'SUCCESSFUL' %}tabs-1{% else %}{% if status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}{% endif %}">
<div class="thewholebook listview tabs {% if status == 'SUCCESSFUL' or work.first_pdf_url or work.first_epub_url %}tabs-1{% else %}{% if status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}{% endif %}">
<div class="listview book-list">
<div class="listview panelback side2">
<div class="greenpanel2">
@ -124,21 +124,25 @@
{% if status == 'No campaign yet' or status == 'INITIALIZED' %}
<span class="rounded"><span class="grey"><span class="panelnope">Wished by&nbsp;</span>{{ work.wished_by.count }}</span></span>
{% else %}
{% if work.first_pdf_url or work.first_epub_url %}
<span class="rounded"><span class="grey"><span class="panelnope">Loved by&nbsp;</span>{{ work.wished_by.count }}</span></span>
{% else %}
<div class="booklist-status-img">
<img src="/static/images/images/icon-book-37by25-{{ work.percent_unglued }}.png" title="book list status" alt="book list status" />
</div>
<div class="booklist-status-label">{{ work.percent_unglued_number }}%</div>
{% endif %}
{% endif %}{% endif %}
</div>
<div class="listview panelfront side1 ebooks">
{% if work.first_epub_url %}
{% if work.first_epub_url and work.first_pdf_url %}
<span class="listview boolist-ebook">
{% if work.first_epub_url %}
<a href="{{ work.first_epub_url }}">epub</a>
</span>
{% endif %}
{% if work.first_pdf_url %}
<span class="listview boolist-ebook">
<a href="{{ work.first_pdf_url }}">pdf</a>
{% endif %}
</span>
{% endif %}
</div>