<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="ch">
<head th:replace="model/head :: commonHead('修改游戏')">
</head>
<body>
<div th:replace="model/banner :: banner"></div>

<div class="content">
    <div class="container">
        <!--信息-->
        <div class="col-lg-3 content-left" role="alert">
            <span class="label label-success" th:text="${session.user.messages.peekFirst()}"></span>
        </div>
        <div class="clearfix"></div>
        <!--游戏信息-->
        <form th:object="${game}" th:action="@{/admin/game/__${game.id}__/update}" method="post" enctype="multipart/form-data">
            <div class="col-lg-3 content-left">

                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th colspan="2">游戏信息</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>游戏名称:</td>
                        <td><input name="name" th:value="${game.name}" required/></td>
                    </tr>
                    <tr>
                        <td>游戏类型</td>
                        <td>
                            <select path="categoryId">
                                <option th:value="${game.category.id}" th:text="${game.category.name}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>游戏所在平台</td>
                        <td>
                            <select path="platformId">
                                <option th:value="${game.platform.id}" th:text="${game.platform.name}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>游戏售价</td>
                        <td><input type="text" name="price" th:value="${game.price}" required/></td>
                    </tr>
                    <tr>
                        <td>上架时间</td>
                        <td><input type="datetime" name="pubdate" th:value="${game.pubdate.toLocaleString()}" required/></td>
                    </tr>
                    <tr>
                        <td>游戏描述</td>
                        <td class="contact-form"><textarea path="description"></textarea></td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <button type="submit" class="btn1 btn-1 btn-1b">提交</button>
                        </td>
                    </tr>
                    </tbody>
                </table>

                <div class="clearfix"></div>
                <div class="list-group list-group-alternate" style="margin: 20px auto;">
                    <a href="/admin/category/add" class="list-group-item">
                        <span class="badge badge-danger"></span>
                        <i class="ti ti-eye"></i> 增加游戏分类
                    </a>
                    <a href="/admin/platform/add" class="list-group-item">
                        <span class="badge badge-success"></span>
                        <i class="ti ti-eye"></i> 增加游戏平台
                    </a>
                    <a href="/admin/game/" class="list-group-item">
                        <span class="badge badge-primary"></span>
                        <i class="ti ti-email"></i>返回游戏管理页面
                    </a>
                    <a href="#" class="list-group-item">
                        <span class="badge" th:text="${session.user.messages.size()}"></span>
                        <i class="ti ti-comments"></i>消息
                    </a>
                </div>
            </div>

            <div class="col-lg-8 colcontent-right">
                <table class="table table-responsive">
                    <thead>
                    <tr>
                        <th colspan="3">游戏截图:至少3个图片</th>
                    </tr>
                    </thead>
                    <tr>
                        <td><input type="file" class="input-group-sm" name="files" id="picture1" required/></td>
                        <td><input type="file" class="input-group-sm" name="files" id="picture2" required/></td>
                        <td><input type="file" class="input-group-sm" name="files" id="picture3" required/></td>
                    </tr>
                    <tr>
                        <td>
                            <button type="button" class="btn1 btn-1 btn-1b">上传图片</button>
                        </td>
                        <td>
                            <button type="button" class="btn1 btn-1 btn-1b">上传图片</button>
                        </td>
                        <td>
                            <button type="button" class="btn1 btn-1 btn-1b">上传图片</button>
                        </td>
                    </tr>
                    <tr>
                        <td th:each="picture,count:${game.pictures}"><img th:src="${picture.src}" class="img-thumbnail" src="" /></td>
                    </tr>
                </table>
                <div class="clearfix"></div>
            </div>
        </form>

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

    </div>
</div>

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