dipslay stuf

This commit is contained in:
Anthony Stirling
2023-09-04 00:12:27 +01:00
parent 0bb2df135b
commit fd08513212
7 changed files with 85 additions and 87 deletions

View File

@@ -42,8 +42,8 @@ red=Red
green=Green
blue=Blue
custom=Custom...
changedCredsMessage=Credentials changed!
changedCredsMessage=Credentials changed!
notAuthenticatedMessage=User not authenticated.
userNotFoundMessage=User not found.
incorrectPasswordMessage=Current password is incorrect.
@@ -75,6 +75,19 @@ settings.zipThreshold=Zip files when the number of downloaded files exceeds
settings.signOut=Sign Out
settings.accountSettings=Account Settings
changeCreds.title=Change Credentials
changeCreds.header=Update Your Account Details
changeCreds.changeUserAndPassword=You are using default login credentials. Please enter a new password (and username if wanted)
changeCreds.newUsername=New Username
changeCreds.oldPassword=Current Password
changeCreds.newPassword=New Password
changeCreds.confirmNewPassword=Confirm New Password
changeCreds.submit=Submit Changes
account.title=Account Settings
account.accountSettings=Account Settings
account.adminSettings=Admin Settings - View and Add Users

View File

@@ -16,19 +16,21 @@
<!-- User Settings Title -->
<h2 class="text-center" th:text="#{account.accountSettings}">User Settings</h2>
<hr>
<div th:if="${notAuthenticated}" class="alert alert-danger" role="alert">
User not authenticated.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'notAuthenticated'}" class="alert alert-danger">
<span th:text="#{notAuthenticatedMessage}">Default message if not found</span>
</div>
<div th:if="${userNotFound}" class="alert alert-danger" role="alert">
User not found.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'userNotFound'}" class="alert alert-danger">
<span th:text="#{userNotFoundMessage}">Default message if not found</span>
</div>
<div th:if="${incorrectPassword}" class="alert alert-danger" role="alert">
Current password is incorrect.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'incorrectPassword'}" class="alert alert-danger">
<span th:text="#{incorrectPasswordMessage}">Default message if not found</span>
</div>
<div th:if="${usernameExists}" class="alert alert-danger" role="alert">
New username already exists.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'usernameExists'}" class="alert alert-danger">
<span th:text="#{usernameExistsMessage}">Default message if not found</span>
</div>

View File

@@ -16,20 +16,20 @@
<!-- User Settings Title -->
<h2 class="text-center" th:text="#{changeCreds.header}">User Settings</h2>
<hr>
<div th:if="${notAuthenticated}" class="alert alert-danger" role="alert">
User not authenticated.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'notAuthenticated'}" class="alert alert-danger">
<span th:text="#{notAuthenticatedMessage}">Default message if not found</span>
</div>
<div th:if="${userNotFound}" class="alert alert-danger" role="alert">
User not found.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'userNotFound'}" class="alert alert-danger">
<span th:text="#{userNotFoundMessage}">Default message if not found</span>
</div>
<div th:if="${incorrectPassword}" class="alert alert-danger" role="alert">
Current password is incorrect.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'incorrectPassword'}" class="alert alert-danger">
<span th:text="#{incorrectPasswordMessage}">Default message if not found</span>
</div>
<div th:if="${usernameExists}" class="alert alert-danger" role="alert">
New username already exists.
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'usernameExists'}" class="alert alert-danger">
<span th:text="#{usernameExistsMessage}">Default message if not found</span>
</div>
<div th:if="${changeCredsFlag}" class="alert alert-success" th:text="#{changeCredsMessage}"></div>
<!-- At the top of the user settings -->
<h3 class="text-center"><span th:text="#{welcome} + ' ' + ${username}">User</span>!</h3>

View File

@@ -179,17 +179,10 @@ document.addEventListener('DOMContentLoaded', function() {
const urlParams = currentURL.searchParams;
const currentLangParam = urlParams.get('lang') || defaultLocale;
console.log("defaultLocale", defaultLocale);
console.log("storedLocale", storedLocale);
console.log("currentLangParam", currentLangParam);
if (defaultLocale !== storedLocale && currentLangParam !== storedLocale) {
console.log("currentLangParam", currentLangParam)
console.log("storedLocale", storedLocale)
urlParams.set('lang', storedLocale);
currentURL.search = urlParams.toString();
console.log("redirecting to", currentURL.toString());
window.location.href = currentURL.toString();
return;
}
@@ -263,8 +256,9 @@ function handleDropdownItemClick(event) {
<div th:if="${logoutMessage}" class="alert alert-success"
th:text="${logoutMessage}"></div>
<div th:if="${param.messageType != null and param.messageType.size() > 0 and param.messageType[0] == 'credsUpdated'}" class="alert alert-success">
<span th:text="#{changedCredsMessage}">Default message if not found</span>
</div>
<form th:action="@{login}" method="post">
<img class="mb-4" src="favicon.svg" alt="" width="144" height="144">
<h1 class="h1 mb-3 fw-normal" th:text="${@appName}">Stirling-PDF</h1>