2015-04-28 03:24:02 +00:00
{% extends 'basepledge.html' %}
2016-05-11 14:41:50 +00:00
2012-05-13 20:32:34 +00:00
{% load humanize %}
2011-11-07 21:01:08 +00:00
{% block title %}Pledge{% endblock %}
2011-11-21 20:07:10 +00:00
{% block extra_extra_head %}
2012-05-15 23:31:49 +00:00
< script type = "text/javascript" src = "/static/js/reconcile_pledge.js" > < / script >
2012-11-27 18:32:25 +00:00
< script type = "text/javascript" src = "/static/js/loader-gif.js" > < / script >
2011-11-07 21:01:08 +00:00
{% endblock %}
2012-10-01 19:31:17 +00:00
{% block news %}
{% endblock %}
2011-11-07 21:01:08 +00:00
{% block doccontent %}
2012-05-14 19:56:19 +00:00
< div style = "height:15px" > < / div >
2012-02-15 16:03:58 +00:00
< 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 >
2012-02-15 16:03:58 +00:00
< / div >
2011-11-07 21:01:08 +00:00
2012-02-15 16:03:58 +00:00
< div class = "book-detail-info" >
2012-05-01 13:56:19 +00:00
< 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 >
2012-05-01 13:56:19 +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 >
2012-05-01 13:56:19 +00:00
< / div >
< / div >
< / div >
2012-03-28 15:31:50 +00:00
2013-02-18 17:12:41 +00:00
< div >
2013-08-20 02:54:43 +00:00
< div class = "thermometer" title = "{{ work.percent_of_goal }}% of goal" >
2013-02-07 20:25:14 +00:00
< div class = "cover" style = "width: {{ cover_width }}%;" >
< / div >
2013-03-15 19:51:17 +00:00
< span > {{ work.percent_of_goal }}% of goal< / span >
2013-02-07 20:25:14 +00:00
< / div >
< div class = "pledged-info noborder" >
< div class = "campaign-status-info" >
< span > ${{ work.last_campaign.current_total|floatformat:0|intcomma }}< / span > pledged
< / div >
< div class = "campaign-status-info" >
< span > ${{ work.last_campaign.target|floatformat:0|intcomma }}< / span > goal
< / 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" >
2013-03-15 19:51:17 +00:00
< span > {{ work.last_campaign.countdown }}< / span > to go
2013-02-07 20:25:14 +00:00
< / div >
< / div >
2012-02-15 16:03:58 +00:00
< / div >
< / div >
< / div >
2012-05-13 19:23:04 +00:00
< div class = "jsmodule rounded clearfix" >
2011-11-30 02:02:51 +00:00
< div class = "jsmod-content" >
2012-04-19 14:50:40 +00:00
{% if faqmenu == 'modify' %}
2012-05-13 19:23:04 +00:00
< div class = "modify_notification clearfix" > < h4 > You've already pledged to this campaign:< / h4 >
< div >
2014-12-17 17:50:23 +00:00
Amount: ${{transaction.amount|floatformat:2|intcomma}}.< br / >
2012-09-07 20:12:32 +00:00
Your premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}You did not request a premium for this campaign.{% endif %}< br / >
2012-05-13 19:23:04 +00:00
< / div >
2017-12-15 02:38:14 +00:00
< br / > You can modify your pledge below. < span id = "change_pledge_notice" > If you change your pledge to a donation, the pledge will be cancelled and your credit card charged immediately. < / span >
2012-05-13 19:23:04 +00:00
< / div >
2012-04-19 14:50:40 +00:00
{% endif %}
2017-12-15 02:38:14 +00:00
{% if work.last_campaign.status != 'ACTIVE' %}
2013-09-09 13:54:16 +00:00
< div class = "clearfix" > < h4 > Campaign NOT ACTIVE< / h4 >
This pledge form is not functional because the campaign is NOT ACTIVE.< br / > < br / > < br / >
< / div >
2017-12-15 02:38:14 +00:00
{% endif %}
2012-04-19 14:50:40 +00:00
2012-02-15 16:03:58 +00:00
{% comment %}
2017-12-15 02:38:14 +00:00
Even though there is a CampaignPledgeForm in frontend/forms.py , the "widget" for premium selection is implemented in HTML here for now.
2012-02-15 16:03:58 +00:00
{% endcomment %}
2011-11-30 16:58:26 +00:00
2015-04-28 03:24:02 +00:00
< form class = "pledgeform" method = "POST" action = "{% if faqmenu == 'modify' %}{% url 'pledge_modify' work_id=work.id %}{% else %}{% url 'pledge' work_id=work.id %}{% endif %}" >
2012-02-15 16:03:58 +00:00
{% csrf_token %}
{{ form.non_field_errors }}
2017-12-14 21:24:26 +00:00
< div class = "pledge_amount" > {{ form.preapproval_amount.label_tag }} {{ form.preapproval_amount.errors }}${{ form.preapproval_amount }}
{% if work.last_campaign.charitable %}
< div class = "pledgeform_label" > {{ form.donation }} {{ form.donation.label_tag }}< / div >
{% else %}
{% endif %}
< / div >
< div id = "select_premiums" >
2012-10-02 13:29:18 +00:00
{% if premiums|length > 1 %}
2017-12-14 21:24:26 +00:00
< div class = "pledge_amount premium_level" > Choose your premium< span id = "premium_note" > < / span > :< / div >
2012-10-02 13:29:18 +00:00
< div style = "height:10px;" > < / div >
< ul class = "support menu" id = "premiums_list" >
{% for premium_item in premiums %}
{% if premium_item.limit == 0 or premium_item.limit > premium_item.premium_count %}
< li class = "{% if forloop.first %}first{% else %}{% if forloop.last %}last{% endif %}{% endif %}" >
< label for = "premium_{{premium_item.id}}" >
2016-07-25 15:32:04 +00:00
< input type = "radio" name = "premium_id" id = "premium_{{premium_item.id}}" value = "{{premium_item.id}}" { % if request . GET . premium_id = = premium_item . id | stringformat: " s " % } checked = "checked" { % elif premium_id = = premium_item . id % } checked = "checked" { % endif % } / >
2012-10-02 13:29:18 +00:00
{% if premium_item.amount == 0 %}
< span class = "menu-item-price" >
Any amount
< / span >
{% else %}
< span class = "menu-item-price" >
2014-12-17 17:50:23 +00:00
${{ premium_item.amount|floatformat:0|intcomma }}
2012-10-02 13:29:18 +00:00
< / span >
{% endif %}
< span class = "menu-item-desc" >
{{ premium_item.description }} {% ifnotequal premium_item.limit 0 %}< br / > Only {{ premium_item.premium_remaining }} remaining! {% endifnotequal %}
< / span >
< / label > < / li >
2012-08-14 19:03:33 +00:00
{% endif %}
2012-10-02 13:29:18 +00:00
{% endfor %}
< / ul >
{% else %}
< div style = "height:10px;" > < / div >
< input type = "hidden" name = "premium_id" id = "premium_{{ premiums.0.id }}" value = "{{ premiums.0.id }}" checked = "checked" / >
{% comment %}
If the RH hasn't added any premiums, there's no point in displaying the "no premium" option, but we do need to check it off so the form will validate.
{% endcomment %}
{% endif %}
2017-12-14 21:24:26 +00:00
< / div >
2012-08-01 12:52:39 +00:00
< div class = "pledge_amount clearfix" id = "mandatory_premiums" >
2017-12-14 21:24:26 +00:00
< div > Depending on your support amount, you'll also get these acknowledgements.< / div >
2012-08-01 12:52:39 +00:00
< div class = "ack_active" > < div class = "ack_level" > Any amount< / div > < div class = "ack_header" > The unglued ebook will be delivered to your inbox.< / div > < / div >
2012-10-03 20:02:51 +00:00
< div id = "ack_name" class = "ack_inactive" > < div class = "ack_level" > $25+< / div > < div class = "ack_header" > You'll be listed on the acknowledgements page of the unglued ebook< span id = "ack_section" > < / span > . {{ form.ack_name.label_tag }} {{ form.ack_name.errors }}{{ form.ack_name }}< / div > < / div >
2012-08-01 12:52:39 +00:00
< div id = "ack_link" class = "ack_inactive" > < div class = "ack_level" > $50+< / div > < div class = "ack_header" > Your acknowledgement will link to your Unglue.it supporter page.{{ form.ack_link }}< / div > < / div >
< div id = "ack_dedication" class = "ack_inactive" > < div class = "ack_level" > $100+< / div > < div class = "ack_header" > Your acknowledgement can include a dedication (140 characters max). {{ form.ack_dedication.label_tag }} {{ form.ack_dedication.errors }}{{ form.ack_dedication }}< / div > < / div >
2012-07-24 12:08:34 +00:00
< / div >
2012-10-03 20:02:51 +00:00
< div id = "anonbox" > < I > {{ form.anonymous.label_tag }}< / I > {{ form.anonymous.errors }}{{ form.anonymous }}< / div >
2017-12-14 21:24:26 +00:00
< input name = "pledge" type = "submit" { % if faqmenu = = ' modify ' % } value = "Modify Pledge" { % else % } value = "Support Now" { % endif % } id = "pledgesubmit" class = "loader-gif" / >
2012-07-24 12:08:34 +00:00
< input name = "decoy" type = "submit" id = "fakepledgesubmit" disabled = "disabled" / >
{% comment %}
When the pledge amount and premium are in an inconsistent state, the real button is disabled and (via css) hidden; instead we display this fake button with a helpful message. It's a button so we can reuse all the existing CSS for buttons, so that it looks like the real button has just changed in appearance. It's hidden and the other one un-disabled and un-hidden when the pledge & premium return to a correct state. People without javascript enabled will miss out on the front-end corrections but form validation will catch it.
{% endcomment %}
2012-05-16 18:29:15 +00:00
< / form >
2011-11-07 21:01:08 +00:00
< / div >
2012-05-13 19:23:04 +00:00
< / div >
2012-08-31 07:16:04 +00:00
< div class = "cancel_notice" >
2015-04-28 03:24:02 +00:00
{% if faqmenu == 'modify' %}We hope you won't, but of course you're also free to < a href = "{% url 'pledge_cancel' campaign_id=work.last_campaign.id %}" > cancel your pledge< / a > .{% endif %}< / div >
2012-08-06 19:44:43 +00:00
< div id = "pass_supporter_name" style = "display: none;" > {{ request.user.username }}< / div >
2012-10-18 18:16:05 +00:00
2011-11-07 21:01:08 +00:00
{% endblock %}