Compare commits
No commits in common. "e2d54386c947030a5ac46e9018356cb16d4bd7ca" and "dbff5ad51ed673ec28b9588ee129d597211e60a7" have entirely different histories.
e2d54386c9
...
dbff5ad51e
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
3349
data.trace.db
3349
data.trace.db
File diff suppressed because it is too large
Load Diff
@ -38,8 +38,7 @@ public class SecurityConfiguration {
|
||||
.anyRequest().authenticated());
|
||||
|
||||
httpSecurity.formLogin(formLogin -> formLogin
|
||||
.loginPage(Constants.LOGIN_URL)
|
||||
.defaultSuccessUrl("/news", true));
|
||||
.loginPage(Constants.LOGIN_URL));
|
||||
|
||||
httpSecurity.rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret"));
|
||||
|
||||
|
@ -73,4 +73,5 @@ public class EntrysDataSignupController {
|
||||
userService.create(toEntity(user));
|
||||
return Constants.REDIRECT_VIEW + Constants.LOGIN_URL + "?signup";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ import jakarta.persistence.Table;
|
||||
public class EntrysDataEntity extends BaseEntity {
|
||||
@Column(nullable = false, unique = true, length = 30)
|
||||
private String login;
|
||||
@Column(nullable = false, length = 60)
|
||||
@Column(nullable = false, length = 25)
|
||||
private String password;
|
||||
private EntrysDataRole role;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "departmentId", nullable = true)
|
||||
@JoinColumn(name = "departmentId", nullable = false)
|
||||
private DepartmentEntity department;
|
||||
|
||||
public EntrysDataEntity() {
|
||||
|
@ -16,40 +16,35 @@
|
||||
<body class="h-100 d-flex flex-column">
|
||||
<nav class="navbar navbar-expand-md my-navbar" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/news">
|
||||
<a class="navbar-brand" href="/">
|
||||
<i></i>
|
||||
UlSTU
|
||||
</a>
|
||||
<th:block sec:authorize="isAuthenticated()" th:with="userName=${#authentication.name}">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar"
|
||||
aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="main-navbar">
|
||||
<ul class="navbar-nav me-auto link" th:with="activeLink=${#objects.nullSafe(servletPath, '')}">
|
||||
<a class="nav-link" href="/news"
|
||||
th:classappend="${activeLink.startsWith('/news') ? 'active' : ''}">
|
||||
Новости
|
||||
</a>
|
||||
<a class="nav-link" href="/directions"
|
||||
th:classappend="${activeLink.startsWith('/directions') ? 'active' : ''}">
|
||||
Направления
|
||||
</a>
|
||||
<th:block sec:authorize="hasRole('ADMIN')">
|
||||
<a class="nav-link" href="/admin/departments"
|
||||
th:classappend="${activeLink.startsWith('/departments') ? 'active' : ''}">
|
||||
Кафедры
|
||||
</a>
|
||||
<a class="nav-link" href="/admin/users"
|
||||
th:classappend="${activeLink.startsWith('/users') ? 'active' : ''}">
|
||||
Пользователи
|
||||
</a>
|
||||
</th:block>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
</ul>
|
||||
</div>
|
||||
</th:block>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar"
|
||||
aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="main-navbar">
|
||||
<ul class="navbar-nav me-auto link" th:with="activeLink=${#objects.nullSafe(servletPath, '')}">
|
||||
<a class="nav-link" href="/news" th:classappend="${activeLink.startsWith('/news') ? 'active' : ''}">
|
||||
Новости
|
||||
</a>
|
||||
<a class="nav-link" href="/directions"
|
||||
th:classappend="${activeLink.startsWith('/directions') ? 'active' : ''}">
|
||||
Направления
|
||||
</a>
|
||||
<a class="nav-link" href="/departments"
|
||||
th:classappend="${activeLink.startsWith('/departments') ? 'active' : ''}">
|
||||
Кафедры
|
||||
</a>
|
||||
<a class="nav-link" href="/users"
|
||||
th:classappend="${activeLink.startsWith('/users') ? 'active' : ''}">
|
||||
Пользователи
|
||||
</a>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<main class="container-fluid p-2" layout:fragment="content">
|
||||
|
@ -43,7 +43,7 @@
|
||||
<h2 th:case="0">Данные отсутствуют</h2>
|
||||
<th:block th:case="*">
|
||||
<div>
|
||||
<a th:href="@{/admin/news/edit/(page=${page})}" class="btn btn-danger mt-1">Добавить новость</a>
|
||||
<a th:href="@{/news/edit/(page=${page})}" class="btn btn-danger mt-1">Добавить новость</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col mt-4 colStyle" th:each="newItem : ${items}">
|
||||
@ -56,12 +56,12 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="forButtons">
|
||||
<form th:action="@{/admin/news/edit/{id}(id=${newItem.id})}" method="get">
|
||||
<form th:action="@{/news/edit/{id}(id=${newItem.id})}" method="get">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link">
|
||||
<i class="fa fa-edit">Изменить</i>
|
||||
</form>
|
||||
<form th:action="@{/admin/news/delete/{id}(id=${newItem.id})}" method="post">
|
||||
<form th:action="@{/news/delete/{id}(id=${newItem.id})}" method="post">
|
||||
<input type="hidden" th:name="page" th:value="${page}">
|
||||
<button type="submit" class="btn btn-link button-link"
|
||||
onclick="return confirm('Вы уверены?')">
|
||||
|
Loading…
Reference in New Issue
Block a user