2 Commits
1.1.0 ... 1.2.0

Author SHA1 Message Date
cdc6614c63 Create 2 RSVP end dates 2017-03-29 21:59:05 +01:00
75740699f1 Add link to gift list site 2017-03-14 16:12:14 +00:00
6 changed files with 81 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "wedding",
"version": "1.1.0",
"version": "1.2.0",
"private": true,
"engines": {
"node": ">=6.5",

View File

@@ -1,6 +1,6 @@
{
"name": "Navigation",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"main": "./Navigation.js"
}

View File

@@ -48,3 +48,28 @@
color: #fff;
text-shadow: 1px 1px 4px var(--colour-nearblack);
}
.button {
display: inline-block;
box-sizing: border-box;
margin: 0;
padding: 10px 20px;
opacity: 0.75;
outline: 0;
border: 4px solid #fff;
border-radius: 14px;
background: var(--colour-nearblack);
color: #fff;
text-align: center;
text-decoration: none;
font-size: 18px;
line-height: 1.3333333;
cursor: pointer;
transition: opacity ease-in-out 0.25s, box-shadow ease-in-out 0.25s;
}
.button:hover,
.button:focus {
opacity: 0.9;
box-shadow: 0 0 4px #fff;
}

View File

@@ -18,10 +18,22 @@ class Giftlist extends React.Component {
is the most amazing honeymoon possible. We have the basics covered but
we’re hoping for the holiday of a lifetime. We would like to see
and do everything we&#8217;ve dreamed about!</p>
<p>Right now we&#8217;re busy curating our list, but fret not, we
won&#8217;t take long! Please do check back here in the coming days,
we&#8217;ll have a link on this page.</p>
<p>Here&#8217;s how our gift list works. Just pick the item you&#8217;d
most like to give us. You&#8217;ll then be asked to leave your name
and any message you have for us. There is the option to use the PayPal
system to send your gift (you can use a credit card &ndash; you
don&#8217;t need a PayPal account). Or, on the day, you could bring
the value of your gift in a card.</p>
<p>We&#8217;ll send you a link to our online photo gallery when we get
back and we&#8217;ll be sure to tell (bore) you all about it in great
detail.</p>
<p className={s.sig}>Dan and Hana</p>
<a
className={s.button}
href="https://www.our-wedding-list.co.uk/danielandhana/list"
>
View our list
</a>
</div>
</div>
</div>

View File

@@ -6,13 +6,13 @@ import NotFound from '../notFound/NotFound';
import { rsvpEndDate, getRsvpEnd } from '../../config';
let title = 'RSVP';
let attending = 'day';
export default {
path: '/rsvp/:password',
isEditable() {
return new Date() < rsvpEndDate;
return new Date() < rsvpEndDate[attending];
},
async action({ params }) {
@@ -35,6 +35,9 @@ export default {
};
}
// Assuming all connected guests have the same invite
attending = people[0].ceremony ? 'day' : 'evening';
return {
title,
component: (
@@ -42,7 +45,7 @@ export default {
<Rsvp
title={title}
people={people}
rsvpEnd={getRsvpEnd()}
rsvpEnd={getRsvpEnd(attending)}
isEditable={this.isEditable()}
/>
</Layout>

View File

@@ -149,41 +149,34 @@ app.get('/rsvp/:code', bouncer.block, (req, res, next) => {
app.post('/rsvp/save', (req, res) => {
try {
if (new Date() > rsvpEndDate) {
res.json({
success: false,
err: 'RSVP end date has elapsed',
});
} else {
const update = {};
update[req.body.prop] = req.body.value;
Person.update(update, {
where: {
key: req.body.key,
},
}).then(() => {
Person.findOne({
where: { key: req.body.key },
}).then(data => {
if (data.completed) {
const attending = `\nAttending: ${data.attending ? 'Yes' : 'No'}`;
const starter = (data.attending && data.starter !== -1) ? `\nStarter: ${starters[data.starter]}` : '';
const main = (data.attending && data.main !== -1) ? `\nMain: ${mains[data.main]}` : '';
const dietary = (data.attending && data.dietary) ? `\nDietary requirements: ${data.dietary}` : '';
sendSlackMsgWithDebounce(`${data.firstname} ${data.lastname} has saved their RSVP:${attending}${starter}${main}${dietary}`, '#wedding-rsvps', req.body.key);
sendRSVPEmailWithDebounce(data);
}
res.json({
success: true,
prop: req.body.prop,
});
}).catch(err => {
Rollbar.handleError(err);
res.json({
const update = {};
update[req.body.prop] = req.body.value;
Person.update(update, {
where: {
key: req.body.key,
},
}).then(() => {
Person.findOne({
where: { key: req.body.key },
}).then(data => {
const endDate = rsvpEndDate[(data.ceremony ? 'day' : 'evening')];
if (new Date() > endDate) {
return res.json({
success: false,
err,
err: 'RSVP end date has elapsed',
});
} else if (data.completed) {
const attending = `\nAttending: ${data.attending ? 'Yes' : 'No'}`;
const starter = (data.attending && data.starter !== -1) ? `\nStarter: ${starters[data.starter]}` : '';
const main = (data.attending && data.main !== -1) ? `\nMain: ${mains[data.main]}` : '';
const dietary = (data.attending && data.dietary) ? `\nDietary requirements: ${data.dietary}` : '';
sendSlackMsgWithDebounce(`${data.firstname} ${data.lastname} has saved their RSVP:${attending}${starter}${main}${dietary}`, '#wedding-rsvps', req.body.key);
sendRSVPEmailWithDebounce(data);
}
return res.json({
success: true,
prop: req.body.prop,
});
}).catch(err => {
Rollbar.handleError(err);
@@ -192,7 +185,13 @@ app.post('/rsvp/save', (req, res) => {
err,
});
});
}
}).catch(err => {
Rollbar.handleError(err);
res.json({
success: false,
err,
});
});
} catch (err) {
Rollbar.handleError(err);
res.json({