diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-07-07 15:29:04 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-07-07 15:44:38 +0200 |
commit | e1ba80b1b7561f50c71d4ec45912eb39f438b511 (patch) | |
tree | 0e45efb6f509ee7b9be5d885864709746e8e22f7 /views | |
parent | 0e1ac6bad899cf4b58a5455dd0953cc501bc0810 (diff) | |
download | server-e1ba80b1b7561f50c71d4ec45912eb39f438b511.tar.gz |
Add pages to change your user name and email.
Diffstat (limited to 'views')
-rw-r--r-- | views/change_mail.ejs | 12 | ||||
-rw-r--r-- | views/change_name.ejs | 12 | ||||
-rw-r--r-- | views/profile.ejs | 15 |
3 files changed, 31 insertions, 8 deletions
diff --git a/views/change_mail.ejs b/views/change_mail.ejs new file mode 100644 index 0000000..6c3ed62 --- /dev/null +++ b/views/change_mail.ejs @@ -0,0 +1,12 @@ +<%- include('header', { title: "Change mail address" }) %> +<form action="/change_mail" method="post"> +<p> +Name: <%= user.name %> +<p> +Mail: <%= user.mail %> +<p> +<label for="newmail">New mail address: </label><br> +<input type="newmail" id="newmail" name="newmail" required> +<p> +<button type="submit">Change mail</button> +</form> diff --git a/views/change_name.ejs b/views/change_name.ejs new file mode 100644 index 0000000..eac508f --- /dev/null +++ b/views/change_name.ejs @@ -0,0 +1,12 @@ +<%- include('header', { title: "Change name" }) %> +<form action="/change_name" method="post"> +<p> +Name: <%= user.name %> +<p> +Mail: <%= user.mail %> +<p> +<label for="newname">New name: </label><br> +<input type="newname" id="newname" name="newname" required> +<p> +<button type="submit">Change name</button> +</form> diff --git a/views/profile.ejs b/views/profile.ejs index 7829870..74843f3 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -12,20 +12,19 @@ Your mail address is <%= user.mail %>. <br clear=left> -<p> -<% +<ul style="list-style:'\bb '"> +<li><% if (user.notifications) { %><a href="/unsubscribe">Disable mail notifications</a><% } else { %><a href="/subscribe">Enable mail notifications</a><% } %> - -<p> -<a href="/change_password">Change password</a> - -<p> -<a href="/logout">Logout</a> +<li><a href="/change_password">Change password</a> +<li><a href="/change_mail">Change mail address</a> +<li><a href="/change_name">Change name</a> +<li><a href="/logout">Logout</a> +</ul> <% if (open_games.length > 0) { %> <h2>Open Games</h2> |