aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-06-24 21:53:20 +0530
committerBobby <[email protected]>2022-06-24 21:53:20 +0530
commit555d44220b016978cd9cbddf8d1ac6bb84a1f142 (patch)
treee434151c4dea941f91652531d39262bdf6a82341 /views
parent00e99b844c260e0263e5d5403d284ba07450005e (diff)
downloadthatcomputerscientist-555d44220b016978cd9cbddf8d1ac6bb84a1f142.tar.xz
thatcomputerscientist-555d44220b016978cd9cbddf8d1ac6bb84a1f142.zip
basic email validation on account page
Diffstat (limited to 'views')
-rw-r--r--views/account.ejs19
-rw-r--r--views/error.ejs38
2 files changed, 40 insertions, 17 deletions
diff --git a/views/account.ejs b/views/account.ejs
index 6649eac4..06e4ca9e 100644
--- a/views/account.ejs
+++ b/views/account.ejs
@@ -10,9 +10,9 @@
<li>Do not send multiple support requests.</li>
<li>Please note that this is a support request related to your account. Please do not file any bugs here. If you have noticed a bug, please report it to the <a href="https://github.com/luciferreeves/thatcomputerscientist/issues">GitHub Issues</a> page.</li>
</ul>
- <p>Your avatar is fetched from gravatar. Update your gravatar email to fetch the avatar. If you don't have an account, you can sign up for one <a href="https://en.gravatar.com/" target="_blank">here</a>.</p>
- <% if (user.public == 1) { %>
- <p>Your account is publicly accessible at: <a href="/profile/<%= user.username %>"><span id="accountURL"></span></a>.</p>
+ <p>Your avatar is fetched from gravatar. Update your gravatar email to fetch the avatar. If you don't have an account, you can sign up for one <a href="https://en.gravatar.com/" target="_blank">here</a>. If you haven't set up your gravatar email, we would try to fetch your profile picture from your account email, by default. If your account email and gravatar email are the same, you do not need to set a gravatar email.</p>
+ <% if (user.url !== "") { %>
+ <p>Your account is publicly accessible at: <a href="<%= user.url %>" target="_blank"><%= user.url %></a></p>
<% } %>
<div class="account">
<div class="ac-sidebar">
@@ -51,6 +51,8 @@
<input type="text" name="firstname" id="firstname" value="<%= user.firstname %>" placeholder="First Name" />
<label for="lastname">Last Name</label>
<input type="text" name="lastname" id="lastname" value="<%= user.lastname %>" placeholder="Last Name" />
+ <label for="gravatarEmail">Gravatar Email</label>
+ <input type="text" name="gravatarEmail" id="gravatarEmail" value="<%= user.gravatarEmail %>" placeholder="Gravatar Email" />
<label for="location">Location</label>
<input type="text" name="location" id="location" value="<%= user.location %>" placeholder="Location" />
<label for="bio">Bio</label>
@@ -76,12 +78,21 @@
<% } %>
</fieldset>
</form>
- <form method="post" action="">
+ <form method="post" action="/account/sendVerificationEmail">
<fieldset>
<legend>Change Email</legend>
<label for="email">Your current registered email is <em><u><%= user.email %></u></em>. Please note that a verification email will be sent to the new email address in order to update the current email address. Please provide the new email address in the box below:</label>
<input type="email" name="email" id="email" placeholder="New Email" />
<input type="submit" value="Change Email" />
+ <% if (locals.messages.mailsenderror) { %>
+ <p class="error"><%= messages.mailsenderror %></p>
+ <% } %>
+ <% if (locals.messages.mailsendsuccess) { %>
+ <p class="success"><%= messages.mailsendsuccess %></p>
+ <script>
+ console.log("<%= messages.mailsendsuccess %>");
+ </script>
+ <% } %>
</fieldset>
</form>
</div>
diff --git a/views/error.ejs b/views/error.ejs
index d11cc4be..16a9f991 100644
--- a/views/error.ejs
+++ b/views/error.ejs
@@ -1,14 +1,26 @@
-<%- include('partials/header.ejs') %> <%- include('partials/sidebar.ejs') %>
-<div class="main">
- <div class="alert">
- <h1 class="error">error</h1>
- <p>
- <%= error %>
- </p>
- </div>
- <section>
- <h2>Recent Posts</h2>
- </section>
-</div>
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta
+ name="description"
+ content="Welcome to the home of That Computer Scientist. I am Kumar Priyansh. This is my personal website where I share all of my thoughts, ideas, and experiences."
+ />
+ <title>That Computer Scientist - <%= title %></title>
+ <!-- <link rel="stylesheet" href="css/fonts.css"> -->
+ <link preload rel="stylesheet" href="../css/main.css" />
+ </head>
+ <body>
+ <div class="main">
+ <div class="errorbox">
+ <h1 class="error">Whoops! Encountered an error!</h1>
+ <p><%= error %></p>
+ <p>Please click <a href="/">here</a> to go back to the home page.</p>
+ </div>
+ </div>
-<%- include('partials/footer.ejs') %>
+ <%- include('partials/footer.ejs') %>
+ </body>
+</html>