regluit/frontend/templates/purchase.html

151 lines
7.2 KiB
HTML
Raw Normal View History

2013-08-16 19:49:44 +00:00
{% extends "basepledge.html" %}
{% load humanize %}
2013-10-20 18:18:17 +00:00
{% load lib_acqs %}
2013-08-16 19:49:44 +00:00
{% block title %}Pledge{% endblock %}
{% block extra_extra_head %}
<script type="text/javascript" src="/static/js/reconcile_pledge.js"></script>
<script type="text/javascript" src="/static/js/loader-gif.js"></script>
{% endblock %}
{% block news %}
{% endblock %}
{% block doccontent %}
<div style="height:15px"></div>
<div class="book-detail">
<div id="book-detail-img">
<a href="{% url work work.id %}"><img src="{{ work.cover_image_thumbnail }}" alt="{{ work.title }}" title="{{ work.title }}" width="131" height="192" /></a>
</div>
<div class="book-detail-info">
<div class="layout">
<h2 class="book-name"><a href="{% url work work.id %}">{{ work.title }}</a></h2>
<div>
<div class="pubinfo">
<h3 class="book-author">{{ work.author }}</h3>
<h3 class="book-year">{{ work.publication_date_year }}</h3>
</div>
</div>
</div>
<div>
<div class="thermometer" title="{{ work.percent_of_goal }}% of goal">
<div class="cover" style="width: {{ cover_width }}%;">
</div>
<span>{{ work.percent_of_goal }}% of goal</span>
</div>
<div class="pledged-info noborder">
<div class="campaign-status-info">
current ungluing date:
</div>
<div class="campaign-status-info">
<span class="current_cc_date">{{ work.last_campaign.cc_date|date:"M j, Y" }}</span>
</div>
<div class="campaign-status-info">
{% if work.last_campaign.supporters_count == 1 %}
<span>1</span> ungluer
{% else %}
<span>{{ work.last_campaign.supporters_count }}</span> ungluers
{% endif %}
</div>
<div class="campaign-status-info">
<span>${{ work.last_campaign.left|floatformat:0|intcomma }}</span> to go
</div>
</div>
<div class="find-book">
2013-08-27 22:03:35 +00:00
<h4>Available formats...</h4>
<ul>
<li><span class="format_display"><img src="/static/images/mobi32.png" height="32" alt="mobi" title="mobi" /> (for Kindle) </span></li>
<li><span class="format_display"><img src="/static/images/epub32.png" height="32" alt="epub" title="epub" /> (for iBooks, Readmill, Nook, Kobo) </span></li>
</ul>
</div>
2013-08-16 19:49:44 +00:00
</div>
</div>
</div>
{% ifequal work.last_campaign.status "ACTIVE" %}
2013-10-20 18:18:17 +00:00
{% lib_acqs %}
2013-08-16 19:49:44 +00:00
<div class="jsmodule rounded clearfix">
<div class="jsmod-content">
<form class="pledgeform" method="POST" action="#">
2013-10-20 18:18:17 +00:00
{% if next_acq %}
<div class="pledge_amount">This ebook can be reserved from your library.</div>
<div class="bigger" style="margin:20px">Available starting {{ next_acq.refreshes|date:"M j, Y"}} at {{ next_acq.user }}.</div>
<div><a href="{% url reserve work.id%}?library={{ next_acq.user }}" class="fakeinput">Reserve Now</a> </div>
<div style="height:30px;"></div>
<div class="bigger" style="height:30px;clear:both;margin:20px">If you'd rather not wait, consider one of the purchase options.</div>
{% endif %}
2013-08-16 19:49:44 +00:00
{% csrf_token %}
{{ form.non_field_errors }}
{% if work.offers.all|length > 1 %}
2013-10-20 18:18:17 +00:00
<div class="pledge_amount premium_level">Purchase Options: Individual or Library?</div>
2013-08-16 19:49:44 +00:00
<div style="height:10px;"></div>
<ul class="support menu" id="premiums_list">
{% with work.last_campaign.individual_offer as offer %}
<li class="first">
{% if user_license.purchased %}
<span class="menu-item-desc">Individual license already purchased!</span>
{% else %}
<label for="offer_{{offer.id}}">
<input type="hidden" name="copies" value="1" />
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% endifequal %}{% endifequal %} />
<span class="menu-item-price">
${{ offer.price|intcomma }}
</span>
<span class="menu-item-desc">
{{ offer.get_license_display }}
</span>
</label>
{% endif %}
</li>
{% endwith %}
{% with work.last_campaign.library_offer as offer %}
<li class="last">
{% if request.user.profile.libraries %}
<label for="offer_{{offer.id}}">
<input type="radio" name="offer_id" id="offer_{{offer.id}}" value="{{offer.id}}" {% ifequal request.REQUEST.offer_id offer.id|stringformat:"s" %}checked="checked"{% else %} {% ifequal offer_id offer.id %}checked="checked"{% endifequal %}{% endifequal %} />
<span class="menu-item-price">
${{ offer.price|intcomma }}
</span>
<span class="menu-item-desc">
<input type="text" name="copies" value="1" size="2" />
{{ offer.get_license_display }} for
2013-10-15 20:18:30 +00:00
<select name="library_id" class="std_form">
{% for library in request.user.profile.libraries %}
2013-10-15 20:18:30 +00:00
<option value="{{library.id}}">{{ library }}</option>
{% endfor %}
</select>{{ form.copies.errors }}{{ form.library_id.errors }}
</span>
</label>
{% else %}
<a href="{% url library_list %}"><span class="menu-item-desc">
Join a Library to share and borrow unglue.it ebooks
</span></a>
{% endif %}
</li>
{% endwith %}
2013-08-16 19:49:44 +00:00
</ul>
{% else %}
<div style="height:10px;"></div>
<input type="hidden" name="offer_id" id="offer_{{ offers.0.id }}" value="{{ offers.0.id }}" checked="checked" />
<input type="hidden" name="copies" value="1" />
2013-08-16 19:49:44 +00:00
{% endif %}
<div id="anonbox"><I>{{ form.anonymous.label_tag }}</I> {{ form.anonymous.errors }}{{ form.anonymous }}</div>
<input name="pledge" type="submit" value="Buy Now" id="pledgesubmit" class="loader-gif" />
<input name="decoy" type="submit" id="fakepledgesubmit" disabled="disabled" />
</form>
</div>
</div>
{% else %}
<div>Campaign is not ACTIVE. </div>
{% endifequal %}
2013-08-16 19:49:44 +00:00
{% endblock %}