mirror of https://github.com/unluckynike/beizhai
分类管理🤗
This commit is contained in:
parent
3735bf61b1
commit
96d6041313
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: jakarta.validation:jakarta.validation-api:2.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar:///Library/maven-repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar:///Library/maven-repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar:///Library/maven-repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: org.hibernate.validator:hibernate-validator:6.1.7.Final">
|
||||
<CLASSES>
|
||||
<root url="jar:///Library/maven-repository/org/hibernate/validator/hibernate-validator/6.1.7.Final/hibernate-validator-6.1.7.Final.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar:///Library/maven-repository/org/hibernate/validator/hibernate-validator/6.1.7.Final/hibernate-validator-6.1.7.Final-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar:///Library/maven-repository/org/hibernate/validator/hibernate-validator/6.1.7.Final/hibernate-validator-6.1.7.Final-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,13 @@
|
|||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework.boot:spring-boot-starter-validation:2.4.2">
|
||||
<CLASSES>
|
||||
<root url="jar:///Library/maven-repository/org/springframework/boot/spring-boot-starter-validation/2.4.2/spring-boot-starter-validation-2.4.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar:///Library/maven-repository/org/springframework/boot/spring-boot-starter-validation/2.4.2/spring-boot-starter-validation-2.4.2-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar:///Library/maven-repository/org/springframework/boot/spring-boot-starter-validation/2.4.2/spring-boot-starter-validation-2.4.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
|
@ -96,7 +96,6 @@
|
|||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.41" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.41" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.3" level="project" />
|
||||
|
@ -137,5 +136,9 @@
|
|||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.3.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.1.7.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
</component>
|
||||
</module>
|
8214
log/blog-pro.log
8214
log/blog-pro.log
File diff suppressed because it is too large
Load Diff
5
pom.xml
5
pom.xml
|
@ -68,6 +68,11 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Arrays;
|
|||
public class LogAspect {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
//申明切面 所有请求
|
||||
//声明切面 所有请求
|
||||
@Pointcut("execution(* com.hailin.beizhai.web.*.*(..))")
|
||||
public void log() {
|
||||
|
||||
|
|
|
@ -4,4 +4,6 @@ import com.hailin.beizhai.po.Type;
|
|||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface TypeRepository extends JpaRepository<Type,Long> {
|
||||
|
||||
Type findByName(String name);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.hailin.beizhai.po;
|
|||
@Description: 分类
|
||||
*/
|
||||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -18,6 +19,7 @@ public class Type {
|
|||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
@NotBlank(message="分类名称不能为空")//后端校验
|
||||
private String name;
|
||||
|
||||
@OneToMany(mappedBy="type")
|
||||
|
|
|
@ -10,6 +10,8 @@ public interface TypeService {
|
|||
|
||||
Type getType(Long id);
|
||||
|
||||
Type getTypeByName(String name);
|
||||
|
||||
Page<Type> listType(Pageable pageable);//分页
|
||||
|
||||
Type updateType(Long id,Type type);
|
||||
|
|
|
@ -35,6 +35,12 @@ public class TypeServiceImpl implements TypeService{
|
|||
return typeRepository.findById(id).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getTypeByName(String name) {
|
||||
System.out.println("111"+typeRepository.findByName(name));
|
||||
return typeRepository.findByName(name);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Page<Type> listType(Pageable pageable) {//分页
|
||||
|
|
|
@ -8,9 +8,15 @@ import org.springframework.data.domain.Sort;
|
|||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import javax.jws.WebParam;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/*
|
||||
@Name: TypeController
|
||||
|
@ -34,20 +40,61 @@ public class TypeController {
|
|||
}
|
||||
|
||||
@GetMapping("/types/input")
|
||||
public String input(){
|
||||
public String input(Model model) {
|
||||
model.addAttribute("type", new Type());
|
||||
return "admin/types-input";
|
||||
}
|
||||
|
||||
@PostMapping("/types")
|
||||
public String post(Type type){
|
||||
System.out.println("post");
|
||||
Type t=typeService.saveType(type);
|
||||
if (t==null){
|
||||
//
|
||||
}else{
|
||||
//
|
||||
}
|
||||
@GetMapping("/types/{id}/input")
|
||||
public String editInput(@PathVariable Long id, Model model) {
|
||||
System.out.println("editinput ");
|
||||
model.addAttribute("type", typeService.getType(id));
|
||||
return "admin/types-input";
|
||||
}
|
||||
|
||||
//编辑
|
||||
@PostMapping("/types/{id}")
|
||||
public String editPost(@PathVariable Long id, RedirectAttributes attributes, @Valid Type type, BindingResult result) {//type binding 相邻
|
||||
Type type1 = typeService.getTypeByName(type.getName());
|
||||
if (type1 != null) {//重复校验
|
||||
result.rejectValue("name", "nameError", "该分类已经存在");
|
||||
}
|
||||
if (result.hasErrors()) {
|
||||
return "admin/types-input";
|
||||
}
|
||||
Type t = typeService.updateType(id, type);
|
||||
if (t == null) {
|
||||
attributes.addFlashAttribute("message", "更新失败");
|
||||
} else {
|
||||
attributes.addFlashAttribute("message", "更新成功");
|
||||
}
|
||||
return "redirect:/admin/types";
|
||||
}
|
||||
|
||||
//新增
|
||||
@PostMapping("/types")
|
||||
public String post(RedirectAttributes attributes, @Valid Type type, BindingResult result) {
|
||||
Type type1 = typeService.getTypeByName(type.getName());
|
||||
if (type1 != null) {//重复校验
|
||||
result.rejectValue("name", "nameError", "该分类已经存在");
|
||||
}
|
||||
if (result.hasErrors()) {
|
||||
return "admin/types-input";
|
||||
}
|
||||
Type t = typeService.saveType(type);
|
||||
if (t == null) {
|
||||
attributes.addFlashAttribute("message", "新增失败");
|
||||
} else {
|
||||
attributes.addFlashAttribute("message", "新增成功");
|
||||
}
|
||||
return "redirect:/admin/types";
|
||||
}
|
||||
|
||||
//删除
|
||||
@GetMapping("/types/{id}/delete")
|
||||
public String delete(@PathVariable Long id, RedirectAttributes attributes) {
|
||||
typeService.deleteType(id);
|
||||
attributes.addFlashAttribute("message", "删除成功");
|
||||
return "redirect:/admin/types";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title th:replace="${title}">博客详情</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../static/css/typo.css" th:href="@{css/typo.css}">
|
||||
<link rel="stylesheet" href="../static/css/animate.css" th:href="@{css/animate.css}">
|
||||
<link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{lib/prism.css}">
|
||||
<link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{lib/typo.css}">
|
||||
<link rel="stylesheet" href="../static/css/me.css" th:href="@{css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css" th:href="@{/lib/editormd/css/editormd.min.css}">
|
||||
<link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>分类新增</title>
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--导航-->
|
||||
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
|
||||
<nav th:replace="admin/_fragments :: menu(1)"class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
|
||||
<div class="ui container">
|
||||
<div class="ui inverted secondary stackable menu">
|
||||
<h2 class="ui teal header item">管理后台</h2>
|
||||
|
@ -39,8 +38,8 @@
|
|||
<div class="ui attached pointing menu">
|
||||
<div class="ui container">
|
||||
<div class="right menu">
|
||||
<a href="#" class="teal active item">发布</a>
|
||||
<a href="#" class="item">列表</a>
|
||||
<a href="#" th:href="@{/admin/types/input}" class="active item">新增</a>
|
||||
<a href="#" th:href="@{/admin/types}" class="teal item">列表</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -48,15 +47,23 @@
|
|||
<!--中间内容-->
|
||||
<div class="m-container-small m-padded-tb-big">
|
||||
<div class="ui container">
|
||||
<form action="#" method="post" th:action="@{/admin/types}" class="ui form">
|
||||
<div class="field">
|
||||
<form action="#" method="post" th:object="${type}" th:action="*{id}==null ? @{/admin/types} : @{/admin/types/{id}(id=*{id})}" class="ui form">
|
||||
<input type="hidden" name="id" th:value="*{id}">
|
||||
<div class="required field">
|
||||
<div class="ui left labeled input">
|
||||
<label class="ui teal basic label">名称</label>
|
||||
<input type="text" name="name" placeholder="分类名称">
|
||||
<input type="text" name="name" placeholder="分类名称" th:value="*{name}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui error message"></div>
|
||||
<!--/*/
|
||||
<div class="ui negative message" th:if="${#fields.hasErrors('name')}" >
|
||||
<i class="close icon"></i>
|
||||
<div class="header">验证失败</div>
|
||||
<p th:errors="*{name}">提交信息不符合规则</p>
|
||||
</div>
|
||||
/*/-->
|
||||
<div class="ui right aligned container">
|
||||
<button type="button" class="ui button" onclick="window.history.go(-1)">返回</button>
|
||||
<button class="ui teal submit button">提交</button>
|
||||
|
@ -97,8 +104,8 @@
|
|||
<div class="three wide column">
|
||||
<h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
|
||||
<div class="ui inverted link list">
|
||||
<a href="#" class="item m-text-thin">Email:lirenmi@163.com</a>
|
||||
<a href="#" class="item m-text-thin">QQ:865729312</a>
|
||||
<a href="#" class="item m-text-thin"></a>
|
||||
<a href="#" class="item m-text-thin"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="seven wide column">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html >
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="_fragments ::head(~{::title})">
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>分类</title>
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -16,7 +16,11 @@
|
|||
<!--中间内容-->
|
||||
<div class="m-container-small m-padded-tb-big">
|
||||
<div class="ui container">
|
||||
|
||||
<div class="ui success message" th:unless="${#strings.isEmpty(message)}">
|
||||
<i class="close icon"></i>
|
||||
<div class="header">提示:</div>
|
||||
<p th:text="${message}">恭喜,操作成功!</p>
|
||||
</div>
|
||||
<table class="ui celled table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -31,7 +35,7 @@
|
|||
<td th:text="${type.name}">刻意练习清单</td>
|
||||
<td>
|
||||
<a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini teal basic button">编辑</a>
|
||||
<a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini red basic button">删除</a>
|
||||
<a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red basic button">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -65,5 +69,23 @@
|
|||
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
|
||||
<!--/*/</th:block>/*/-->
|
||||
|
||||
<script>
|
||||
$('.menu.toggle').click(function () {
|
||||
$('.m-item').toggleClass('m-mobile-hide');
|
||||
});
|
||||
|
||||
$('.ui.dropdown').dropdown({
|
||||
on : 'hover'
|
||||
});
|
||||
|
||||
//消息隐藏
|
||||
$('.message .close')
|
||||
.on("click",function (){
|
||||
$(this)
|
||||
.closest('.message')
|
||||
.transition('fade');
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -5,11 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title th:replace="${title}">博客详情</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../static/css/typo.css" th:href="@{css/typo.css}">
|
||||
<link rel="stylesheet" href="../static/css/animate.css" th:href="@{css/animate.css}">
|
||||
<link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{lib/prism.css}">
|
||||
<link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{lib/typo.css}">
|
||||
<link rel="stylesheet" href="../static/css/me.css" th:href="@{css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css" th:href="@{/lib/editormd/css/editormd.min.css}">
|
||||
<link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>分类新增</title>
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/lib/editormd/css/editormd.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--导航-->
|
||||
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
|
||||
<nav th:replace="admin/_fragments :: menu(1)"class="ui inverted attached segment m-padded-tb-mini m-shadow-small" >
|
||||
<div class="ui container">
|
||||
<div class="ui inverted secondary stackable menu">
|
||||
<h2 class="ui teal header item">管理后台</h2>
|
||||
|
@ -39,8 +38,8 @@
|
|||
<div class="ui attached pointing menu">
|
||||
<div class="ui container">
|
||||
<div class="right menu">
|
||||
<a href="#" class="teal active item">发布</a>
|
||||
<a href="#" class="item">列表</a>
|
||||
<a href="#" th:href="@{/admin/types/input}" class="active item">新增</a>
|
||||
<a href="#" th:href="@{/admin/types}" class="teal item">列表</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -48,15 +47,23 @@
|
|||
<!--中间内容-->
|
||||
<div class="m-container-small m-padded-tb-big">
|
||||
<div class="ui container">
|
||||
<form action="#" method="post" th:action="@{/admin/types}" class="ui form">
|
||||
<div class="field">
|
||||
<form action="#" method="post" th:object="${type}" th:action="*{id}==null ? @{/admin/types} : @{/admin/types/{id}(id=*{id})}" class="ui form">
|
||||
<input type="hidden" name="id" th:value="*{id}">
|
||||
<div class="required field">
|
||||
<div class="ui left labeled input">
|
||||
<label class="ui teal basic label">名称</label>
|
||||
<input type="text" name="name" placeholder="分类名称">
|
||||
<input type="text" name="name" placeholder="分类名称" th:value="*{name}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui error message"></div>
|
||||
<!--/*/
|
||||
<div class="ui negative message" th:if="${#fields.hasErrors('name')}" >
|
||||
<i class="close icon"></i>
|
||||
<div class="header">验证失败</div>
|
||||
<p th:errors="*{name}">提交信息不符合规则</p>
|
||||
</div>
|
||||
/*/-->
|
||||
<div class="ui right aligned container">
|
||||
<button type="button" class="ui button" onclick="window.history.go(-1)">返回</button>
|
||||
<button class="ui teal submit button">提交</button>
|
||||
|
@ -97,8 +104,8 @@
|
|||
<div class="three wide column">
|
||||
<h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
|
||||
<div class="ui inverted link list">
|
||||
<a href="#" class="item m-text-thin">Email:lirenmi@163.com</a>
|
||||
<a href="#" class="item m-text-thin">QQ:865729312</a>
|
||||
<a href="#" class="item m-text-thin"></a>
|
||||
<a href="#" class="item m-text-thin"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="seven wide column">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html >
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="_fragments ::head(~{::title})">
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||
<head th:replace="admin/_fragments :: head(~{::title})">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>分类</title>
|
||||
<title>博客管理</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
|
||||
<link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
|
||||
<link rel="stylesheet" href="../../static/css/me.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -16,7 +16,11 @@
|
|||
<!--中间内容-->
|
||||
<div class="m-container-small m-padded-tb-big">
|
||||
<div class="ui container">
|
||||
|
||||
<div class="ui success message" th:unless="${#strings.isEmpty(message)}">
|
||||
<i class="close icon"></i>
|
||||
<div class="header">提示:</div>
|
||||
<p th:text="${message}">恭喜,操作成功!</p>
|
||||
</div>
|
||||
<table class="ui celled table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -31,7 +35,7 @@
|
|||
<td th:text="${type.name}">刻意练习清单</td>
|
||||
<td>
|
||||
<a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini teal basic button">编辑</a>
|
||||
<a href="#" th:href="@{/admin/types/{id}/input(id=${type.id})}" class="ui mini red basic button">删除</a>
|
||||
<a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red basic button">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -65,5 +69,23 @@
|
|||
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
|
||||
<!--/*/</th:block>/*/-->
|
||||
|
||||
<script>
|
||||
$('.menu.toggle').click(function () {
|
||||
$('.m-item').toggleClass('m-mobile-hide');
|
||||
});
|
||||
|
||||
$('.ui.dropdown').dropdown({
|
||||
on : 'hover'
|
||||
});
|
||||
|
||||
//消息隐藏
|
||||
$('.message .close')
|
||||
.on("click",function (){
|
||||
$(this)
|
||||
.closest('.message')
|
||||
.transition('fade');
|
||||
})
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue