<!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}" action="/admin/game/add" 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" required/></td>
                    </tr>
                    <tr>
                        <td>游戏类型</td>
                        <td>
                            <select path="categoryId" title="categoryId">
                                <option th:each="category:${categories}" th:value="${category.id}" th:text="${category.name}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>游戏所在平台</td>
                        <td>
                            <select path="platformId" title="platformId">
                                <option th:each="platform:${platforms}" th:value="${platform.id}" th:text="${platform.name}"></option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>游戏售价</td>
                        <td><input type="text" name="price" required/></td>
                    </tr>
                    <tr>
                        <td>上架时间</td>
                        <td><input type="date" name="pubdate" 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><img id="picture_1" th:src="${session.user.header.src}" class="img-thumbnail"/></td>
                        <td><img id="picture_2" th:src="${session.user.header.src}" class="img-thumbnail"/></td>
                        <td><img id="picture_3" th:src="${session.user.header.src}" class="img-thumbnail"/></td>
                    </tr>
                    <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" onclick="uploadFile('#picture1','#picture_1')"
                                    class="btn1 btn-1 btn-1b">上传图片
                            </button>
                        </td>
                        <td>
                            <button type="button" onclick="uploadFile('#picture2','#picture_2')"
                                    class="btn1 btn-1 btn-1b">上传图片
                            </button>
                        </td>
                        <td>
                            <button type="button" onclick="uploadFile('#picture3','#picture_3')"
                                    class="btn1 btn-1 btn-1b">上传图片
                            </button>
                        </td>
                    </tr>
                </table>
                <div class="clearfix"></div>
            </div>
        </form>

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

    </div>
</div>

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