Add commit button functionality

pull/3666/head
Berkeley Martinez 2015-10-08 17:00:15 -07:00
parent 66120a60b8
commit e62375516b
1 changed files with 15 additions and 5 deletions

View File

@ -52,28 +52,38 @@ block content
h3 Step 3: Set up your monthly donation
.row
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
a.btn.btn-block.btn-lg.btn-primary(href=donateUrl target='_blank') Open the #{displayName} donation page
a#commit-btn-donate.btn.btn-block.btn-lg.btn-primary(href=donateUrl target='_blank') Open the #{displayName} donation page
.spacer
.col-xs-12.col-sm-6.col-sm-offset-3
h3 Step 4: Confirm your commitment to your goal
h3#commit-step4-text.disabled
Step 4: Confirm
span#commit-step4-hidden.disabled (Do step 3 first)
span#commit-step4-show.hidden your commitment to your goal
.row
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
a#commit-btn-submit.btn.btn-block.btn-lg.signup-btn(href=donateUrl target='_blank') Commit
button#commit-btn-submit.btn.btn-block.btn-lg.btn-primary.disabled Commit
if pledge
form.row(name='stop-pledge' action='/commit/stop-commitment' method='post')
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
.button-spacer
button.btn.btn-block.btn-danger(name='submit' type='submit') Stop my current pledge
button.btn.btn-block.btn-lg.btn-default(name='submit' type='submit') Stop my current pledge
else
.row
.col-xs-12.col-sm-6.col-sm-offset-3.text-center
.button-spacer
a.btn.btn-block.btn-default(href='/map') Maybe later
a.btn.btn-block.btn-lg.btn-default(href='/map') Maybe later
.spacer
script.
$(function() {
$('#commit-btn-donate').click(function() {
$('#commit-btn-submit').removeClass('disabled');
$('#commit-step4-text').removeClass('disabled');
$('#commit-step4-hidden').hide();
$('#commit-step4-show').removeClass('hidden');
});
$('#commit-btn-submit').click(function() {
window.location.href = '/commit/pledge?' + $('form').serialize();
});