Commit graph

26 commits

Author SHA1 Message Date
295147ae86 Make compatible serialisers on script import
The new make_serialiser function allows you to import things to a
separate script and still use the standard secret key when making
serialisers.

During the process, we also realised we weren't salting values
properly, so thankfully that's been fixed! :P
2023-03-12 14:11:03 +05:30
Badri
11cefdada0 Redirect to normal page on invalid referral code
We don't want to be misleading people with random referral links
that don't actually apply!
2022-02-20 15:56:38 +05:30
Badri
d9785d601e Set up referral system!
This generates unique referral codes for people, and keeps track
(by email ID) of who referred whom.
2022-02-20 15:50:06 +05:30
Badri
7cca56eaca Add columns for referral code and referrer
Also made sure that these columns are auto-added to old
databases 😉
2022-02-20 15:46:01 +05:30
Hippo
577e10baaa Add "fetch" option to pledges list
Otherwise it doesn't actually fetch anything :/
2022-01-11 14:23:51 +05:30
Hippo
bea9203b00 Don't limit pledge list to 5 in full list
We need to show all pledges, remember!
2022-01-11 14:17:57 +05:30
Hippo
dfce6c7278 Fix for pledges list: end -> send
Because the other one was making the browser try to download the
page instead of just opening it. (We actually ran into this before,
but I guess I forgot 😛)
2022-01-11 14:14:52 +05:30
Hippo
668371a690 List recent pledges on home page
And a new "pledges" page to list them all!
2022-01-11 14:11:16 +05:30
Hippo
921187a2aa Count totals using database instead of manually
This is way more efficient
2022-01-11 14:11:16 +05:30
Hippo
3272c6528d Bugfix: res.end -> res.send
The former was working fine while testing, but on the website it
made the browser try to *download* the page instead of opening it
in a normal fashion. This change will (hopefully) stem the madness
;P
2022-01-06 19:18:05 +05:30
Hippo
5206046c5a Add friendly-looking notif and error pages
Much less scary than all that plaintext, what?
2022-01-06 18:20:50 +05:30
Hippo
3eca0be184 Rearrange assets to make templates more sensible
Parcel has been removed since we didn't need it anymore (Tailwind
does the purging by itself anyway). Instead, we've told Express
to serve all static assets from src/assets/ and use twig templates
from src/ directly.

Meanwhile, Nodemon now watches for changes in .css and .twig files
too!
2022-01-06 16:15:24 +05:30
Hippo
fb76433250 Start sending verification emails
Finally!
2022-01-06 14:39:46 +05:30
Hippo
a381077b83 Set up "email verification" workflow (minus the email itself)
We'll start sending out the email in the next step, when the setup
of nodemailer is complete. Right now, everything else works:
creating a verification link, processing it when clicked on, and
even updating (instead of appending) a pledge when the same email
submits multiple times. No pretty error messages though; that's
another thing to be worked on :P

WARNING: Don't deploy this commit live; people will be told about a
verification email but they won't actually get it yet!
2022-01-05 23:43:58 +05:30
Hippo
bf58eab258 Standardise variable names between page and database
This is, again, so the validation function can be used for both
datasets rather than having to process each one differently.
2022-01-05 19:37:21 +05:30
Hippo
5a4d97b1bd Validate submit button in view (not in validation function)
This is so the validation function can also be used in other
places, such as while processing an already saved pledge.
2022-01-05 19:36:13 +05:30
Hippo
1bf1e3a55e Add "unverified pledges" table
Pledges will now be saved in the "unverified pledges" table until
they are verified by email.
2022-01-05 19:21:10 +05:30
Hippo
87afc8688e Move pledge validation into new function
This is so we can reuse it in two places: while saving a pledge,
and while validating/verifying it.
2022-01-05 19:10:01 +05:30
Hippo
3e0e775af9 Save reminder count properly
Earlier, it wasn't being checked at all so everything was being
set to the default of 10.
2022-01-05 18:56:13 +05:30
Hippo
680c3cf278 Use "send" instead of "end" at end of requests
This is so that they show as pages and the browser doesn't try to
download them instead.
2021-12-29 23:20:30 +05:30
Hippo
349d9ae8a4 Update "Thanks" message to be more friendly 2021-12-29 22:52:51 +05:30
Hippo
ca1654ccde Add "overseas" option
Because they need to pay more for shipping
2021-12-29 22:36:40 +05:30
Hippo
cb376b91ec Save and accept incoming pledges 2021-12-29 22:35:25 +05:30
Hippo
8e312b3ac5 Set up Twing with basic counting (current goals details!) 2021-12-29 19:45:21 +05:30
Hippo
afdd4dca1c Set up basic Express server 2021-12-29 17:22:17 +05:30
Hippo
aa804a4b56 Set up database: knex and bookshelf 2021-12-29 17:05:51 +05:30