<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商品分类列')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-type-edit" th:object="${goodsType}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="parentId" th:field="*{parentId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">类型名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <h4 class="form-header h4">属性字段</h4>
            <div class="row" th:each="attribute:*{goodsTypeAttributes}" >
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-sm-6 control-label"> 属性名：</label>
                        <div class="col-sm-6">
                            <input class="form-control" th:value="${attribute.attributeName}" maxlength="30" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="col-sm-6 control-label"> 排序：</label>
                        <div class="col-sm-6">
                            <input class="form-control" th:value="${attribute.sort}" maxlength="30" required>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/type";
        $("#form-type-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-type-edit').serialize());
            }
        }
    </script>
</body>
</html>