<!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-article-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>作者：</label>
                <div class="col-sm-8">
                    <input name="articleAuthor" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>文章标题：</label>
                <div class="col-sm-8">
                    <input name="articleTitle" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>文章状态：</label>
                <div class="col-sm-8">
                    <select name="articleStatus" class="form-control m-b" th:with="type=${@dict.getType('cms_article_status')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">关键词：</label>
                <div class="col-sm-8">
                    <input name="articleKeywords" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>摘要：</label>
                <div class="col-sm-8">
                    <input name="articleDescription" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>封面 素材id：</label>
                <div class="col-sm-8">
                    <input name="materialId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>频道栏目ID：</label>
                <div class="col-sm-8">
                    <input name="categoryId" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>转载标志：</label>
                <div class="col-sm-8">
                    <select name="copyFlag" class="form-control m-b" th:with="type=${@dict.getType('cms_copy_flag')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">原始链接：</label>
                <div class="col-sm-8">
                    <input name="articleLink" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">标签：</label>
                <div class="col-sm-8">
                    <input name="articleTags" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>热点标志：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('cms_hot_flag')}">
                        <input type="radio" th:id="${'hotFlag_' + dict.dictCode}" name="hotFlag" th:value="${dict.dictValue}" th:checked="${dict.isDefault}" required>
                        <label th:for="${'hotFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>是否开启评论(1开启 0关闭）：</label>
                <div class="col-sm-8">
                    <select name="commentFlag" class="form-control m-b" th:with="type=${@dict.getType('cms_comment_flag')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>置顶标志(1置顶 0普通）：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('cms_top_flag')}">
                        <input type="radio" th:id="${'topFlag_' + dict.dictCode}" name="topFlag" th:value="${dict.dictValue}" th:checked="${dict.isDefault}" required>
                        <label th:for="${'topFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label"><span style="color: red; ">*</span>商户id：</label>
                <div class="col-sm-8">
                    <input name="merchantId" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "bussiness_cms/article"
        $("#form-article-add").validate({
            focusCleanup: true
        });

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