#1 -- add admin page

This commit is contained in:
Anton Romanov 2022-03-09 11:27:16 +04:00
parent 5efcaa1a3c
commit 9c42cb677e
5 changed files with 23 additions and 1 deletions

View File

@ -36,9 +36,11 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name:'spring-boot-starter-data-jpa'
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J
implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect' implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect'
implementation group: 'org.springframework.boot', name:'spring-boot-starter-data-jpa' //implementation group: 'org.thymeleaf.extras', name: 'thymeleaf-extras-springsecurity5'
implementation group: 'com.h2database', name:'h2' implementation group: 'com.h2database', name:'h2'
implementation group: 'javax.xml.bind', name:'jaxb-api' implementation group: 'javax.xml.bind', name:'jaxb-api'
implementation group: 'org.javassist', name:'javassist' implementation group: 'org.javassist', name:'javassist'

Binary file not shown.

View File

@ -21,6 +21,7 @@ public class MvcConfiguration implements WebMvcConfigurer {
@Override @Override
public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/index"); registry.addViewController("/index");
registry.addViewController("/admin");
registry.addViewController("/editNews"); registry.addViewController("/editNews");
} }

View File

@ -0,0 +1,16 @@
<!--
~ Copyright (C) 2021 Anton Romanov - All Rights Reserved
~ You may use, distribute and modify this code, please write to: romanov73@gmail.com.
~
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<a href="/editNews/0" class="btn btn-outline-dark">
<i class="fa fa-plus-square" aria-hidden="true"> Добавить новость</i>
</a>
</div>
</html>

View File

@ -40,6 +40,9 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/news">Отчеты</a> <a class="nav-link" href="/news">Отчеты</a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="/admin">Администратору</a>
</li>
</ul> </ul>
</div> </div>
</nav> </nav>