Browse Source

UI: Profile link style change

master
parent
commit
a6a0370f7e
  1. 11
      pages/base.html
  2. 1
      src/server/endpoints.go
  3. 10
      translations/ENG/base.json
  4. 10
      translations/RU/base.json

11
pages/base.html

@ -43,8 +43,11 @@
<small id="locale">ENG</small> <small id="locale">ENG</small>
</button> </button>
</div> </div>
<div class="text-end"> <div class="text-end p-1" id="profile-link" style="display: none;">
<a class="btn btn-secondary" href="/profile"><img src="/static/images/person-vcard.svg"></a> <a class="btn btn-warning" href="/profile">
<img src="/static/images/person-vcard.svg">
{{index .Translation "base link profile"}}
</a>
</div> </div>
<div class="text-end" id="bar-auth"> <div class="text-end" id="bar-auth">
<a href="/login" class="btn btn-outline-light me-2">{{index .Translation "base link log in"}}</a> <a href="/login" class="btn btn-outline-light me-2">{{index .Translation "base link log in"}}</a>
@ -125,12 +128,14 @@ document.addEventListener('DOMContentLoaded', async function() {
let response = await getUser(); let response = await getUser();
if (response.ok) { if (response.ok) {
let barAuth = document.getElementById("bar-auth"); let barAuth = document.getElementById("bar-auth");
barAuth.innerHTML = '<button id="log-out-btn" class="btn btn-outline-light me-2"><img src="/static/images/person-dash-fill.svg"></button>'; barAuth.innerHTML = '<button id="log-out-btn" class="btn btn-outline-light me-2"><img src="/static/images/person-dash-fill.svg">{{index .Translation "base link log out"}}</button>';
document.getElementById("log-out-btn").addEventListener("click", (event) => { document.getElementById("log-out-btn").addEventListener("click", (event) => {
// Log out // Log out
forgetAuthInfo(); forgetAuthInfo();
window.location.replace("/about"); window.location.replace("/about");
}); });
document.getElementById("profile-link").style.display = "inline";
} }
} catch(error) { } catch(error) {
forgetAuthInfo(); forgetAuthInfo();

1
src/server/endpoints.go

@ -129,6 +129,7 @@ func (s *Server) EndpointUserCreate(w http.ResponseWriter, req *http.Request) {
http.Error(w, "Failed to send email verification message", http.StatusInternalServerError) http.Error(w, "Failed to send email verification message", http.StatusInternalServerError)
return return
} }
logger.Info("[Server][EndpointUserCreate] Successfully sent confirmation email to %s", user.Email)
// Autodelete user account after some more time if email was not verified in time // Autodelete user account after some more time if email was not verified in time
time.AfterFunc((time.Second*time.Duration(verification.LifeSeconds))*5, func() { time.AfterFunc((time.Second*time.Duration(verification.LifeSeconds))*5, func() {

10
translations/ENG/base.json

@ -20,6 +20,16 @@
"id": "base link sign up", "id": "base link sign up",
"message": "Sign-Up", "message": "Sign-Up",
"translation": "Sign-Up" "translation": "Sign-Up"
},
{
"id": "base link profile",
"message": "Profile",
"translation": "Profile"
},
{
"id": "base link log out",
"message": "Log Out",
"translation": "Log Out"
} }
] ]
} }

10
translations/RU/base.json

@ -20,6 +20,16 @@
"id": "base link sign up", "id": "base link sign up",
"message": "Sign-Up", "message": "Sign-Up",
"translation": "Зарегистрироваться" "translation": "Зарегистрироваться"
},
{
"id": "base link profile",
"message": "Profile",
"translation": "Профиль"
},
{
"id": "base link log out",
"message": "Log Out",
"translation": "Выйти"
} }
] ]
} }
Loading…
Cancel
Save