功能实现2.分类管理。
此时登录和登出以及简单非法访问控制已经弄好了,但是上一章忘记放效果图了。这一章在这里放一下。此时登录没问题了,该做分类新增了。
由于之前后台页面只弄了博客管理博客新增后来做了登录和登录成功页。所以接下来按页面重构后的博客的头部来弄一个分类管理和分类新增,我已经将这两个页面弄完了,点击跳转什么的后面控制器来负责
types.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head th:replace="admin/_fragments :: head(~{::title})">
<title>分类管理</title>
</head>
<body>
<!--头部导航-->
<nav th:replace="admin/_fragments :: menu(2)"></nav>
<!--二级导航-->
<div class="ui inverted attached pointing menu">
<div class="ui container">
<div class="right menu">
<a href="#" th:href="@{/admin/types/post}" class="item">新增</a>
<a href="#" th:href="@{/admin/types}" class="active teal item">列表</a>
</div>
</div>
</div>
<!--页面主体-->
<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 列表-->
<table class="ui celled table">
<thead>
<tr>
<th>#</th>
<th>名称</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr th:each="type,iterStat : ${page.content}">
<td th:text="${iterStat.count}">1</td>
<td th:text="${type.name}">摸鱼!</td>
<td>
<a href="#" th:href="@{/admin/types/{id}/post(id=${type.id})}" class="ui mini teal button">编辑</a>
<a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red button">删除</a>
</td>
</tr>
</tbody>