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());
|
.anyRequest().authenticated());
|
||||||
|
|
||||||
httpSecurity.formLogin(formLogin -> formLogin
|
httpSecurity.formLogin(formLogin -> formLogin
|
||||||
.loginPage(Constants.LOGIN_URL)
|
.loginPage(Constants.LOGIN_URL));
|
||||||
.defaultSuccessUrl("/news", true));
|
|
||||||
|
|
||||||
httpSecurity.rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret"));
|
httpSecurity.rememberMe(rememberMe -> rememberMe.key("uniqueAndSecret"));
|
||||||
|
|
||||||
|
@ -73,4 +73,5 @@ public class EntrysDataSignupController {
|
|||||||
userService.create(toEntity(user));
|
userService.create(toEntity(user));
|
||||||
return Constants.REDIRECT_VIEW + Constants.LOGIN_URL + "?signup";
|
return Constants.REDIRECT_VIEW + Constants.LOGIN_URL + "?signup";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,11 @@ import jakarta.persistence.Table;
|
|||||||
public class EntrysDataEntity extends BaseEntity {
|
public class EntrysDataEntity extends BaseEntity {
|
||||||
@Column(nullable = false, unique = true, length = 30)
|
@Column(nullable = false, unique = true, length = 30)
|
||||||
private String login;
|
private String login;
|
||||||
@Column(nullable = false, length = 60)
|
@Column(nullable = false, length = 25)
|
||||||
private String password;
|
private String password;
|
||||||
private EntrysDataRole role;
|
private EntrysDataRole role;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "departmentId", nullable = true)
|
@JoinColumn(name = "departmentId", nullable = false)
|
||||||
private DepartmentEntity department;
|
private DepartmentEntity department;
|
||||||
|
|
||||||
public EntrysDataEntity() {
|
public EntrysDataEntity() {
|
||||||
|
@ -16,40 +16,35 @@
|
|||||||
<body class="h-100 d-flex flex-column">
|
<body class="h-100 d-flex flex-column">
|
||||||
<nav class="navbar navbar-expand-md my-navbar" data-bs-theme="dark">
|
<nav class="navbar navbar-expand-md my-navbar" data-bs-theme="dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="/news">
|
<a class="navbar-brand" href="/">
|
||||||
<i></i>
|
<i></i>
|
||||||
UlSTU
|
UlSTU
|
||||||
</a>
|
</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"
|
||||||
<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">
|
||||||
aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
|
<span class="navbar-toggler-icon"></span>
|
||||||
<span class="navbar-toggler-icon"></span>
|
</button>
|
||||||
</button>
|
<div class="collapse navbar-collapse" id="main-navbar">
|
||||||
<div class="collapse navbar-collapse" id="main-navbar">
|
<ul class="navbar-nav me-auto link" th:with="activeLink=${#objects.nullSafe(servletPath, '')}">
|
||||||
<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 class="nav-link" href="/news"
|
Новости
|
||||||
th:classappend="${activeLink.startsWith('/news') ? 'active' : ''}">
|
</a>
|
||||||
Новости
|
<a class="nav-link" href="/directions"
|
||||||
</a>
|
th:classappend="${activeLink.startsWith('/directions') ? 'active' : ''}">
|
||||||
<a class="nav-link" href="/directions"
|
Направления
|
||||||
th:classappend="${activeLink.startsWith('/directions') ? 'active' : ''}">
|
</a>
|
||||||
Направления
|
<a class="nav-link" href="/departments"
|
||||||
</a>
|
th:classappend="${activeLink.startsWith('/departments') ? 'active' : ''}">
|
||||||
<th:block sec:authorize="hasRole('ADMIN')">
|
Кафедры
|
||||||
<a class="nav-link" href="/admin/departments"
|
</a>
|
||||||
th:classappend="${activeLink.startsWith('/departments') ? 'active' : ''}">
|
<a class="nav-link" href="/users"
|
||||||
Кафедры
|
th:classappend="${activeLink.startsWith('/users') ? 'active' : ''}">
|
||||||
</a>
|
Пользователи
|
||||||
<a class="nav-link" href="/admin/users"
|
</a>
|
||||||
th:classappend="${activeLink.startsWith('/users') ? 'active' : ''}">
|
</ul>
|
||||||
Пользователи
|
<ul class="navbar-nav">
|
||||||
</a>
|
</ul>
|
||||||
</th:block>
|
</div>
|
||||||
</ul>
|
|
||||||
<ul class="navbar-nav">
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</th:block>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<main class="container-fluid p-2" layout:fragment="content">
|
<main class="container-fluid p-2" layout:fragment="content">
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
<h2 th:case="0">Данные отсутствуют</h2>
|
<h2 th:case="0">Данные отсутствуют</h2>
|
||||||
<th:block th:case="*">
|
<th:block th:case="*">
|
||||||
<div>
|
<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>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col mt-4 colStyle" th:each="newItem : ${items}">
|
<div class="col mt-4 colStyle" th:each="newItem : ${items}">
|
||||||
@ -56,12 +56,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="forButtons">
|
<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}">
|
<input type="hidden" th:name="page" th:value="${page}">
|
||||||
<button type="submit" class="btn btn-link button-link">
|
<button type="submit" class="btn btn-link button-link">
|
||||||
<i class="fa fa-edit">Изменить</i>
|
<i class="fa fa-edit">Изменить</i>
|
||||||
</form>
|
</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}">
|
<input type="hidden" th:name="page" th:value="${page}">
|
||||||
<button type="submit" class="btn btn-link button-link"
|
<button type="submit" class="btn btn-link button-link"
|
||||||
onclick="return confirm('Вы уверены?')">
|
onclick="return confirm('Вы уверены?')">
|
||||||
|
Loading…
Reference in New Issue
Block a user