summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/emails/addEventAttendee/addEventAttendeeHtml.handlebars3
-rw-r--r--views/emails/addEventAttendee/addEventAttendeeText.handlebars4
-rw-r--r--views/emails/unattendEvent/unattendEventHtml.handlebars2
-rw-r--r--views/emails/unattendEvent/unattendEventText.handlebars2
-rwxr-xr-xviews/event.handlebars25
5 files changed, 27 insertions, 9 deletions
diff --git a/views/emails/addEventAttendee/addEventAttendeeHtml.handlebars b/views/emails/addEventAttendee/addEventAttendeeHtml.handlebars
index 971364c..48cdb48 100644
--- a/views/emails/addEventAttendee/addEventAttendeeHtml.handlebars
+++ b/views/emails/addEventAttendee/addEventAttendeeHtml.handlebars
@@ -1,6 +1,7 @@
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">You just marked yourself as attending an event on {{siteName}}. Thank you! We'll send you another email if there are any updates to the event. Your email will be automatically removed from the database once the event finishes.</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Follow this link to open the event page any time: <a href="https://{{domain}}/{{eventID}}">https://{{domain}}/{{eventID}}</a></p>
-<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Need to remove yourself from this event? Head to the event page and use this <strong>deletion password</strong>: {{removalPassword}}</p>
+<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Need to remove yourself from this event? <a href="https://{{domain}}/event/{{eventID}}/unattend/{{removalPasswordHash}}">Click this link</a>.</p>
+<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">You can also head to the event page and use this <strong>deletion password</strong>: {{removalPassword}}</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Love,</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">{{siteName}}</p>
<hr/>
diff --git a/views/emails/addEventAttendee/addEventAttendeeText.handlebars b/views/emails/addEventAttendee/addEventAttendeeText.handlebars
index 2e0eca7..3930e28 100644
--- a/views/emails/addEventAttendee/addEventAttendeeText.handlebars
+++ b/views/emails/addEventAttendee/addEventAttendeeText.handlebars
@@ -2,7 +2,9 @@ You just marked yourself as attending an event on {{siteName}}. Thank you! We'll
Follow this link to open the event page any time: https://{{domain}}/{{eventID}}
-Need to remove yourself from this event? Head to the event page and use this deletion password: {{removalPassword}}
+Need to remove yourself from this event? Click this link: https://{{domain}}/event/{{eventID}}/unattend/{{removalPasswordHash}}
+
+You can also head to the event page and use this deletion password: {{removalPassword}}
Love,
diff --git a/views/emails/unattendEvent/unattendEventHtml.handlebars b/views/emails/unattendEvent/unattendEventHtml.handlebars
index 62dac8a..bc20d27 100644
--- a/views/emails/unattendEvent/unattendEventHtml.handlebars
+++ b/views/emails/unattendEvent/unattendEventHtml.handlebars
@@ -1,5 +1,5 @@
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">You just removed yourself from an event on {{siteName}}. You will no longer receive update emails for this event.</p>
-<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">If you didn't mean to do this, someone else who knows your email removed you from the event.</p>
+<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">If you didn't mean to do this, an admin may have removed you from the event.</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Follow this link to open the event page any time: <a href="https://{{domain}}/{{eventID}}">https://{{domain}}/{{eventID}}</a></p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">Love,</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; Margin-bottom: 15px;">{{siteName}}</p>
diff --git a/views/emails/unattendEvent/unattendEventText.handlebars b/views/emails/unattendEvent/unattendEventText.handlebars
index dbe83b4..7e60dbf 100644
--- a/views/emails/unattendEvent/unattendEventText.handlebars
+++ b/views/emails/unattendEvent/unattendEventText.handlebars
@@ -1,6 +1,6 @@
You just removed yourself from an event on {{siteName}}. You will no longer receive update emails for this event.
-If you didn't mean to do this, someone else who knows your email removed you from the event.
+If you didn't mean to do this, an admin may have removed you from the event.
Follow this link to open the event page any time: https://{{domain}}/{{eventID}}
diff --git a/views/event.handlebars b/views/event.handlebars
index 6485ec5..3ccbc08 100755
--- a/views/event.handlebars
+++ b/views/event.handlebars
@@ -17,6 +17,11 @@
{{/if}}
</div>
</div>
+{{#if message}}
+<div class="alert alert-info mt-3 text-center" role="alert" id="event__message">
+ {{message}}
+</div>
+{{/if}}
<div id="event__basics">
<div class="card" id="event__data">
<div class="card-body">
@@ -207,7 +212,7 @@
</div>
<div class="form-group">
<label for="removalPassword">Deletion password</label>
- <p class="form-text small">You will need this password if you want to remove yourself from the list of event attendees. If you provided your email, you'll receive it by email. Otherwise, write it down now because it will <strong>not be shown again</strong>.</p>
+ <p class="form-text small">You can use this password to remove yourself from the list of event attendees. If you provided your email, you'll receive it by email. Otherwise, write it down now because it will <strong>not be shown again</strong>.</p>
<input type="text" class="form-control" readonly id="removalPassword"
name="removalPassword">
</div>
@@ -456,7 +461,9 @@ window.eventData = {{{ json jsonData }}};
error: function(response, status, xhr) {
// The editing token is wrong - remove it
removeStoredToken(eventID);
- window.location = window.location.pathname;
+ // Remove the token from the URL
+ url.searchParams.delete('e');
+ window.location = url.href;
}
});
} else if (getStoredToken(eventID)) {
@@ -467,6 +474,9 @@ window.eventData = {{{ json jsonData }}};
data: { editToken },
success: function(response, status, xhr) {
if (xhr.status === 200) {
+ // Redirect to the same URL with the editing token in the URL
+ // We reload the page to force the server to load a page with
+ // the editing form accessible.
window.location.search = `?e=${editToken}`;
}
},
@@ -479,7 +489,12 @@ window.eventData = {{{ json jsonData }}};
if (urlParams.has('show_edit')) {
$('#editModal').modal('show');
- url.searchParams.delete('show_edit');
+ url.searchParams.delete('show_edit');
+ history.replaceState(history.state, '', url.href);
+ }
+
+ if (urlParams.has('m')) {
+ url.searchParams.delete('m');
history.replaceState(history.state, '', url.href);
}
@@ -538,7 +553,7 @@ window.eventData = {{{ json jsonData }}};
.attr('data-validation-allowing', `range[1;${response.data.freeSpots}]`)
.attr('data-validation-error-msg', `Please enter a number between 1 and ${response.data.freeSpots}`);
}
- modal.modal();
+ modal.modal();
})
.catch((error) => {
console.error(error);
@@ -572,4 +587,4 @@ window.eventData = {{{ json jsonData }}};
});
</script>
-</main> \ No newline at end of file
+</main>