<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>分类管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script src="./layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加用户','/admin/tags/input',600,400)">
                        <i class="layui-icon"></i>添加
                    </button>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th></th>
                            <th>名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="tags,iterStat : ${pageInfo.list}">
                            <td th:text="${iterStat.count}">1</td>
                            <td th:text="${tags.name}" style="width: 60%">摸鱼方法</td>
                            <td>
                                <a title="编辑" th:href="@{/admin/tags/{id}/input(id=${tags.id})}"  >
                                    <button class="layui-btn layui-btn layui-btn-xs"  >
                                        <i class="layui-icon">&#xe642;</i>编辑
                                    </button>
                                </a>
                                <a title="删除" onclick="return member_del()" th:href="@{/admin/tags/{id}/delete(id=${tags.id})}">
                                    <button class="layui-btn-danger layui-btn layui-btn-xs" href="javascript:;">
                                        <i class="layui-icon">&#xe640;</i>删除
                                    </button>
                                </a>
                            </td>

                        </tr>
                        </tbody>

                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                            <a class="num" th:href="@{/admin/tags}">首页</a>
                            <a class="prev"
                               th:href="@{/admin/tags(pagenum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">&lt;&lt;</a>
                            <a class="num" th:text="${page}">1</a>
                            <a class="next"
                               th:href="@{/admin/tags(pagenum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">&gt;&gt;</a>
                            <a class="num" th:href="@{/admin/tags(pagenum=${pageInfo.pages})}">尾页</a>
                        </div>

                    </div>


                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>layui.use(['laydate', 'form'],
    function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

function member_del() {

    var flag = false;
    if (confirm("您确定删除吗?")){
        flag = true;
    }else {
        flag = false;
    }
    return flag;
}
</script>

</html>