Commit 9da4866d authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'fix/register-button-shown-after-late-cancellation' into 'master'

Fix/register button shown after late cancellation

Closes #72

See merge request !206
parents 4906698e 795a3ca1
......@@ -58,6 +58,7 @@ Object {
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
"Register": "Aanmelden",
"Registration deadline": "Registratiedeadline",
"Registration is not allowed anymore, as you cancelled your registration after the deadline.": "Aanmelden is niet meer toegestaan omdat je bent afgemeld na de afmelddeadline.",
"Registration is not possible anymore.": "Aanmelden is niet meer mogelijk.",
"Registration status": "Aanmeldstatus",
"Registration will open {{start}}": "Aanmelden opent {{start}}",
......
......@@ -30,5 +30,6 @@
"Update registration": "Aanmelding bijwerken",
"Cancel registration": "Afmelden",
"Registrations": "Aanmeldingen",
"Could not load the event...": "Kan het evenement niet laden..."
"Could not load the event...": "Kan het evenement niet laden...",
"Registration is not allowed anymore, as you cancelled your registration after the deadline.": "Aanmelden is niet meer toegestaan omdat je bent afgemeld na de afmelddeadline."
}
......@@ -209,6 +209,8 @@ Pizza:
const regStarted = startRegDate <= nowDate;
const regAllowed = regRequired && endRegDate > nowDate && regStarted;
const afterCancelDeadline = data.cancel_deadline !== null && cancelDeadlineDate <= nowDate;
const isLateCancellation = data.user_registration
&& data.user_registration.is_late_cancellation;
if (!regRequired) {
text = t('No registration required.');
......@@ -220,9 +222,11 @@ Pizza:
text = t('Registration will open {{start}}', { start: registrationStart });
} else if (!regAllowed) {
text = t('Registration is not possible anymore.');
} else if (isLateCancellation) {
text = t('Registration is not allowed anymore, as you cancelled your registration after the deadline.');
}
if (afterCancelDeadline) {
if (afterCancelDeadline && !isLateCancellation) {
if (text.length > 0) {
text += ' ';
}
......@@ -253,8 +257,12 @@ Pizza:
const regRequired = data.registration_start !== null || data.registration_end !== null;
const regStarted = startRegDate <= nowDate;
const isLateCancellation = data.user_registration
&& data.user_registration.is_late_cancellation;
const regAllowed = regRequired && endRegDate > nowDate
&& regStarted && data.registration_allowed;
&& regStarted && data.registration_allowed
&& !isLateCancellation;
if (regAllowed) {
if (data.user_registration === null || data.user_registration.is_cancelled) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment