<! DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<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, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}" media="all" />
    <style type="text/css">
        .layui-form-item .layui-inline{ min-width:15%; float:left; margin-right:0 }
        .layui-form-item .role-box {
            position: relative;
        }
    </style>
</head>
<body class="childrenBody">
<form class="layui-form">
   <input name="id" type="hidden" th:value="${role.id}">
    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;margin-left: 10px;">
            <legend>角色名称(<span style="color:red">*</span>)</legend>
        </fieldset>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="width: 80%">
            <input type="text" class="layui-input" name="name" style="margin-top: 30px;" th:value="${role.name}" lay-verify="required" placeholder="请想一个角色名称">
        </div>
    </div>
    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;margin-left: 10px;">
            <legend>备注</legend>
        </fieldset>
    </div>
    <div class="layui-form-item layui-form-text">
        <div class="layui-input-block" style="width: 80%">
            <textarea placeholder="一些可有可无的备注罢了.." name="remarks" class="layui-textarea" th:text="${role.remarks}"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;margin-left: 10px;">
            <legend>请分配角色权限</legend>
        </fieldset>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <div class="layui-inline" th:each="menu : ${menuList}">
                <fieldset class="layui-elem-field">
                    <legend>
                        <input type="checkbox" th:title="${menu.name}" th:value="${menu.id}"
                               lay-filter="roleMenu" th:data-parentIds="${menu.parentIds}"
                               th:checked="${#strings.contains(menuIds,menu.id)} ?  checked "/>
                    </legend>
                    <div class="layui-field-box" th:include="/admin/role/menu::editMenuLi(${menu.children})">
                    </div>
                </fieldset>
            </div>
        </div>
    </div>

    <shiro:hasPermission name="sys:role:edit">
    <div class="layui-form-item" style="padding-left: 30%;">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="editRole">确认修改</button>
            <button class="layui-btn layui-btn-primary">放弃修改</button>
        </div>
    </div>
    </shiro:hasPermission>
</form>
<script type="text/javascript" th:src="@{/static/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/static/admin/js/role/roleEdit.js}"></script>
</body>
</html>