diff options
| author | realtradam <[email protected]> | 2024-07-23 20:47:31 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-23 20:47:31 -0400 |
| commit | 1e18e0ad7a47536be92384bbf815e0923a06698d (patch) | |
| tree | b07405ecdef4f05a96b6c4348930cbee976554cb /backend/src/main/resources/templates/auth | |
| parent | 56c59e3b98fe554c4e1484e208e4be5c30f09a04 (diff) | |
| download | spring-blog-1e18e0ad7a47536be92384bbf815e0923a06698d.tar.gz spring-blog-1e18e0ad7a47536be92384bbf815e0923a06698d.zip | |
split front and back end, add react to project
Diffstat (limited to 'backend/src/main/resources/templates/auth')
| -rw-r--r-- | backend/src/main/resources/templates/auth/login.html | 48 | ||||
| -rw-r--r-- | backend/src/main/resources/templates/auth/register.html | 63 |
2 files changed, 111 insertions, 0 deletions
diff --git a/backend/src/main/resources/templates/auth/login.html b/backend/src/main/resources/templates/auth/login.html new file mode 100644 index 0000000..47bc63e --- /dev/null +++ b/backend/src/main/resources/templates/auth/login.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="en" + xmlns:th="http://www.thymeleaf.org" + xmlns:layout="https://www.ultraq.net.nz/thymeleaf/layout" + layout:decorate="~{layout}" +> +<body layout:fragment="content"> + +<div th:if="${param.error}" class="text-xl p-4 bg-black text-red-500">Invalid Username/Password</div> +<div th:if="${param.logout}" class="text-xl p-4 bg-black text-red-500">You have been logged out</div> + +<div class="flex h-full justify-center bg-white p-12"> + <form th:action="@{/userlogin}" method="post" class="w-full max-w-lg"> + <div class="flex flex-wrap -mx-3 mb-6"> + <div class="w-full md:w-1/2 px-3 mb-6 md:mb-0"> + <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" + for="username"> + Title + </label> + <input class="appearance-none block w-full bg-gray-200 text-gray-700 border rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" + id="username" + type="text" + name="username" + placeholder="Ted"> + </div> + </div> + <div class="flex flex-wrap -mx-3 mb-6"> + <div class="w-full px-3"> + <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" + for="password"> + Password + </label> + <input class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" + id="password" + type="password" + name="password" + placeholder="Doe"> + </div> + </div> + <div class="flex flex-wrap mb-2"> + </div> + <button type="submit" value="Log in" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Log In</button> + + </form> +</div> + +</body> +</html>
\ No newline at end of file diff --git a/backend/src/main/resources/templates/auth/register.html b/backend/src/main/resources/templates/auth/register.html new file mode 100644 index 0000000..dc57ca4 --- /dev/null +++ b/backend/src/main/resources/templates/auth/register.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<html lang="en" + xmlns:th="http://www.thymeleaf.org" + xmlns:layout="https://www.ultraq.net.nz/thymeleaf/layout" + layout:decorate="~{layout}" +> +<body layout:fragment="content"> + +<div class="flex justify-center bg-white p-12"> + <div th:if="${param.fail}" class="text-xl p-4 bg-black text-red-500">Username or Email already exists</div> + <form th:action="@{/register/save}" th:object="${user}" role="form" method="post" class="w-full max-w-lg"> + <div class="flex flex-wrap -mx-3 mb-6"> + <div class="w-full md:w-1/2 px-3 mb-6 md:mb-0"> + <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" + for="username"> + Title + </label> + <input class="appearance-none block w-full bg-gray-200 text-gray-700 border rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" + id="username" + type="text" + name="username" + th:field="*{username}" + placeholder="Ted"> + <p th:if="${#fields.hasErrors('username')}" th:errors="*{username}" class="text-red-500 text-xs italic">Please fill out this field.</p> + </div> + <div class="w-full md:w-1/2 px-3"> + <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" + for="email"> + Email + </label> + <input class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" + id="email" + type="text" + name="email" + th:field="*{email}" + placeholder="[email protected]"> + <p th:if="${#fields.hasErrors('email')}" th:errors="*{email}" class="text-red-500 text-xs italic">Please fill out this field.</p> + </div> + </div> + <div class="flex flex-wrap -mx-3 mb-6"> + <div class="w-full px-3"> + <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" + for="password"> + Password + </label> + <input class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" + id="password" + type="password" + name="password" + th:field="*{password}" + placeholder="Doe"> + <p th:if="${#fields.hasErrors('password')}" th:errors="*{password}" class="text-red-500 text-xs italic">Please fill out this field.</p> + </div> + </div> + <div class="flex flex-wrap mb-2"> + </div> + <button th:href="@{/register}" type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Register</button> + + </form> +</div> + +</body> +</html>
\ No newline at end of file |
