implement donation options
parent
6313d4a216
commit
4aeae6e67c
|
@ -68,6 +68,7 @@ class AcqAdmin(ModelAdmin):
|
|||
class PremiumAdmin(ModelAdmin):
|
||||
list_display = ('campaign', 'amount', 'description')
|
||||
date_hierarchy = 'created'
|
||||
fields = ('type', 'amount', 'description', 'limit')
|
||||
|
||||
class CampaignAdminForm(forms.ModelForm):
|
||||
managers = AutoCompleteSelectMultipleField(
|
||||
|
@ -77,8 +78,10 @@ class CampaignAdminForm(forms.ModelForm):
|
|||
)
|
||||
class Meta(object):
|
||||
model = models.Campaign
|
||||
fields = ('managers', 'name', 'description', 'details', 'license', 'activated', 'paypal_receiver',
|
||||
'status', 'type', 'email', 'do_watermark', 'use_add_ask', )
|
||||
fields = (
|
||||
'managers', 'name', 'description', 'details', 'license', 'paypal_receiver',
|
||||
'status', 'type', 'email', 'do_watermark', 'use_add_ask', 'charitable',
|
||||
)
|
||||
|
||||
class CampaignAdmin(ModelAdmin):
|
||||
list_display = ('work', 'created', 'status')
|
||||
|
|
|
@ -465,7 +465,7 @@
|
|||
"pk": 150,
|
||||
"model": "core.premium",
|
||||
"fields": {
|
||||
"description": "No premium, thanks! I just want to help unglue.",
|
||||
"description": "Nothing extra, thanks! I just want to support this campaign.",
|
||||
"campaign": null,
|
||||
"created": "2011-11-17T22:03:37",
|
||||
"amount": "0",
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
"campaign": null,
|
||||
"amount": 0,
|
||||
"type": "00",
|
||||
"description": "No premium, thanks! I just want to help unglue.",
|
||||
"description": "Nothing extra, thanks! I just want to support this campaign",
|
||||
"created": "2011-11-17 22:03:37"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0011_auto_20171110_1253'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='campaign',
|
||||
name='charitable',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -400,6 +400,7 @@ class Campaign(models.Model):
|
|||
publisher = models.ForeignKey("Publisher", related_name="campaigns", null=True)
|
||||
do_watermark = models.BooleanField(default=True)
|
||||
use_add_ask = models.BooleanField(default=True)
|
||||
charitable = models.BooleanField(default=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.problems = []
|
||||
|
|
|
@ -200,9 +200,11 @@ def notify_unclaimed_gifts():
|
|||
unclaimed = Gift.objects.filter(used=None)
|
||||
for gift in unclaimed:
|
||||
"""
|
||||
send notice every 7 days
|
||||
send notice every 7 days, but stop at 10x
|
||||
"""
|
||||
unclaimed_duration = (now() - gift.acq.created ).days
|
||||
if unclaimed_duration > 70:
|
||||
return
|
||||
if unclaimed_duration > 0 and unclaimed_duration % 7 == 0 : # first notice in 7 days
|
||||
notification.send_now([gift.acq.user], "purchase_gift_waiting", {'gift':gift}, True)
|
||||
notification.send_now([gift.giver], "purchase_notgot_gift", {'gift':gift}, True)
|
||||
|
|
|
@ -385,12 +385,12 @@ class CampaignPledgeForm(forms.Form):
|
|||
min_value=D('1.00'),
|
||||
max_value=D('2000.00'),
|
||||
decimal_places=2,
|
||||
label="Pledge Amount",
|
||||
label="Support Amount",
|
||||
)
|
||||
def amount(self):
|
||||
return self.cleaned_data["preapproval_amount"] if self.cleaned_data else None
|
||||
|
||||
anonymous = forms.BooleanField(required=False, label=_("Make this pledge anonymous, please"))
|
||||
anonymous = forms.BooleanField(required=False, label=_("Make this support anonymous, please"))
|
||||
ack_name = forms.CharField(
|
||||
required=False,
|
||||
max_length=64,
|
||||
|
@ -399,6 +399,7 @@ class CampaignPledgeForm(forms.Form):
|
|||
ack_dedication = forms.CharField(required=False, max_length=140, label=_("Your dedication:"))
|
||||
|
||||
premium_id = forms.IntegerField(required=False)
|
||||
donation = forms.BooleanField(required=False, label=_("Make this a donation, not a pledge."))
|
||||
premium = None
|
||||
|
||||
@property
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% load purchased %}
|
||||
{% load lib_acqs %}
|
||||
{% load bookpanel %}
|
||||
{% with first_ebook=work.first_ebook supporters=work.last_campaign.supporters thumbnail=work.cover_image_thumbnail author=work.authors_short title=work.title last_campaign=work.last_campaign status=work.last_campaign.status deadline=work.last_campaign.deadline workid=work.id wishlist=request.user.wishlist.works.all %}
|
||||
{% with first_ebook=work.first_ebook thumbnail=work.cover_image_thumbnail author=work.authors_short title=work.title last_campaign=work.last_campaign status=work.last_campaign.status deadline=work.last_campaign.deadline workid=work.id wishlist=request.user.wishlist.works.all %}
|
||||
{% purchased %}{% lib_acqs %}{% bookpanel %}
|
||||
<div class="thewholebook listview tabs {% if tab_override %}{{tab_override}}{% elif first_ebook or status == 'SUCCESSFUL' %}tabs-1{% elif status == 'ACTIVE' %}tabs-2{% else %}tabs-3{% endif %}">
|
||||
<div class="listview book-list">
|
||||
|
@ -109,7 +109,7 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if request.user.id in supporters %}
|
||||
{% if not supported %}
|
||||
<div class="white_text bottom_button">
|
||||
{% include "book_panel_addbutton.html" %}
|
||||
</div>
|
||||
|
@ -119,7 +119,7 @@
|
|||
</div>
|
||||
<div class="white_text bottom_button" >
|
||||
{% if work.last_campaign.type == 1 %}
|
||||
<a href="{% url 'pledge' work_id=workid %}"><span class="read_itbutton pledge button_text"><span>Pledge</span></span></a>
|
||||
<a href="{% url 'pledge' work_id=workid %}"><span class="read_itbutton pledge button_text"><span>Support</span></span></a>
|
||||
{% elif work.last_campaign.type == 2 %}
|
||||
{% if in_library %}
|
||||
<a href="{% url 'purchase' work_id=workid %}"><span class="read_itbutton pledge button_text"><span>Reserve It</span></span></a>
|
||||
|
@ -217,9 +217,9 @@
|
|||
<span class="kw_id" id="l{{ workid }}" data-kw="{{setkw}}">Set <i>{{setkw}}</i></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% elif show_pledge %}
|
||||
{% elif not supported %}
|
||||
<div class="listview panelfront side1 add-wishlist">
|
||||
<span class="booklist_pledge"><a href="{% url 'pledge' work_id=workid %}" class="fakeinput">Pledge</a></span>
|
||||
<span class="booklist_pledge"><a href="{% url 'pledge' work_id=workid %}" class="fakeinput">Support</a></span>
|
||||
</div>
|
||||
{% elif show_purchase %}
|
||||
<div class="listview panelfront side1 add-wishlist">
|
||||
|
@ -241,8 +241,8 @@
|
|||
<span>{% if purchased.gifts.all.count %}A gift to you!{% else %}Purchased!{% endif %}</span>
|
||||
{% elif borrowed %}
|
||||
<span>Borrowed! ...until</span>
|
||||
{% elif request.user.id in supporters %}
|
||||
<span>Pledged!</span>
|
||||
{% elif supported %}
|
||||
<span>Supported!</span>
|
||||
{% else %}
|
||||
<span>Faved!</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<div class="moreinfo create-account">
|
||||
<span title="{% if workid %}{% url 'work' workid %}{% else %}{% url 'googlebooks' googlebooks_id %}{% endif %}">Login to Fave</span>
|
||||
</div>
|
||||
{% elif request.user.id in supporters %}
|
||||
{% elif supported %}
|
||||
<div class="moreinfo on-wishlist">
|
||||
<a href="{% url 'work' workid %}">Pledged!</a>
|
||||
<a href="{% url 'work' workid %}">Supported!</a>
|
||||
</div>
|
||||
{% elif supporter == request.user %}
|
||||
{% if wishlist %}
|
||||
|
|
|
@ -385,6 +385,20 @@ If you want to find an interesting campaign and don't have a specific book in mi
|
|||
|
||||
<dd>You can offer anything you are capable of delivering, so long as it is not illegal or otherwise restricted in the United States. For instance, your premiums may not include alcohol, drugs, or firearms. For full details, consult our <a href="/terms/">Terms of Use</a>.</dd>
|
||||
|
||||
<dt id='donation_support'>Is my campaign eligible for charitable donation support?</dt>
|
||||
|
||||
<dd>
|
||||
The Free Ebook Foundation may provide support for some campaigns using donations. These campaigns are subject to the following guidelines:
|
||||
<ol>
|
||||
<li>Proceeds of a campaign must not benefit a candidate for political office and books to be unglued shall not be primarily aimed at influencing legislation.</li>
|
||||
<li>Proceeds of a campaign must not benefit organizations or individuals subject to regulation by the US Treasury’s Office of Foreign Assets Control.</li>
|
||||
<li>Books to be unglued with Foundation support should clearly benefit the public at large - by advancing scholarship and learning, spreading scientific knowledge, achieving artistic, literary or cultural goals, educating students, promoting literacy and reading, documenting history, meeting the needs of underserved communities, raising awareness and understanding of the world around us. </li>
|
||||
<li>The amount of support requested should be limited to the reasonable costs of producing the book and procuring associated rights. When a campaign is offered using a license with a “non-commercial” restriction, it is expected that the rights holders will bear part of these expenses themselves. When the campaign beneficiary is not a US-based non-profit, documentation of expenses may be requested.</li>
|
||||
</ol>
|
||||
|
||||
|
||||
</dd>
|
||||
|
||||
<dt>Who is responsible for making sure a rights holder delivers premiums?</dt>
|
||||
|
||||
<dd>The rights holder.</dd>
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
<div class="jsmodule">
|
||||
<h3 class="jsmod-title"><span>Pledging FAQs</span></h3>
|
||||
<h3 class="jsmod-title"><span>Campaign Support FAQs</span></h3>
|
||||
<div class="jsmod-content">
|
||||
<ul class="menu level1">
|
||||
|
||||
<li class="first parent">
|
||||
<span class="faq">How do I pledge?</span>
|
||||
<span class="menu level2 answer">
|
||||
Enter your pledge amount and select a premium. (You may select a premium at any level up to and including the amount you pledge.) If you pledge enough, you're also eligible to be credited in the unglued ebook and to include a dedication, and toward the bottom of this page you can specify what you'd like those to say. If this is your first pledge, we'll collect your card information after you click Pledge Now. Otherwise, we'll use the card you used last time -- no need to type in your info again!
|
||||
Enter your pledge amount and select a premium. (You may select a premium at any level up to and including the amount you pledge.) If you pledge enough, you're also eligible to be credited in the unglued ebook and to include a dedication, and toward the bottom of this page you can specify what you'd like those to say. If this is your first time supporting a campaign, we'll collect your card information after you click Pledge Now. Otherwise, we'll use the card you used last time -- no need to type in your info again!
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="parent">
|
||||
<span class="faq">Donation or Pledge?</span>
|
||||
<span class="menu level2 answer">
|
||||
Donations are fully tax-deductible in the US, but we
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="parent">
|
||||
<span class="faq">How do I donate?</span>
|
||||
<span class="menu level2 answer">
|
||||
Enter your donation amount and check the donation box. If you donate enough, you're also eligible to be credited in the unglued ebook and to include a dedication, and toward the bottom of this page you can specify what you'd like those to say. If this is your first time supporting a campaign, we'll collect your card information after you click Donate Now. Otherwise, we'll use the card you used last time -- no need to type in your info again! Remember, donations are tax-deductible in the US.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
|
@ -20,12 +34,19 @@
|
|||
<li class="parent">
|
||||
<span class="faq">When will I be charged?</span>
|
||||
<span class="menu level2 answer">
|
||||
If this campaign reaches its target before its deadline ({{ campaign.deadline }}), you'll be charged within a day of when the target is reached. Otherwise, your pledge will expire at midnight on {{ campaign.deadline }} (Eastern US time) and you will not be charged.
|
||||
Donations will be charged right away. Pledges aren't charged unless the campaign succeeds. If this campaign reaches its target before its deadline ({{ campaign.deadline }}), you'll be charged within a day of when the target is reached. Otherwise, your pledge will expire at midnight on {{ campaign.deadline }} (Eastern US time) and you will not be charged.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="parent">
|
||||
<span class="faq">Will I be charged if the campaign doesn't succeed?</span>
|
||||
<span class="faq">Will donations be refunded if the campaign doesn't succeed?</span>
|
||||
<span class="menu level2 answer">
|
||||
Sorry, no. Your donation will be used to support other qualifying Unglue.it comapigns.
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="parent">
|
||||
<span class="faq">Will pledges be charged if the campaign doesn't succeed?</span>
|
||||
<span class="menu level2 answer">
|
||||
Nope!
|
||||
</span>
|
||||
|
|
|
@ -90,6 +90,15 @@ Please fix the following before launching your campaign:
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if campaign.charitable %}
|
||||
<div class="pledged-info">
|
||||
This campaign is eligible for <a href="{% url 'faq_sublocation' 'rightsholders' 'campaigns' %}#donation_support">charitable donation support</a>.
|
||||
</div>
|
||||
{% elif campaign.type == 1 %}
|
||||
<div class="pledged-group">
|
||||
If you believe your campaign meets <a href="{% url 'faq_sublocation' 'rightsholders' 'campaigns' %}#donation_support">the criteria for charitable donation support</a>, use <a href="{% url 'feedback' %}?page={{request.build_absolute_uri|urlencode:""}}">the feedback form</a> to request a review by Free Ebook Foundation staff.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="preview_campaign">
|
||||
|
@ -405,13 +414,14 @@ Please fix the following before launching your campaign:
|
|||
|
||||
<p>A few things to keep in mind:</p>
|
||||
<ul class="bullets">
|
||||
<li>For tax status reasons, premiums are not currently available to supporters who use donations instead of pledges.</li>
|
||||
<li>Are your premiums cumulative? That is, if you have a $10 and a $25 premium, does the $25 pledger get everything that the $10 pledger gets also? Either cumulative or not-cumulative is fine, but make sure you've communicated clearly</li>
|
||||
<li>Adding new premiums during your campaign is a great way to build momentum. If you do, make sure to leave a comment in the Comments tab of your campaign page to tell supporters (it will be automatically emailed to them). Some of them may want to change (hopefully increase) their pledge to take advantage of it.</li>
|
||||
<li>Also make sure to think about how your new premiums interact with old ones. If you add a new premium at $10, will people who have already pledged $25 be automatically eligible for it or not? Again, you can choose whatever you want; just be sure to communicate clearly.</li>
|
||||
</ul>
|
||||
|
||||
<h4>Acknowledgements</h4>
|
||||
<p>Your ungluers will also automatically receive the following acknowledgements:</p>
|
||||
<p>Your ungluers (including thos who use donations, will also automatically receive the following acknowledgements:</p>
|
||||
<ul class="terms">
|
||||
<li><em>Any amount</em> — The unglued ebook</li>
|
||||
<li><em>$25 and above</em> — Their name in the acknowledgements section under "supporters"</li>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
{% ifequal transaction.host 'credit' %}
|
||||
{% if transaction.host == 'credit' %}
|
||||
Your Unglue.it transaction has completed and ${{transaction.max_amount|floatformat:2|intcomma}} has been deducted from your Unglue.it credit balance.
|
||||
You have ${{transaction.user.credit.available|default:"0"}} of credit left.
|
||||
{% else %}
|
||||
|
@ -19,7 +19,7 @@
|
|||
{% else %}
|
||||
Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}.
|
||||
{% endif %}
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
|
|
|
@ -1,4 +1,19 @@
|
|||
{% load humanize %}An Ungluing!
|
||||
{% load humanize %}{% if transaction.donation %}{% ifequal transaction.host 'credit' %}Your Unglue.it transaction has completed and ${{transaction.max_amount|default:"0"}} has been deducted from your Unglue.it credit balance. You have ${{transaction.user.credit.available|default:"0"}} of credit left. {% else %}{% if transaction.max_amount > transaction.amount %}Your transaction for ${{transaction.max_amount|default:"0"}} has completed. Your credit card has been charged ${{transaction.amount}} and the rest has been deducted from your unglue.it credit balance. You have ${{transaction.user.credit.available|default:"0"}} of credit left. {% else %}Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|default:"0" }}. {% endif %}{% endifequal %}
|
||||
|
||||
Your donation of ${{transaction.max_amount|default:"0"}} to the Free Ebook Foundation will support our effort to release {{ transaction.campaign.work.title }} to the world in an unglued ebook edition. We'll email you if the campaign succeeds, and when the ebook is available for download. If you'd like to visit the campaign page, click here:
|
||||
https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %}
|
||||
|
||||
In case the campaign for {{ transaction.campaign.work.title }} does not succeed, we'll use your donation in support of other qualifying ungluing campaigns which qualify for charitable support.
|
||||
|
||||
The Free Ebook Foundation is a US 501(c)3 non-profit organization. Our tax ID number is 61-1767266. Your gift is tax deductible to the full extent provided by the law.
|
||||
|
||||
For more information about the Free Ebook Foundation, visit https://ebookfoundation.org/
|
||||
|
||||
Thank you again for your generous support.
|
||||
|
||||
{{ transaction.campaign.rightsholder }} and the Unglue.it team
|
||||
|
||||
{% else %}An Ungluing!
|
||||
|
||||
Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}.
|
||||
|
||||
|
@ -13,4 +28,4 @@ https://{{ current_site.domain }}{% url 'work' transaction.campaign.work_id %}
|
|||
Thank you again for your support.
|
||||
|
||||
{{ transaction.campaign.rightsholder }} and the Unglue.it team
|
||||
|
||||
{% endif %}
|
||||
|
|
|
@ -7,10 +7,37 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_graphical %}
|
||||
Hooray! The campaign for <a href="{% url 'work' transaction.campaign.work_id %}">{{ transaction.campaign.work.title }}</a> has succeeded. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}. Thank you again for your help.
|
||||
{% if transaction.donation %}
|
||||
{% if transaction.host == 'credit' %}
|
||||
Your Unglue.it transaction has completed and ${{transaction.max_amount|floatformat:2|intcomma}} has been deducted from your Unglue.it credit balance.
|
||||
You have ${{transaction.user.credit.available|default:"0"}} of credit left.
|
||||
{% elif transaction.max_amount > transaction.amount %}
|
||||
Your transaction for ${{transaction.max_amount|floatformat:2|intcomma}} has completed.
|
||||
Your credit card has been charged ${{transaction.amount}} and the
|
||||
rest has been deducted from your unglue.it credit balance.
|
||||
You have ${{transaction.user.credit.available|intcomma}} of credit left.
|
||||
{% else %}
|
||||
Your Unglue.it credit card transaction has completed and your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}.
|
||||
{% endif %}
|
||||
{% else %} Hooray! The campaign for <a href="{% url 'work' transaction.campaign.work_id %}">{{ transaction.campaign.work.title }}</a> has succeeded. Your credit card has been charged ${{ transaction.amount|floatformat:2|intcomma }}. Thank you again for your help.
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
{% if transaction.donation %}
|
||||
<p>Your donation of ${{transaction.max_amount|default:"0"}} to the Free Ebook Foundation will support our effort to release {{ transaction.campaign.work.title }} to the world in an unglued ebook edition. We'll email you if the campaign succeeds, and when the ebook is available for download. If you'd like to visit the campaign page, <a href="{% url 'work' transaction.campaign.work_id %}">click here</a>. </p>
|
||||
|
||||
<p>In case the campaign for {{ transaction.campaign.work.title }} does not succeed, we'll use your donation in support of other qualifying ungluing campaigns which qualify for charitable support.</p>
|
||||
|
||||
<p>The Free Ebook Foundation is a US 501(c)3 non-profit organization. Our tax ID number is 61-1767266. Your gift is tax deductible to the full extent provided by the law.</p>
|
||||
|
||||
<p>For more information about the Free Ebook Foundation, visit <a href="https://ebookfoundation.org/">https://ebookfoundation.org/</a></p>
|
||||
|
||||
<p>Thank you again for your generous support.</p>
|
||||
|
||||
<p>{{ transaction.campaign.rightsholder }} and the Unglue.it team</p>
|
||||
|
||||
{% else %}
|
||||
<p>Congratulations!</p>
|
||||
|
||||
<p>Thanks to you and other ungluers, {{ transaction.campaign.work.title }} will be released to the world in an unglued ebook edition. {{ transaction.host|capfirst }} has been charged to your credit card.</p>
|
||||
|
@ -28,4 +55,5 @@
|
|||
</p>
|
||||
<p>{{ transaction.campaign.rightsholder }} and the Unglue.it team
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1 +1 @@
|
|||
Your pledge to the campaign to unglue {{transaction.campaign.work.title}} has been charged.
|
||||
Your {% if transaction.donation %}donation{% else %}pledge{% endif %} for the campaign to unglue {{transaction.campaign.work.title}} has been charged.
|
|
@ -1,4 +1,4 @@
|
|||
{% if pledged %}You pledged toward it{% else %}You put it on your list{% endif %}, and now the campaign for {{ campaign.work.title}} (https://{{current_site.domain}}{% url 'work' campaign.work_id %}) has succeeded.
|
||||
{% if pledged %}You supported it{% else %}You put it on your list{% endif %}, and now the campaign for {{ campaign.work.title}} (https://{{current_site.domain}}{% url 'work' campaign.work_id %}) has succeeded.
|
||||
{% ifequal campaign.type 1 %}
|
||||
You will notified when an Unglued ebook edition is available, within 90 days.
|
||||
{% if pledged %}
|
||||
|
|
|
@ -2,9 +2,7 @@ Alas. The campaign to unglue {{ campaign.work.title }} (https://{{current_site.
|
|||
|
||||
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums.
|
||||
|
||||
Still want to give {{ campaign.work.title }} to the world? Don't despair. Keep it on your wishlist and tell everyone why you love this book. The rights holder, {{ campaign.rightsholder }}, may run a campaign with different terms in the future. With your help, we may yet be able to unglue {{ campaign.work.title }}.
|
||||
|
||||
There are also other books with active campaigns that need your help: https://unglue.it/campaigns/ending .
|
||||
If you donated in support of this work, your donation will be used to support other campaigns that qualify for charitable support.
|
||||
|
||||
Thank you for your support.
|
||||
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block comments_textual %}
|
||||
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums.
|
||||
|
||||
Still want to give {{ campaign.work.title }} to the world? Don't despair. Keep it on your faves and tell everyone why you love this book. The rights holder, {{ campaign.rightsholder }}, may run a campaign with different terms in the future. With your help, we may yet be able to unglue {{ campaign.work.title }}.
|
||||
|
||||
There are also <a href="https://unglue.it/campaigns/ending">other books with active campaigns</a> that need your help.
|
||||
|
||||
If you pledged toward this work, your pledge will expire shortly and your credit card will not be charged, nor will you receive any premiums. If you donated in support of this work, your donation will be used to support other campaigns that qualify for charitable support.
|
||||
|
||||
Thank you for your support.
|
||||
{% endblock %}
|
|
@ -83,10 +83,16 @@
|
|||
<form class="pledgeform" method="POST" action="{% if faqmenu == 'modify' %}{% url 'pledge_modify' work_id=work.id %}{% else %}{% url 'pledge' work_id=work.id %}{% endif %}">
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
<div class="pledge_amount">{{ form.preapproval_amount.label_tag }}: {{ form.preapproval_amount.errors }}${{ form.preapproval_amount }}</div>
|
||||
|
||||
<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">
|
||||
{% if premiums|length > 1 %}
|
||||
<div class="pledge_amount premium_level">Choose your premium:</div>
|
||||
<div class="pledge_amount premium_level">Choose your premium<span id="premium_note"></span>:</div>
|
||||
|
||||
<div style="height:10px;"></div>
|
||||
|
||||
|
@ -119,16 +125,17 @@
|
|||
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 %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="pledge_amount clearfix" id="mandatory_premiums">
|
||||
<div>Depending on your pledge amount, you'll also get these acknowledgements.</div>
|
||||
<div>Depending on your support amount, you'll also get these acknowledgements.</div>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
<div id="anonbox"><I>{{ form.anonymous.label_tag }}</I> {{ form.anonymous.errors }}{{ form.anonymous }}</div>
|
||||
<input name="pledge" type="submit" {% if faqmenu == 'modify' %}value="Modify Pledge"{% else %}value="Pledge Now"{% endif %} id="pledgesubmit" class="loader-gif" />
|
||||
<input name="pledge" type="submit" {% if faqmenu == 'modify' %}value="Modify Pledge"{% else %}value="Support Now"{% endif %} id="pledgesubmit" class="loader-gif" />
|
||||
<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.
|
||||
|
|
|
@ -32,11 +32,13 @@
|
|||
<h2 class="thank-you">Thank you!</h2>
|
||||
{% if not campaign %}
|
||||
<p class="pledge_complete">You've just donated ${{ transaction.amount|floatformat:2|intcomma }} to the <a href="https://ebookfoundation.org">Free Ebook Foundation</a></p>
|
||||
{% endif %}
|
||||
{% ifequal campaign.type 1 %}
|
||||
{% elif campaign.type == 1 %}
|
||||
{% if campaign.donation %}
|
||||
<p class="pledge_complete">You've just donated ${{ transaction.amount|floatformat:2|intcomma }} in support of <I><a href="{% url 'work' work.id %}">{{ work.title }}</a></I>. If it reaches its goal of ${{ campaign.target|intcomma }} by {{ campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy. Otherwise, your donation will be used to support qualifying ungluing campaigns. Your donation to the Free Ebook Foundation is tax-deductible in the US.</p>
|
||||
{% else %}
|
||||
<p class="pledge_complete">You've just {% if modified %}modified your pledge for{% else %}pledged{% endif %} ${{ transaction.amount|floatformat:2|intcomma }} to <I><a href="{% url 'work' work.id %}">{{ work.title }}</a></I>. If it reaches its goal of ${{ campaign.target|intcomma }} by {{ campaign.deadline|date:"M d Y"}}, it will be unglued for all to enjoy.</p>
|
||||
{% endifequal %}
|
||||
{% ifequal campaign.type 2 %}
|
||||
{% endif %}
|
||||
{% elif campaign.type == 2 %}
|
||||
{% if transaction.extra.give_to %}
|
||||
<p class="pledge_complete">You've just paid ${{ transaction.amount|floatformat:2|intcomma }} to give a copy of <I><a href="{% url 'work' work.id %}">{{ work.title }}</a></I> to {{ transaction.extra.give_to }}. Its ungluing date is now <i>{{ campaign.cc_date }}</i>. Thanks for helping to make that day come sooner!</p>
|
||||
|
||||
|
@ -53,13 +55,12 @@
|
|||
{% endif %}
|
||||
|
||||
<div style="height:75px;"></div>
|
||||
{% endifequal %}
|
||||
{% ifequal campaign.type 3 %}
|
||||
{% elif campaign.type == 3 %}
|
||||
<p class="pledge_complete">You've just contributed ${{ transaction.amount|floatformat:2|intcomma }} to the creators of <I><a href="{% url 'work' work.id %}">{{ work.title }}</a></I> to thank them for making it free to the world.</p>
|
||||
<div><a href="{% url 'download' work.id %}" class="fakeinput" style="float:left">Download Now</a> </div>
|
||||
<div style="height:75px;"></div>
|
||||
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
<div class="modify_notification clearfix">
|
||||
{% include "trans_summary.html" %}
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{% load humanize %}
|
||||
{% load libraryauthtags %}
|
||||
<div class="trans_summary">
|
||||
{% ifequal transaction.campaign.type 1 %}
|
||||
Your pledge: ${{transaction.amount|floatformat:2|intcomma}}.<br />
|
||||
Your premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}You did not request a premium for this campaign.{% endif %}<br />
|
||||
{% if transaction.anonymous %}You asked to pledge anonymously, so you will be counted but not named on the list of supporters.<br />{% endif %}<br />
|
||||
{% if transaction.campaign.type == 1 %}
|
||||
Your {% if transaction.donation %}donation{% else %}pledge{% endif %}: ${{transaction.amount|floatformat:2|intcomma}}.<br />
|
||||
{% if transaction.premium %}Your premium: {{ transaction.premium.description }}{% endif %}<br />
|
||||
{% if transaction.anonymous %}You asked to support anonymously, so you will be counted but not named on the list of supporters.<br />{% endif %}<br />
|
||||
Acknowledgements: <ul>
|
||||
<li>The unglued ebook will be delivered to your inbox.</li>
|
||||
{% if not transaction.anonymous %}
|
||||
|
@ -22,9 +22,8 @@
|
|||
<li>The following dedication will be included: <i>{{ transaction.extra.ack_dedication }}</i></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endifequal %}
|
||||
{% if transaction.campaign.type == 2 or not transaction.campaign %}
|
||||
{% ifequal transaction.host 'credit' %}
|
||||
{% elif transaction.campaign.type == 2 or not transaction.campaign %}
|
||||
{% if transaction.host == 'credit' %}
|
||||
Amount: ${{transaction.max_amount|floatformat:2|intcomma}}.<br />
|
||||
This amount has been deducted from your Unglue.it credit balance.<br />
|
||||
You have ${{request.user.credit.available|default:"0"}} of credit left.<br />
|
||||
|
@ -37,13 +36,13 @@
|
|||
{% else %}
|
||||
This amount has been charged to your credit card.<br />
|
||||
{% endif %}
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% if transaction.campaign %}
|
||||
License type: {{ transaction.offer.get_license_display }}<br />
|
||||
{% ifequal transaction.offer.license 2 %}
|
||||
{% if transaction.offer.license == 2 %}
|
||||
Receiving library: {{ transaction.extra.library_id|libname }}<br />
|
||||
Number of copies: {{ transaction.extra.copies }}
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
{% if status == 'ACTIVE' %}
|
||||
{% if work.last_campaign.type == 1 %}
|
||||
{% if pledged %}
|
||||
<div class="btn_support modify"><form action="{% url 'pledge_modify' work_id %}" method="get"><input type="submit" value="Modify Pledge" /></form></div>
|
||||
<div class="btn_support modify"><form action="{% url 'pledge_modify' work_id %}" method="get"><input type="submit" value="Modify Support" /></form></div>
|
||||
{% elif supported %}
|
||||
<div class="btn_support"><form action="{% url 'pledge' work_id %}" method="get"><input type="submit" value="Add Support" /></form></div>
|
||||
{% else %}
|
||||
<div class="btn_support"><form action="{% url 'pledge' work_id %}" method="get"><input type="submit" value="Pledge" /></form></div>
|
||||
<div class="btn_support"><form action="{% url 'pledge' work_id %}" method="get"><input type="submit" value="Support" /></form></div>
|
||||
{% endif %}
|
||||
{% elif work.last_campaign.type == 3 %}
|
||||
<div class="btn_support">
|
||||
|
|
|
@ -15,12 +15,12 @@ def bookpanel(context):
|
|||
# campaign is ACTIVE, type 1 - REWARDS
|
||||
# user has not pledged or user is anonymous
|
||||
|
||||
show_pledge = False
|
||||
if campaign and campaign.type==REWARDS:
|
||||
supported = False
|
||||
if campaign and campaign.type == REWARDS:
|
||||
if campaign.status == 'ACTIVE':
|
||||
if user.is_anonymous() or not user.id in context.get('supporters', []):
|
||||
show_pledge = True
|
||||
context['show_pledge'] = show_pledge
|
||||
if not user.is_anonymous() and user.transaction_set.filter(campaign__work=work):
|
||||
supported = True
|
||||
context['supported'] = supported
|
||||
|
||||
# compute a boolean that's true if bookpanel should show a "purchase" button...
|
||||
# campaign is ACTIVE, type 2 - BUY2UNGLUE
|
||||
|
@ -30,7 +30,7 @@ def bookpanel(context):
|
|||
# not on the library page
|
||||
|
||||
show_purchase = False
|
||||
if campaign and campaign.type==BUY2UNGLUE:
|
||||
if campaign and campaign.type == BUY2UNGLUE:
|
||||
if user.is_anonymous() or not context.get('license_is_active', False):
|
||||
if campaign.status == 'ACTIVE':
|
||||
if not context.get('borrowable', False):
|
||||
|
|
|
@ -347,8 +347,10 @@ def work(request, work_id, action='display'):
|
|||
campaign = work.last_campaign()
|
||||
editions = work.editions.all().order_by('-publication_date')[:10]
|
||||
try:
|
||||
pledged = campaign.transactions().filter(user=request.user, status="ACTIVE")
|
||||
supported = campaign.transactions().filter(user=request.user)
|
||||
pledged = supported.filter(status="ACTIVE")
|
||||
except:
|
||||
supported = None
|
||||
pledged = None
|
||||
|
||||
cover_width_number = 0
|
||||
|
@ -400,6 +402,7 @@ def work(request, work_id, action='display'):
|
|||
'base_url': base_url,
|
||||
'editions': editions,
|
||||
'pledged': pledged,
|
||||
'supported': supported,
|
||||
'activetab': activetab,
|
||||
'alert': alert,
|
||||
'claimstatus': claimstatus,
|
||||
|
@ -1020,7 +1023,8 @@ class PledgeView(FormView):
|
|||
campaign=self.campaign,
|
||||
user=self.request.user,
|
||||
paymentReason="Unglue.it Pledge for {0}".format(self.campaign.name),
|
||||
pledge_extra=form.trans_extra
|
||||
pledge_extra=form.trans_extra,
|
||||
donation = form.cleaned_data['donation']
|
||||
)
|
||||
if url:
|
||||
logger.info("PledgeView url: " + url)
|
||||
|
@ -1158,7 +1162,7 @@ class FundView(FormView):
|
|||
if not self.transaction.campaign:
|
||||
self.action = 'donation'
|
||||
elif self.transaction.campaign.type == REWARDS:
|
||||
self.action = 'pledge'
|
||||
self.action = 'donation' if self.transaction.donation else 'pledge'
|
||||
elif self.transaction.campaign.type == THANKS:
|
||||
self.action = 'contribution'
|
||||
else:
|
||||
|
|
|
@ -672,13 +672,14 @@ class PaymentManager( object ):
|
|||
|
||||
|
||||
|
||||
def process_transaction(self, currency, amount, host=PAYMENT_HOST_NONE, campaign=None, user=None,
|
||||
return_url=None, paymentReason="unglue.it Pledge", pledge_extra=None,
|
||||
modification=False):
|
||||
def process_transaction(self, currency, amount, host=PAYMENT_HOST_NONE, campaign=None,
|
||||
user=None, return_url=None, paymentReason="unglue.it Pledge", pledge_extra=None,
|
||||
donation=False, modification=False):
|
||||
'''
|
||||
process
|
||||
|
||||
saves and processes a proposed transaction; decides if the transaction should be processed immediately.
|
||||
saves and processes a proposed transaction; decides if the transaction should be processed
|
||||
immediately.
|
||||
|
||||
currency: a 3-letter currency code, i.e. USD
|
||||
amount: the amount to authorize
|
||||
|
@ -690,8 +691,9 @@ class PaymentManager( object ):
|
|||
modification: whether this authorize call is part of a modification of an existing pledge
|
||||
pledge_extra: extra pledge stuff
|
||||
|
||||
return value: a tuple of the new transaction object and a re-direct url. If the process fails,
|
||||
the redirect url will be None
|
||||
return value: a tuple of the new transaction object and a re-direct url.
|
||||
If the process fails, the redirect url will be None
|
||||
donation: transaction is a donation
|
||||
'''
|
||||
# set the expiry date based on the campaign deadline
|
||||
if campaign and campaign.deadline:
|
||||
|
@ -699,14 +701,16 @@ class PaymentManager( object ):
|
|||
else:
|
||||
expiry = now() + timedelta(days=settings.PREAPPROVAL_PERIOD_AFTER_CAMPAIGN)
|
||||
|
||||
t = Transaction.create(amount=0,
|
||||
host = host,
|
||||
max_amount=amount,
|
||||
currency=currency,
|
||||
campaign=campaign,
|
||||
user=user,
|
||||
pledge_extra=pledge_extra
|
||||
)
|
||||
t = Transaction.create(
|
||||
amount=0,
|
||||
host = host,
|
||||
max_amount=amount,
|
||||
currency=currency,
|
||||
campaign=campaign,
|
||||
user=user,
|
||||
pledge_extra=pledge_extra,
|
||||
donation=donation,
|
||||
)
|
||||
t.save()
|
||||
# does user have enough credit to transact now?
|
||||
if user.is_authenticated() and user.credit.available >= amount :
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('payment', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='transaction',
|
||||
name='donation',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -110,6 +110,9 @@ class Transaction(models.Model):
|
|||
# whether the user wants to be not listed publicly
|
||||
anonymous = models.BooleanField(default=False)
|
||||
|
||||
# whether the transaction represents a donation
|
||||
donation = models.BooleanField(default=False)
|
||||
|
||||
@property
|
||||
def tier(self):
|
||||
if self.amount < 25:
|
||||
|
@ -210,24 +213,24 @@ class Transaction(models.Model):
|
|||
return pe
|
||||
|
||||
@classmethod
|
||||
def create(cls,amount=0.00, host=PAYMENT_HOST_NONE, max_amount=0.00, currency='USD',
|
||||
status=TRANSACTION_STATUS_NONE,campaign=None, user=None, pledge_extra=None):
|
||||
def create(cls, amount=0.00, host=PAYMENT_HOST_NONE, max_amount=0.00, currency='USD',
|
||||
status=TRANSACTION_STATUS_NONE, campaign=None, user=None, pledge_extra=None,
|
||||
donation=False):
|
||||
if user and user.is_anonymous():
|
||||
user = None
|
||||
t = cls.objects.create(
|
||||
amount=amount,
|
||||
host=host,
|
||||
max_amount=max_amount,
|
||||
currency=currency,
|
||||
status=status,
|
||||
campaign=campaign,
|
||||
user=user,
|
||||
donation=donation,
|
||||
)
|
||||
if pledge_extra:
|
||||
t = cls.objects.create(amount=amount,
|
||||
host=host,
|
||||
max_amount=max_amount,
|
||||
currency=currency,
|
||||
status=status,
|
||||
campaign=campaign,
|
||||
user=user,
|
||||
)
|
||||
t.set_pledge_extra(pledge_extra)
|
||||
return t
|
||||
else:
|
||||
return cls.objects.create(amount=amount, host=host, max_amount=max_amount, currency=currency,status=status,
|
||||
campaign=campaign, user=user)
|
||||
return t
|
||||
|
||||
class PaymentResponse(models.Model):
|
||||
# The API used
|
||||
|
|
|
@ -10,7 +10,9 @@ $j().ready(function() {
|
|||
var submitbutton = $j('#pledgesubmit');
|
||||
var fakesubmitbutton = $j('#fakepledgesubmit');
|
||||
var anonbox = $j('#anonbox input');
|
||||
var donationbox = $j('#id_donation');
|
||||
var ackSection = $j('#ack_section');
|
||||
var premium_section = $j('#select_premiums');
|
||||
var supporterName = $j('#pass_supporter_name').html();
|
||||
var ackName = $j('#id_ack_name').val();
|
||||
var ackDedication = $j('#id_ack_dedication').val();
|
||||
|
@ -72,6 +74,21 @@ $j().ready(function() {
|
|||
$j('#'+mySpan+' input[type=text]').val('').attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
// make premium selection inactive: greyed-out and not modifiable
|
||||
var deactivate_premiums = function() {
|
||||
premium_section.addClass('premiums_inactive');
|
||||
$j('#premiums_list li label input').attr('disabled', 'disabled');
|
||||
$j('#premiums_list li:first-child label input').removeAttr('disabled').attr('checked', 'checked');
|
||||
$j('#premium_note').text(' (not available with donation)');
|
||||
}
|
||||
|
||||
// make premium selection inactive: greyed-out and not modifiable
|
||||
var activate_premiums = function() {
|
||||
premium_section.removeClass('premiums_inactive');
|
||||
$j('#premiums_list li label input').removeAttr('disabled');
|
||||
$j('#premium_note').text('');
|
||||
}
|
||||
|
||||
// fill mandatory premium link input with supporter page
|
||||
var activateLink = function() {
|
||||
$j('#ack_link').removeClass('ack_inactive').addClass('ack_active');
|
||||
|
@ -86,6 +103,15 @@ $j().ready(function() {
|
|||
deactivate('ack_name');
|
||||
$j('#id_ack_name').val('Anonymous');
|
||||
}
|
||||
|
||||
// when supporter clicks the donation box, activate/deactivate premium selection
|
||||
donationbox.change(function() {
|
||||
if(this.checked) {
|
||||
deactivate_premiums();
|
||||
} else {
|
||||
activate_premiums();
|
||||
}
|
||||
});
|
||||
|
||||
// selectively highlight/grey out acknowledgements supporter is eligible for
|
||||
var rectifyAcknowledgements = function(current) {
|
||||
|
|
|
@ -24,6 +24,10 @@ input[type="submit"], a.fakeinput {
|
|||
|
||||
form.pledgeform {
|
||||
width: 470px;
|
||||
|
||||
.pledgeform_label {
|
||||
font-size: 80%
|
||||
}
|
||||
}
|
||||
|
||||
#id_preapproval_amount {
|
||||
|
@ -103,6 +107,21 @@ ul#offers_list li {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.premiums_inactive#select_premiums {
|
||||
background: $blue-grey;
|
||||
|
||||
div, div.pledge_amount, ul li, ul li:hover {
|
||||
background: $blue-grey;
|
||||
color: $text-blue
|
||||
}
|
||||
}
|
||||
|
||||
#premium_note {
|
||||
font-size: 70%;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#mandatory_premiums {
|
||||
font-size: $font-size-larger;
|
||||
|
||||
|
|
Loading…
Reference in New Issue