summaryrefslogtreecommitdiff
path: root/views/profile.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-09-06 20:41:52 +0200
committerTor Andersson <tor@ccxvii.net>2023-09-12 11:11:15 +0200
commita3ae62afd2eecb3831e2483f94d2db6a1d6bb748 (patch)
treeafab182f51b3769feb6c060a48e65513d09c7425 /views/profile.pug
parentcce4df5b31627482ca1ce595223e4ae02800f0dc (diff)
downloadserver-a3ae62afd2eecb3831e2483f94d2db6a1d6bb748.tar.gz
Notification system improvements.
Enable webhook notification support with .env WEBHOOKS=1 Send notifications when invited to a game. Use notification "too soon" logic for webhooks as well. Try sending webhooks 3 times before giving up. Check if player is on the join page instead of the funky "offline" check when sending "your game is ready" notification. Only show mail/webhook notification settings if they are enabled.
Diffstat (limited to 'views/profile.pug')
-rw-r--r--views/profile.pug33
1 files changed, 19 insertions, 14 deletions
diff --git a/views/profile.pug b/views/profile.pug
index 63d3018..d884f8f 100644
--- a/views/profile.pug
+++ b/views/profile.pug
@@ -12,10 +12,14 @@ html
p Welcome, #{user.name}!
p Your mail address is #{user.mail}
- if user.notify
- p <a href="/unsubscribe">Disable mail notifications</a>
- else
- p <a href="/subscribe">Enable mail notifications</a>
+ if ENABLE_MAIL
+ if !user.is_verified
+ p <a href="/verify-mail">Verify your mail address</a>
+
+ if user.notify
+ p <a href="/unsubscribe">Disable mail notifications</a>
+ else
+ p <a href="/subscribe">Enable mail notifications</a>
p
| <a href="/change-password">Change password</a>
@@ -28,16 +32,17 @@ html
br
| <a href="/delete-account">Delete account</a>
- if !user.webhook
- p <a href="/webhook">Configure webhook</a>
- else if user.webhook.error
- dl
- dt <a href="/webhook">Configure webhook</a>
- dd.error ERROR: #{user.webhook.error}
- else
- dl
- dt <a href="/webhook">Configure webhook</a>
- dd= new URL(user.webhook.url).hostname
+ if ENABLE_WEBHOOKS
+ if !user.webhook
+ p <a href="/webhook">Configure webhook</a>
+ else if user.webhook.error
+ dl
+ dt <a href="/webhook">Configure webhook</a>
+ dd.error ERROR: #{user.webhook.error}
+ else
+ dl
+ dt <a href="/webhook">Configure webhook</a>
+ dd= new URL(user.webhook.url).hostname
p
form(action="/logout" method="post")