<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>新增用户</title>
    <th:block th:replace="~{/backstage/common_resources::common_css}"></th:block>
    <th:block th:replace="~{/backstage/common_resources::common_js}"></th:block>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div class="wrapper">
    <!-- 引入页面头部 -->
    <header th:replace="~{/backstage/common_header::header}"></header>
    <!-- 导航侧栏 -->
    <aside th:replace="~{/backstage/common_aside::aside}"></aside>
    <!-- 内容区域 -->
    <div class="content-wrapper">

        <!-- 内容头部 -->
        <section class="content-header">
            <h1>
                用户管理
                <small>新增用户</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="@{/backstage/index}"><i class="fa fa-dashboard"></i> 首页</a></li>
                <li><a href="@{/backstage/admin/all}">用户管理</a></li>
                <li class="active">新增用户</li>
            </ol>
        </section>
        <!-- 内容头部 /-->

        <!-- 正文区域 -->
        <section class="content">

            <!-- .box-body -->
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">列表</h3>
                </div>

                <div class="box-body">

                    <!-- 数据表格 -->
                    <div class="table-box">
                        <form th:action="@{/backstage/admin/updateRole}">
                            <input type="hidden" name="aid" th:value="${aid}"/>
                            <!--数据列表-->
                            <table id="dataList" class="table table-bordered table-striped table-hover dataTable">
                                <thead>
                                <tr>
                                    <th class="" style="padding-right:0px;">
                                        <input id="selall" type="checkbox" class="icheckbox_square-blue">
                                    </th>
                                    <th>角色名</th>
                                    <th>角色描述</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="role:${roles}">
                                    <td th:if="${role.adminHas}">
                                        <input name="ids" type="checkbox" th:value="${role.rid}"
                                               class="icheckbox_square-blue" checked>
                                    </td>
                                    <td th:if="${!role.adminHas}">
                                        <input name="ids" type="checkbox" th:value="${role.rid}"
                                               class="icheckbox_square-blue">
                                    </td>
                                    <td th:text="${role.roleName}"></td>
                                    <td th:text="${role.roleDesc}"></td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="box-title text-center">
                                <button type="submit" class="btn bg-maroon">保存</button>
                                <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
                            </div>
                        </form>
                        <!--数据列表/-->
                    </div>
                    <!-- 数据表格 /-->
                </div>

            </div>

        </section>
        <!-- 正文区域 /-->

    </div>
    <!-- 底部导航 -->
    <footer th:replace="~{/backstage/common_footer::footer}"></footer>
</div>
</body>

</html>