Merge pull request #52 from Gluejar/fix_pledge_nits

preset no-premium, add validation message [fix #37720723]
pull/1/head
eshellman 2012-10-14 11:26:02 -07:00
commit 0ef5c112db
6 changed files with 12 additions and 9 deletions

View File

@ -343,6 +343,8 @@ class CampaignPledgeForm(forms.Form):
if preapproval_amount is None: if preapproval_amount is None:
# preapproval_amount failed validation, that error is the relevant one # preapproval_amount failed validation, that error is the relevant one
return self.cleaned_data return self.cleaned_data
elif self.premium is None:
raise forms.ValidationError(_("Please select a premium." ))
elif preapproval_amount < self.premium.amount: elif preapproval_amount < self.premium.amount:
logger.info("raising form validating error") logger.info("raising form validating error")
raise forms.ValidationError(_("Sorry, you must pledge at least $%s to select that premium." % (self.premium.amount))) raise forms.ValidationError(_("Sorry, you must pledge at least $%s to select that premium." % (self.premium.amount)))

View File

@ -24,7 +24,7 @@ $j(document).ready(function() {
// remove help text when input is selected // remove help text when input is selected
// user-entered text should be in usual text color // user-entered text should be in usual text color
inputs.on("click", function() { inputs.on("focus", function() {
defaultValue = $j(this).val(); defaultValue = $j(this).val();
$j(this).val(''); $j(this).val('');
$j(this).css('color', '#3d4e53') $j(this).css('color', '#3d4e53')

View File

@ -32,11 +32,12 @@
<h2 class="thank-you">Thank you!</h2> <h2 class="thank-you">Thank you!</h2>
<p class="pledge_complete">You've just {% if modified %}modified your pledge for{% else %}pledged{% endif %} ${{ transaction.amount|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> <p class="pledge_complete">You've just {% if modified %}modified your pledge for{% else %}pledged{% endif %} ${{ transaction.amount|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>
<div class="modify_notification clearfix"> <div class="modify_notification clearfix">
<div> <div>
Your pledge: ${{transaction.amount|intcomma}}.<br /> Your pledge: ${{transaction.amount|intcomma}}.<br />
Your premium: {% if transaction.premium %}{{ transaction.premium.description }}{% else %}You did not request a premium for this campaign.{% endif %}<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 want your pledge to be anonymous.<br />{% 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 />
Acknowledgements: <ul> Acknowledgements: <ul>
<li>The unglued ebook will be delivered to your inbox.</li> <li>The unglued ebook will be delivered to your inbox.</li>
{% if not transaction.anonymous %} {% if not transaction.anonymous %}

View File

@ -643,7 +643,7 @@ class PledgeView(FormView):
raise e raise e
transactions = self.campaign.transactions().filter(user=self.request.user, status=TRANSACTION_STATUS_ACTIVE, type=PAYMENT_TYPE_AUTHORIZATION) transactions = self.campaign.transactions().filter(user=self.request.user, status=TRANSACTION_STATUS_ACTIVE, type=PAYMENT_TYPE_AUTHORIZATION)
premium_id = self.request.REQUEST.get('premium_id', None) premium_id = self.request.REQUEST.get('premium_id', 150)
if transactions.count() == 0: if transactions.count() == 0:
ack_name='' ack_name=''
ack_dedication='' ack_dedication=''

View File

@ -259,7 +259,7 @@ span.menu-item-price {
#authorize.off { #authorize.off {
display: none; display: none;
} }
#authorize div.innards input { #authorize div.innards input[type="text"] {
font-size: 15px; font-size: 15px;
line-height: 22.5px; line-height: 22.5px;
border-width: 2px; border-width: 2px;
@ -267,11 +267,11 @@ span.menu-item-price {
margin: 1% 0; margin: 1% 0;
color: #3d4e53; color: #3d4e53;
} }
#authorize div.innards input:disabled { #authorize div.innards input[type="text"]:disabled {
border-color: white; border-color: white;
} }
#authorize div.innards input.address, #authorize div.innards input[type="text"].address,
#authorize div.innards input#card_Number { #authorize div.innards input[type="text"]#card_Number {
width: 61%; width: 61%;
} }
#authorize div.innards label { #authorize div.innards label {

View File

@ -201,7 +201,7 @@ span.menu-item-price {
padding: 10px; padding: 10px;
div.innards { div.innards {
input { input[type="text"] {
font-size: @font-size-larger; font-size: @font-size-larger;
line-height: @font-size-larger*1.5; line-height: @font-size-larger*1.5;
border-width: 2px; border-width: 2px;
@ -215,7 +215,7 @@ span.menu-item-price {
&.address, &#card_Number { &.address, &#card_Number {
width: 61%; width: 61%;
} }
} }
label { label {