- Добавил активацию нового аккаунта по электронной почте.

https://www.youtube.com/watch?v=yBXs_gtSmUc&list=PLU2ftbIeotGpAYRP9Iv2KLIwK36-o_qYk&index=12
This commit is contained in:
Leonid
2025-02-16 00:19:45 +03:00
parent 27441efde7
commit 2736f3ddf6
17 changed files with 269 additions and 30 deletions

View File

@@ -7,4 +7,10 @@ spring.freemarker.expose-request-attributes=true
spring.freemarker.expose-session-attributes=true
spring.freemarker.suffix=.ftl
upload.path=/home/kashey/soft/sweater/uploads
hosting.path=http://localhost:8080
spring.mail.host=smtp.yandex.ru
spring.mail.username=username@yandex.ru
spring.mail.password=pa$$word
spring.mail.port=465
spring.mail.protocol=smtps
mail.debug=true

View File

@@ -0,0 +1,106 @@
:root {
--yellow-1c: #ffe100; /* Основной желтый */
--light-yellow-1c: #FDF5C9; /* Светло-желтый фон */
--dark-1c: #333333; /* Темный цвет для текста */
--light-yellow-header-1c: #fbed9e;
--light-grey-1c:#f2f2f2;
--brand-red-1c: #B22222;
--begie: #F5F5DC;
--light-y:#F5F5F5;
--header: #F5DEB3;
--brown-1c: #663300;
--gray-1c: #CCCCCC;
}
/*!* Фон приложения *!*/
body {
background-color: var(--light-y) !important;
color: var(--dark-1c);
}
/* Навигационная панель */
.navbar {
background-color: var(--gray-1c) !important;
color: var(--dark-1c) !important;
}
/*.navbar .nav-link {*/
/* color: var(--brown-1c) !important;*/
/*}*/
/*.navbar .nav-link:hover {*/
/* color: black !important;*/
/*}*/
/* Кнопки */
/*.btn-primary {*/
/* background-color: var(--yellow-1c) !important;*/
/* border-color: var(--yellow-1c) !important;*/
/* color: var(--dark-1c) !important;*/
/*}*/
/*.btn-primary:hover {*/
/* background-color: #E6C200 !important; !* Чуть темнее *!*/
/* border-color: #E6C200 !important;*/
/*}*/
/*!* Карточки и панели *!*/
/*.card, .panel {*/
/* background-color: var(--white-1c) !important;*/
/* border: 1px solid var(--gray-1c) !important;*/
/*}*/
/*!* Таблицы *!*/
/*.table {*/
/* background-color: var(--white-1c);*/
/* color: var(--dark-1c);*/
/*}*/
/*.table thead th {*/
/* background-color: var(--yellow-1c);*/
/* color: var(--dark-1c);*/
/*}*/
/*.table-striped tbody tr:nth-of-type(odd) {*/
/* background-color: var(--gray-1c);*/
/*}*/
/*!* Поля ввода *!*/
/*.form-control {*/
/* background-color: var(--white-1c);*/
/* border: 1px solid var(--gray-1c);*/
/* color: var(--dark-1c);*/
/*}*/
/*.form-control:focus {*/
/* border-color: var(--yellow-1c);*/
/* box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.5);*/
/*}*/
/*!* Выделение чекбоксов *!*/
/*.form-check-input:checked {*/
/* background-color: var(--yellow-1c);*/
/* border-color: var(--yellow-1c);*/
/*}*/
/*!* Бейджи *!*/
/*.badge-primary {*/
/* background-color: var(--yellow-1c);*/
/* color: var(--dark-1c);*/
/*}*/
/*!* Тени для элементов *!*/
/*.box-shadow {*/
/* box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);*/
/*}*/
/*!* Стили для названия бренда (Sweater) *!*/
/*.navbar-brand {*/
/* color: var(--brown-1c) !important; !* Темный цвет текста *!*/
/* font-weight: bold; !* Сделаем жирным *!*/
/*}*/
/*.navbar-brand:hover {*/
/* color: black !important; !* Черный при наведении *!*/
/*}*/

View File

@@ -1,3 +0,0 @@
body {
color: #191970;
}

View File

@@ -2,5 +2,8 @@
<#import "parts/login.ftl" as l>
<@com.page>
<#if message??>
<div class="mb-3"> ${message} </div>
</#if>
<@l.login "/login" false/>
</@com.page>

View File

@@ -1,5 +1,6 @@
<#import "parts/common.ftl" as com>
<@com.page>
<link href="/static/custom.css" rel="stylesheet">
<div class="input-group mb-3">
<form method="get" action="/main" class="form-inline">
<input type="text" name="tag" value="${tag}" placeholder="Tag to search">

View File

@@ -4,7 +4,6 @@
<head>
<title>Sweater</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/static/style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

View File

@@ -1,7 +1,7 @@
<#macro login path isRegistrationForm=false>
<form action="${path}" method="post" xmlns="http://www.w3.org/1999/html">
<div class="row mb-3">
<label class="col-sm-2 col-form-label"> User Name :</label>
<label class="col-sm-2 col-form-label"> User Name:</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="username" placeholder="User name"/>
</div>
@@ -12,10 +12,20 @@
<input type="password" class="form-control" name="password" placeholder="Password">
</div>
</div>
<#if isRegistrationForm>
<div class="row mb-3">
<label class="col-sm-2 col-form-label"> E-mail:</label>
<div class="col-sm-6">
<input type="email" class="form-control" name="email" placeholder="E-mail"/>
</div>
</div>
</#if>
<#if !isRegistrationForm>
<a href="/registration" class="btn btn-primary">Add new user</a>
</#if>
<input class="btn btn-primary" type="submit" <#if isRegistrationForm> value="Create" <#else> value="Sign in"</#if>/>
<input class="btn btn-primary"
type="submit" <#if isRegistrationForm> value="Create" <#else> value="Sign in"</#if>/>
<input type="hidden" name="_csrf" value="${_csrf.token}"/>
</form>
</#macro>

View File

@@ -2,6 +2,7 @@
<#import "login.ftl" as l>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<link href="/static/custom.css" rel="stylesheet">
<div class="container-fluid">
<a class="navbar-brand" href="/">Sweater</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"

View File

@@ -5,7 +5,7 @@
<div class="mb-1"> Add new user </div>
<br>
<#if message??>
${message}
<div class="mb-3"> ${message} </div>
</#if>
<@l.login "/registration" true/>
</@com.page>

View File

@@ -2,7 +2,7 @@
<@com.page>
<div class="container mt-4">
<table class="table table-striped table-hover">
<thead class="thead-dark">
<thead class="table-sub-heading-color">
<tr>
<th scope="col">Name</th>
<th scope="col">Role</th>
@@ -25,6 +25,6 @@
</#list>
</tbody>
</table>
<a href="/main" class="btn btn-primary">Main page</a>
<a href="/main" class="btn btn-primary">Main page</a>
</div>
</@com.page>