<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ch">
<head th:replace="model/head :: commonHead('修改用户信息')">
</head>
<body>
<div th:replace="model/js :: commonJs"></div>
<div th:replace="model/banner :: banner"></div>

<div class="content">

    <div class="container">
        <div>
            <form th:object="${user}" action="/user/details/update" enctype="multipart/form-data" method="post"
                  class="news-ltr" onsubmit="return NameNotExist">
                <div class="col-md-5 content-left">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th colspan="2">用户信息</th>
                        </tr>
                        </thead>
                    </table>
                    <div class="input-group input-group-lg">
                        <input type="number" name="id" th:value="${session.user.id}" hidden/>
                        <span class="input-group-addon" id="sizing-addon1">名字</span>
                        <input type="text" name="name" id="name" th:value="${session.user.name}"
                               onchange="checkName(this)" class="form-control" placeholder="Username"
                               aria-describedby="sizing-addon1">
                    </div>
                    <button type="submit" class="btn1 btn-1 btn-1b">保存</button>
                    <button class="btn1 btn-1 btn-1b">上传头像</button>
                    <div class="clearfix"></div>
                    <div class="alert alert-warning" role="alert">
                        <strong id="message" th:text="${message}"></strong>
                    </div>
                </div>
                <div class="col-md-6 content-right">
                    <table class="table table-responsive">
                        <thead>
                        <tr>
                            <th>用户头像</th>
                        </tr>
                        </thead>
                        <tr>
                            <td><img src="" th:src="${session.user.header.src}" class="img-thumbnail"/></td>
                        </tr>
                    </table>
                    <input type="file" name="headerFile">
                    <div class="clearfix"></div>
                </div>

            </form>
            <div class="clearfix"></div>
            <div class="clearfix"></div>
        </div>

        <div th:replace="model/footer :: footer"></div>
</body>
</html>