#include("_user_detail_layout.html")
#@user_detail_layout("role")
#define detail()

<style type="text/css">
    .switchery-item {
        padding-bottom: 10px;
    }

    .switchery-item .switchery-small {
        margin-top: -2px;
        margin-right: 10px;
    }
</style>

<div class="box-header ">
    <h3 class="box-title"></h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form class="form-horizontal" autocomplete="off" id="userForm" action="#(CPATH)/admin/user/doUpdateUserRoles">
    <input name="userId" type="hidden" value="#(user.id)">
    <div class="box-body ">

        <h4 class="page-first-header">用户角色</h4>

        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-6">
                #for(role : roles)
                <div class="switchery-item">
                    <input type="checkbox" class="switchery" name="roleId" value="#(role.id)"
                           #checkedIf(hasRole(user.id,role.id))>
                    #(role.name ??)
                    #if(role.isSuperAdmin())
                    - 超级管理员
                    #end ( <a href="#(CPATH)/admin/user/rolePermissions/#(role.id)">查看权限</a> )
                </div>
                #end
            </div>
        </div>


    </div>

    <div class="box-footer">
        <div class="col-sm-offset-2 col-sm-10 submit-block">
            <div class="box-submit">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>

</form>
#end

