regluit/frontend/templates/book_panel.html

152 lines
7.8 KiB
HTML

<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">
<div class="greenpanel_top">
<div class="unglued_white">
<!-- top section: campaign info + optional action button. Varies by campaign status. -->
{% if work.first_pdf_url or work.first_epub_url %}
<b>AVAILABLE!</b>
</div>
<div class="read_itbutton">{% if work.first_epub_url %}<a href="{{ work.first_epub_url }}">{% else %}<a href="{{ work.first_pdf_url }}">{% endif %}Read it Now</a></div>
{% else %}{% if status == 'SUCCESSFUL' %}
<b>UNGLUED!</b>
<p><b>On:</b> {{ deadline|date:"M d, Y" }}</p>
<p><b>Raised:</b> {{ work.last_campaign.current_total }}</p>
</div>
<div class="read_itbutton">{% if work.first_epub_url %}<a href="{{ work.first_epub_url }}">{% else %}<a href="{{ work.first_pdf_url }}">{% endif %}Read it Now</a></div>
{% else %}{% if status == 'ACTIVE' %}
<b>UNGLUE IT!</b>
<p><b>${{ work.last_campaign.current_total }}</b> raised</p><p><b>${{ work.last_campaign.target }}</b> needed</p>
<p>by {{ deadline|date:"M d, Y" }}</p>
</div>
<div class="read_itbutton pledge"><a href="/pledge/{{work.id}}">Support</a></div>
{% else %}{% if status == 'INITIALIZED' %}
<p>Campaign coming soon!</p>
</div>
{% else %}{% if status == 'SUSPENDED' %}
<p>This campaign has been suspended.</p><br /><p>See the <a href="{{faqurl}}">FAQ</a> for details.</p>
</div>
{% else %}{% if status == 'WITHDRAWN' %}
<p>This campaign has been withdrawn.</p><br /><p>See the <a href="{{faqurl}}">FAQ</a> for details.</p>
</div>
{% else %}{% if status == 'UNSUCCESSFUL' %}
<p>{{ deadline }}</p>
<p>Watch for a new campaign.</p>
</div>
{% else %}
<p>No campaign yet.</p><br /><p>But if lots of ungluers wishlist this book, maybe there will be!</p>
</div>
{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}
</div>
<!-- status of book vis-a-vis user's wishlist -->
{% if request.user.id in work.last_campaign.supporters %}
<div class="moreinfo on-wishlist">
<span>Pledged!</span>
</div>
{% else %}
{% ifequal supporter request.user %}
<div class="moreinfo remove-wishlist">
<span id="{{ work.id }}">Remove This</span>
</div>
{% else %}{% if request.user.is_anonymous %}
<div class="moreinfo create-account">
<span title="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">Login to Add</span>
</div>
{% else %}{% if work in request.user.wishlist.works.all %}
<div class="moreinfo on-wishlist">
<a href="#">On Wishlist!</a>
</div>
{% else %}
<div class="moreinfo add-wishlist">
<span id="{{ googlebooks_id }}">Add&nbsp;to&nbsp;Wishlist</span>
</div>
{% endif %}{% endif %}{% endifequal %}{% endif %}
<!-- bibliographic data -->
<div class="white_text">
<p><a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}">{{ work.title }}</a></p>
<p>{{ work.author }}</p>
</div>
<!-- link to work page -->
<div class="moreinfo">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}" target="_top">More Info</a>
</div>
</div>
</div>
<div class="listview panelfront side1 book-thumb">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks work.googlebooks_id %}{% endif %}" target="_top"><img src="{% if work.cover_image_thumbnail %}{{ work.cover_image_thumbnail }}{% else %}/static/images/generic_cover_larger.png{% endif %}" alt="Book cover" title="book cover" /></a>
</div>
<div class="listview panelfront side1 book-name">
<div class="title">
<a href="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">{{ work.title }}</a>
</div>
<div class="listview author {{ work.author }}">{{ work.author }}</div>
</div>
{% if request.user.id in work.last_campaign.supporters %}
<div class="listview panelfront side1 on-wishlist">
<span>Pledged!</span>
</div>
{% else %}
{% ifequal supporter request.user %}
<div class="listview panelfront side1 remove-wishlist">
<span id="{{ work.id }}">Remove This</span>
</div>
{% else %}{% if request.user.is_anonymous %}
<div class="listview panelfront side1 create-account">
<span title="{% if work.id %}{% url work work.id %}{% else %}{% url googlebooks googlebooks_id %}{% endif %}">Login to Add</span>
</div>
{% else %}{% if work in request.user.wishlist.works.all %}
<div class="listview panelfront side1 on-wishlist">
<span>On Wishlist!</span>
</div>
{% else %}
<div class="listview panelfront side1 add-wishlist">
<span id="{{ googlebooks_id }}">Add to Wishlist</span>
</div>
{% endif %}{% endif %}{% endifequal %}{% endif %}
<div class="listview panelfront side1 booklist-status">
<span class="booklist-status-label">Status:&nbsp;</span><span class="booklist-status-text">{{ status }}</span>
</div>
<div class="listview panelfront side1 icons">
{% if status == 'No campaign yet' or status == 'INITIALIZED' %}
<a href="{% url work work.id %}?tab=3" class="nobold"><span class="rounded"><span class="grey"><span class="panelnope">Wished by&nbsp;</span>{{ work.num_wishes }}</span></span></a>
{% else %}{% if work.first_pdf_url or work.first_epub_url %}
<span class="listview boolist-ebook">
{% if work.first_epub_url %}
<a href="{{ work.first_epub_url }}">EPUB</a>
{% endif %}
{% if work.first_pdf_url %}
<a href="{{ work.first_pdf_url }}">PDF</a>
{% endif %}
</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 %}
</div>
<div class="listview panelfront side1 ebooks">
</div>
<div class="unglue-this panelfront side1 none">
<div class="unglue-this-inner1">
<div class="unglue-this-inner2">
</div>
</div>
</div>
</div>
</div>