From 6d2a264295ac7c6e901a06b24bed5d698a4cd6b1 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Thu, 26 Aug 2021 16:54:15 +0400 Subject: [PATCH] final touchups --- account/src/routers/api-router.ts | 2 +- account/views/user.ejs | 56 +++++++++++++++++++++++++------ website/src/screens/Account.tsx | 3 +- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/account/src/routers/api-router.ts b/account/src/routers/api-router.ts index 84c57aa..08fbb0c 100644 --- a/account/src/routers/api-router.ts +++ b/account/src/routers/api-router.ts @@ -144,7 +144,7 @@ apiRouter.post("/user/upgradeToStudentRequest", async (req, res, next) => { if (!req.user) throw new Error("user not found"); try { if (req.user.level === "student" || req.user.level === "editor") { - res.send({ ok: true, message: "user already upgraded "}); + res.send({ ok: true, message: "user already upgraded" }); return; } sendUpgradeRequestToAdmin(req.user).catch(console.error); diff --git a/account/views/user.ejs b/account/views/user.ejs index c77dda7..01ac33e 100644 --- a/account/views/user.ejs +++ b/account/views/user.ejs @@ -7,6 +7,9 @@ Account · LingDocs +
@@ -14,7 +17,7 @@ <% if (user.admin) { %>
Admin Console
<% } %> -

Profile:

+

Profile

@@ -48,9 +51,16 @@
-
Account Level: <%= user.level %>
+
Account Level: <%= user.level.charAt(0).toUpperCase() + user.level.slice(1) %>
+ <% if (user.level === "basic") { %> + <% if (user.upgradeToStudentRequest === "waiting") { %> +

Wating for upgrade approval

+ <% } else { %> + + <% } %> + <% } %> <% if (user.email) { %> -

Password:

+

Password

<% if (!user.password) { %>

Add a password to be able to log in with just your e-mail address.

<% } %> @@ -81,7 +91,7 @@ <% if (user.email) { %> -
+
<% } %> -

Linked Accounts:

+

Linked Accounts

<% if (user.google) { %>
Linked to Google · <%= user.google.emails[0].value %>
<% if (removeProviderOption) { %> - + <% } %>
<% } %> @@ -108,7 +118,7 @@
Linked to Twitter · @<%= user.twitter.username %>
<% if (removeProviderOption) { %> - + <% } %>
<% } %> @@ -116,7 +126,7 @@
Linked to GitHub · <%= user.github.username %>
<% if (removeProviderOption) { %> - + <% } %>
<% } %> @@ -147,8 +157,34 @@