This commit is contained in:
Anthony Stirling
2023-08-12 02:29:10 +01:00
parent 83ba1899b7
commit 6f325b5fdb
17 changed files with 718 additions and 3 deletions

View File

@@ -338,6 +338,49 @@
<label class="custom-control-label" for="boredWaiting" th:text="#{bored}"></label>
</div>
</div>
<hr>
<h5 th:text="#{settings.userSettings}">User Settings</h5>
<form action="/change-username" method="post">
<div class="form-group">
<label for="newUsername" th:text="#{settings.changeUsername}">Change Username</label>
<input type="text" class="form-control" name="newUsername" id="newUsername" placeholder="New Username">
</div>
<div class="form-group">
<label for="password" th:text="#{settings.password}">Password</label>
<input type="password" class="form-control" name="password" id="password" placeholder="Password">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" th:text="#{settings.changeUsernameButton}">Change Username</button>
</div>
</form>
<!-- Change Password Form -->
<form action="/change-password" method="post">
<div class="form-group">
<label for="oldPassword" th:text="#{settings.oldPassword}">Old Password</label>
<input type="password" class="form-control" name="oldPassword" id="oldPassword" placeholder="Old Password">
</div>
<div class="form-group">
<label for="newPassword" th:text="#{settings.newPassword}">New Password</label>
<input type="password" class="form-control" name="newPassword" id="newPassword" placeholder="New Password">
</div>
<div class="form-group">
<label for="confirmNewPassword" th:text="#{settings.confirmNewPassword}">Confirm New Password</label>
<input type="password" class="form-control" name="confirmNewPassword" id="confirmNewPassword" placeholder="Confirm New Password">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" th:text="#{settings.changePasswordButton}">Change Password</button>
</div>
</form>
<!-- Sign Out Button -->
<div class="form-group">
<a href="/logout">
<button type="button" class="btn btn-danger" th:text="#{settings.signOut}">Sign Out</button>
</a>
</div>
</div>
<div class="modal-footer">

View File

@@ -23,6 +23,9 @@
<script src="js/homecard.js"></script>
<div class=" container">
<form th:if="${@loginEnabled == true}" action="#" th:action="@{/logout}" method="post">
<input type="submit" value="Logout" />
</form>
<input type="text" id="searchBar" onkeyup="filterCards()" placeholder="Search for features...">
<div class="features-container ">

View File

@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Login</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div id="page-container">
<div id="content-wrap">
<div class="container">
<div class="row justify-content-center align-items-center" style="height:100vh;">
<div class="col-md-4">
<div class="login-container card">
<div class="card-header text-center">
<img src="favicon.svg" alt="Logo" class="img-fluid" style="max-width: 100px;"> <!-- Adjust path and style as needed -->
<h4>Stirling-PDF Login</h4>
</div>
<div th:if="${logoutMessage}" class="alert alert-success" th:text="${logoutMessage}"></div>
<div class="card-body">
<form th:action="@{/login}" method="post">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" class="form-control" required="required" />
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" id="password" name="password" class="form-control" required="required" />
</div>
<div class="form-group text-center">
<input type="submit" value="Login" class="btn btn-primary" />
</div>
</form>
</div>
<div class="card-footer text-danger text-center">
<div th:if="${error == 'badcredentials'}">
Invalid username or password.
</div>
<div th:if="${error == 'locked'}">
Your account has been locked.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div th:insert="~{fragments/footer.html :: footer}"></div>
</div>
</body>
</html>