2015-04-28 03:24:02 +00:00
{% extends 'basepledge.html' %}
2016-05-11 14:41:50 +00:00
2013-08-16 19:49:44 +00:00
{% load humanize %}
2013-10-20 18:18:17 +00:00
{% load lib_acqs %}
2013-11-08 17:13:34 +00:00
{% load purchased %}
2013-08-16 19:49:44 +00:00
2014-12-16 19:18:51 +00:00
{% block title %}Purchase{% endblock %}
2013-08-16 19:49:44 +00:00
{% 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" >
2017-09-14 15:42:27 +00:00
< div id = "book-detail-img" class = "book-cover" >
2015-04-28 03:24:02 +00:00
< a href = "{% url 'work' work.id %}" > < img src = "{{ work.cover_image_thumbnail }}" alt = "{{ work.title }}" title = "{{ work.title }}" width = "131" height = "192" / > < / a >
2013-08-16 19:49:44 +00:00
< / div >
< div class = "book-detail-info" >
< div class = "layout" >
2015-04-28 03:24:02 +00:00
< h2 class = "book-name" > < a href = "{% url 'work' work.id %}" > {{ work.title }}< / a > < / h2 >
2013-08-16 19:49:44 +00:00
< div >
< div class = "pubinfo" >
2014-01-18 02:37:19 +00:00
< h3 class = "book-author" > {{ work.authors_short }}< / h3 >
2015-10-05 23:17:16 +00:00
< h3 class = "book-year" > {{ work.publication_date }}< / h3 >
2013-08-16 19:49:44 +00:00
< / 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 >
2013-11-10 01:34:13 +00:00
< div class = "campaign-status-info explainer" >
2013-08-16 19:49:44 +00:00
< span class = "current_cc_date" > {{ work.last_campaign.cc_date|date:"M j, Y" }}< / span >
2013-11-10 01:34:13 +00:00
< span class = "explanation" > After {{ work.last_campaign.cc_date|date:"M j, Y" }} this book will be available for free to anyone, anywhere. Every purchase before then brings that date closer.< / span >
2013-08-16 19:49:44 +00:00
< / 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 >
2013-11-10 01:34:13 +00:00
< div class = "campaign-status-info explainer" >
2013-08-16 19:49:44 +00:00
< span > ${{ work.last_campaign.left|floatformat:0|intcomma }}< / span > to go
2013-11-10 01:34:13 +00:00
< span class = "explanation" > ${{ work.last_campaign.left|floatformat:0|intcomma }} is the amount it would take to make this ebook free to the world tomorrow.< / span >
2013-08-16 19:49:44 +00:00
< / div >
< / div >
2013-08-20 02:54:43 +00:00
< 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 >
2014-05-20 16:19:34 +00:00
< li > < span class = "format_display" > < img src = "/static/images/epub32.png" height = "32" alt = "epub" title = "epub" / > (for iBooks, Nook, Kobo) < / span > < / li >
2013-08-27 22:03:35 +00:00
< / ul >
2013-08-20 02:54:43 +00:00
< / div >
2014-02-06 00:33:55 +00:00
2013-08-16 19:49:44 +00:00
< / div >
< / div >
< / div >
2013-08-20 02:54:43 +00:00
{% ifequal work.last_campaign.status "ACTIVE" %}
2013-11-08 17:13:34 +00:00
{% lib_acqs %}{% purchased %}
2013-08-16 19:49:44 +00:00
< div class = "jsmodule rounded clearfix" >
< div class = "jsmod-content" >
< form class = "pledgeform" method = "POST" action = "#" >
2013-11-08 17:13:34 +00:00
{% if borrowable %}
< div class = "pledge_amount" > This ebook can be borrowed from your library.< / div >
2015-04-28 03:24:02 +00:00
< div > < a href = "{% url 'borrow' work.id %}" class = "fakeinput" > Borrow Now< / a > < / div >
2013-11-08 17:13:34 +00:00
< div style = "height:75px;" > < / div >
2013-12-15 05:31:43 +00:00
{% else %}
2013-10-20 18:18:17 +00:00
{% if next_acq %}
< div class = "pledge_amount" > This ebook can be reserved from your library.< / div >
2013-11-08 17:13:34 +00:00
{% if on_hold %}
< div class = "bigger" style = "margin:20px" > You are on the {{ on_hold.library }} waiting list for this ebook.
{% if on_hold.held %}There are {{on_hold.held}} ahead of you.{% else %}You are first on the list.{% endif %}
You'll be notified when it's available, sometime after {{ next_acq.refreshes|date:"M j, Y"}}.< / div >
{% else %}
< div class = "bigger" style = "margin:20px" >
Available starting {{ next_acq.refreshes|date:"M j, Y"}} at {{ next_acq.user }}.
{% if next_acq.holds.count == 1 %}There is {{ next_acq.holds.count }} person waiting.{% endif %}
{% if next_acq.holds.count > 1 %}There are {{ next_acq.holds.count }} people waiting.{% endif %}
< / div >
2015-04-28 03:24:02 +00:00
< div > < a href = "{% url 'reserve' work.id %}?library={{ next_acq.user }}" class = "fakeinput" > Reserve Now< / a > < / div >
2013-11-08 17:13:34 +00:00
{% endif %}
2013-10-20 18:18:17 +00:00
< 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-12-15 05:31:43 +00:00
{% endif %}
2013-08-16 19:49:44 +00:00
{% csrf_token %}
{{ form.non_field_errors }}
{% if work.offers.all|length > 1 %}
2014-12-15 05:56:08 +00:00
< div class = "pledge_amount premium_level" > Purchase Options: Individual, Gift or Library?< / div >
2013-08-16 19:49:44 +00:00
< div style = "height:10px;" > < / div >
2014-12-15 05:56:08 +00:00
< ul class = "support menu" id = "offers_list" >
2013-10-11 21:50:54 +00:00
{% with work.last_campaign.individual_offer as offer %}
< li class = "first" >
2013-10-15 02:51:48 +00:00
{% if user_license.purchased %}
2014-12-20 18:03:20 +00:00
< span class = "menu-item-desc" > Individual license already {% if user_license.purchased.gifts.all.count %}a gift to you!{% else %}purchased!{% endif %}< / span >
2013-10-15 02:51:48 +00:00
{% else %}
< label for = "offer_{{offer.id}}" >
2014-12-16 19:18:51 +00:00
< input type = "radio" name = "offer_id" id = "offer_{{offer.id}}" value = "{{offer.id}}" { % if not give % } { % ifequal offer_id offer . id | stringformat: " s " % } checked = "checked" { % endifequal % } { % endif % } / >
2013-10-15 02:51:48 +00:00
< span class = "menu-item-price" >
2014-06-17 16:21:22 +00:00
${{ offer.price|floatformat:2|intcomma }}
2013-10-15 02:51:48 +00:00
< / span >
< span class = "menu-item-desc" >
{{ offer.get_license_display }}
< / span >
< / label >
{% endif %}
< / li >
2014-12-15 05:56:08 +00:00
< li id = "give_offer" >
< label for = "give_{{offer.id}}" >
< input type = "radio" name = "offer_id" id = "give_{{offer.id}}" value = "give{{offer.id}}" { % if give % } checked = "checked" { % endif % } / >
< span class = "menu-item-price" >
${{ offer.price|floatformat:2|intcomma }}
< / span >
< span class = "menu-item-desc" >
Give this ebook as a gift.
< / span >
< div class = "menu-item-desc {% if give %}on{% else %}off{% endif %}" id = "give_form" >
2014-12-16 19:18:51 +00:00
{{ form.give_to.errors }}
< span class = "give_label" > Recipient email: < / span > {{ form.give_to }}
2014-12-15 05:56:08 +00:00
< span class = "give_label" > Gift Message:< / span >
2014-12-16 19:18:51 +00:00
< textarea id = "give_message" rows = "3" name = "give_message" maxlength = "512" > I'm giving you '{{ work.title }}' at unglue.it. I hope you like it. - {{ request.user.username }} < / textarea >
2014-12-15 05:56:08 +00:00
< / div >
< / label >
< / li >
2013-10-15 02:51:48 +00:00
{% endwith %}
{% with work.last_campaign.library_offer as offer %}
< li class = "last" >
{% if request.user.profile.libraries %}
< label for = "offer_{{offer.id}}" >
2014-12-16 19:18:51 +00:00
< input type = "radio" name = "offer_id" id = "offer_{{offer.id}}" value = "{{offer.id}}" { % ifequal offer_id offer . id | stringformat: " s " % } checked = "checked" { % else % } { % if user . library % } checked = "checked" { % endif % } { % endifequal % } / >
2013-10-15 02:51:48 +00:00
< span class = "menu-item-price" >
2014-06-17 16:21:22 +00:00
${{ offer.price|floatformat:2|intcomma }}
2013-10-15 02:51:48 +00:00
< / span >
< span class = "menu-item-desc" >
2013-11-01 20:15:01 +00:00
< input type = "text" name = "copies" value = "1" size = "2" / >
2013-10-15 02:51:48 +00:00
{{ offer.get_license_display }} for
2013-10-15 20:18:30 +00:00
< select name = "library_id" class = "std_form" >
2013-10-15 02:51:48 +00:00
{% for library in request.user.profile.libraries %}
2013-10-15 20:18:30 +00:00
< option value = "{{library.id}}" > {{ library }}< / option >
2013-10-15 02:51:48 +00:00
{% endfor %}
2013-11-01 20:15:01 +00:00
< / select > {{ form.copies.errors }}{{ form.library_id.errors }}
2013-10-15 02:51:48 +00:00
< / span >
< / label >
{% else %}
2013-11-06 20:34:11 +00:00
< span class = "menu-item-desc" >
2015-04-28 03:24:02 +00:00
If you < a href = "{% url 'library_list' %}" > join a Library< / a > , you can share and borrow unglue.it ebooks!
2013-11-06 20:34:11 +00:00
< / span >
2013-10-15 02:51:48 +00:00
{% endif %}
< / li >
2013-10-11 21:50:54 +00:00
{% 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" / >
2013-11-01 20:15:01 +00:00
< input type = "hidden" name = "copies" value = "1" / >
2013-08-16 19:49:44 +00:00
{% endif %}
2014-12-16 19:18:51 +00:00
< div id = "anonbox" { % if give % } class = "off" { % endif % } > < I > {{ form.anonymous.label_tag }}< / I > {{ form.anonymous.errors }}{{ form.anonymous }}< / div >
2013-08-16 19:49:44 +00:00
< input name = "pledge" type = "submit" value = "Buy Now" id = "pledgesubmit" class = "loader-gif" / >
< input name = "decoy" type = "submit" id = "fakepledgesubmit" disabled = "disabled" / >
2013-12-15 05:31:06 +00:00
{% if request.user.credit.available > 0 %}
2018-02-07 21:44:29 +00:00
< div class = "bigger" style = "height:45px;clear:both" > You have an available Unglue.it credit of ${{ request.user.credit.available|intcomma }} which will be applied to your purchase.< / div >
2013-12-15 05:31:06 +00:00
{% endif %}
< / form >
2013-08-16 19:49:44 +00:00
< / div >
< / div >
2013-08-20 02:54:43 +00:00
{% else %}
< div > Campaign is not ACTIVE. < / div >
{% endifequal %}
2013-08-16 19:49:44 +00:00
{% endblock %}