Add "overseas" option

Because they need to pay more for shipping
This commit is contained in:
Hippo 2021-12-29 22:36:40 +05:30
parent cb376b91ec
commit ca1654ccde
3 changed files with 12 additions and 2 deletions

View file

@ -37,6 +37,7 @@ knex.schema.hasTable('pledges').then(function(exists) {
t.boolean('was_robot').defaultTo(true)
t.integer('amount').notNullable()
t.boolean('overseas')
t.string('name', 128)
t.boolean('anonymous')
t.string('email', 128)
@ -144,6 +145,7 @@ router.post('/pledge', async (req, res) => {
let phone = req.body.phone
let newsletter = req.body.newsletter == 'yes' ? true : false
let overseas = req.body.overseas == 'yes' ? true : false
let messages = req.body.messages
if (!!errors.length) {
@ -155,6 +157,7 @@ router.post('/pledge', async (req, res) => {
let pledge = new Pledge()
pledge.set('was_robot', robo)
pledge.set('amount', amount)
pledge.set('overseas', overseas)
pledge.set('name', name)
pledge.set('anonymous', anonymous)
pledge.set('email', email)

View file

@ -16,7 +16,7 @@
</div>
<div class="bg-orange-600 text-center p-10">
<img alt="Snipette" class="text-5xl uppercase font-sans w-full max-w-3xl mx-auto" src="img/header.png"/>
<p class="text-5xl text-orange-200 lowercase font-heading font-extrabold">Analog <span class="text-yellow-300">for Everyone</span></p>
<p class="text-5xl text-black lowercase font-heading font-extrabold">Analog <span class="text-yellow-300">for Everyone</span></p>
</div>
<!-- This container will include the floating donation box -->
@ -218,6 +218,13 @@
<p class="font-sans">You get: all the perks from the next lowest level</p>
</li>
</label>
<label class="donate-option col-span-1 sm:col-span-2 md:col-span-3">
<input type="checkbox" name="overseas" value="yes">
<li>
<h2 class="text-2xl text-left">I live outside India (add $25 for shipping)</h2>
<p class="font-sans text-left">When the campaign is over, you will get the option to pay an additional 25 dollars for shipping costs or have your print copies sent to an address in India.</p>
</li>
</label>
</ul>
<div class="bg-white p-10 rounded-md text-md">

View file

@ -11,7 +11,7 @@ a {
}
.donate-option > li {
@apply row-auto text-center inline-block p-10 bg-white rounded-md text-black border-2 border-white hover:border-green-500 hover:cursor-pointer h-full w-full;
@apply text-center inline-block p-10 bg-white rounded-md text-black border-2 border-white hover:border-green-500 hover:cursor-pointer h-full w-full;
}
.donate-option > input:checked + li {