aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2024-12-28 13:09:27 -0500
committerAndrew Lee <andrew@alee14.me>2024-12-28 13:09:27 -0500
commitb2748a5c55255014d5d5ea02fec38c4125e08e25 (patch)
treebd83292e4eb5be716ed32d92bf8d9e0fd2138616 /views
parent39cbc8c286227eca935248ad9237d66fa6f45f6e (diff)
downloadfreeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.tar.gz
freeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.tar.bz2
freeso-discord-auth-b2748a5c55255014d5d5ea02fec38c4125e08e25.zip
Ability to change password; Sim time on dashboard
Diffstat (limited to 'views')
-rw-r--r--views/dashboard.ejs42
-rw-r--r--views/error.ejs4
-rw-r--r--views/index.ejs6
-rw-r--r--views/password.ejs22
-rw-r--r--views/register.ejs5
-rw-r--r--views/success.ejs7
6 files changed, 62 insertions, 24 deletions
diff --git a/views/dashboard.ejs b/views/dashboard.ejs
index 1c7996b..b7c82d5 100644
--- a/views/dashboard.ejs
+++ b/views/dashboard.ejs
@@ -9,12 +9,44 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
+ <img src="/img/logo.png" alt="logo" width="200">
<h1>Welcome, <%= username %>!</h1>
- <h2>FreeSO Username: <%= fso_username %></h2>
- <a href="#" class="button">Change Password</a>
- <a href="#" class="button">Download bnbSO Client</a>
+ <h2>bnbSO Username: <%= fso_username %></h2>
+ <h2 id="simtime"></h2>
+ <a href="/password" class="button">Change Password</a>
+ <a href="https://fso-builds.riperiperi.workers.dev" class="button">Download bnbSO Client</a>
<a href="/logout" class="button logout">Logout</a>
</div>
+ <script>
+ function updateTSOClock() {
+ const currentTime = new Date(),
+ utcMinutes = currentTime.getUTCMinutes(),
+ utcSeconds = currentTime.getUTCSeconds();
+ let timePeriod = 'AM', totalSeconds = 0;
+ if (currentTime.getUTCHours() % 2 === 1) {
+ totalSeconds = 3600;
+ timePeriod = 'PM';
+ }
+ totalSeconds += utcMinutes * 60 + utcSeconds;
+ let hour = Math.floor(totalSeconds / 300);
+ if (hour > 12) {
+ hour -= 12;
+ }
+ if (hour === 0) {
+ hour = 12;
+ }
+ let minute = Math.floor(totalSeconds % 300 / 5);
+ if (minute < 10) {
+ minute = '0' + minute;
+ }
+ const simTimeElement = document.querySelector('#simtime');
+ if (simTimeElement) {
+ simTimeElement.textContent = `${hour}:${minute} ${timePeriod}`;
+ }
+ }
+
+ setInterval(updateTSOClock, 1000);
+ updateTSOClock();
+ </script>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/error.ejs b/views/error.ejs
index dc138e6..b867d30 100644
--- a/views/error.ejs
+++ b/views/error.ejs
@@ -9,9 +9,9 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
+ <img src="/img/logo.png" alt="logo" width="200">
<h1>Oh no! Something went wrong!</h1>
<p><%= error %></p>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/index.ejs b/views/index.ejs
index e786bd3..7a9b8a4 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -9,10 +9,10 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
+ <img src="/img/logo.png" alt="logo" width="200">
<p>Log into your Discord account to get access to bnbSO.</p>
<p><i>You must be a bits & Bytes member.</i></p>
- <a class="button discord" href="/auth/discord">Login with Discord</a>
+ <a class="button discord" href="/auth/discord">Login with Discord</a>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/password.ejs b/views/password.ejs
index f66b60b..8033aae 100644
--- a/views/password.ejs
+++ b/views/password.ejs
@@ -9,18 +9,22 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
+ <img src="/img/logo.png" alt="logo" width="200">
<h1>Change Password</h1>
- <p>If you have issues changing your password, ask the server operator to change your password.</p>
- <form method="post" action="/login">
- <label for="username">Username:</label>
- <input type="text" id="username" name="username">
- <label for="password">Current Password:</label>
- <input type="password" id="password" name="password">
- <button type="submit">Login</button>
+ <p>If you have issues changing your password, ask the server operator to reset your password.</p>
+ <form method="post" action="/password/change">
+ <label for="currentpassword">Current Password:</label>
+ <input type="password" id="currentpassword" name="currentpassword">
+ <label for="newpassword">New Password:</label>
+ <input type="password" id="newpassword" name="newpassword">
+ <label for="newpassword2">Confirm New Password:</label>
+ <input type="password" id="newpassword2" name="newpassword2">
+ <button type="submit">Change Password</button>
</form>
+ <a href="/" class="button">Dashboard</a>
<% if (typeof error !== 'undefined') { %>
<div class="error"><%= error %></div>
<% } %>
+ </div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/register.ejs b/views/register.ejs
index f417f82..d54013d 100644
--- a/views/register.ejs
+++ b/views/register.ejs
@@ -9,7 +9,7 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
+ <img src="/img/logo.png" alt="logo" width="200">
<h1>Welcome to bnbSO!</h1>
<p>You will be sending the following information to register your bnbSO account</p>
<p>Please verify that the following information is correct. You can only change your username <b>once</b>.</p>
@@ -25,5 +25,6 @@
<% if (typeof error !== 'undefined') { %>
<div class="error"><%= error %></div>
<% } %>
+ </div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/views/success.ejs b/views/success.ejs
index 2ec9771..f87ea2f 100644
--- a/views/success.ejs
+++ b/views/success.ejs
@@ -9,9 +9,10 @@
<body>
<div class="background"></div>
<div class="container">
- <img src="img/logo.png" alt="logo" width="200">
- <p>Created account successfully!</p>
+ <img src="/img/logo.png" alt="logo" width="200">
+ <h1>Success!</h1>
+ <p class="success"><%= success %></p>
<a href="/">Dashboard</a>
</div>
</body>
-</html> \ No newline at end of file
+</html>