<!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-template-add"> 
 | 
            <div class="form-group">     
 | 
                <label class="col-sm-3 control-label">模板代码:</label> 
 | 
                <div class="col-sm-8"> 
 | 
                    <input name="templateCode" class="form-control" required type="text"> 
 | 
                </div> 
 | 
            </div> 
 | 
            <div class="form-group">     
 | 
                <label class="col-sm-3 control-label">模板分类:</label> 
 | 
                <div class="col-sm-8"> 
 | 
                    <div class="radio-box" th:each="dict : ${@dict.getType('template_type')}"> 
 | 
                        <input type="radio" th:id="${'templateType_' + dict.dictCode}" name="templateType" th:value="${dict.dictValue}" th:checked="${dict.default}"> 
 | 
                        <label th:for="${'templateType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> 
 | 
                    </div> 
 | 
                </div> 
 | 
            </div> 
 | 
            <div class="form-group">     
 | 
                <label class="col-sm-3 control-label">模板名称:</label> 
 | 
                <div class="col-sm-8"> 
 | 
                    <input name="templateName" class="form-control" required type="text"> 
 | 
                </div> 
 | 
            </div> 
 | 
            <div class="form-group">     
 | 
                <label class="col-sm-3 control-label">模板内容:</label> 
 | 
                <div class="col-sm-8"> 
 | 
                    <script id="editor" name="templateContent" type="text/plain" ></script> 
 | 
                </div> 
 | 
            </div> 
 | 
        </form> 
 | 
    </div> 
 | 
    <th:block th:include="include :: footer" /> 
 | 
    <th:block th:include="include :: ueditor" /> 
 | 
    <script type="text/javascript"> 
 | 
        var ue = UE.getEditor('editor'); 
 | 
        function getContent() { 
 | 
            return UE.getEditor('editor').getContent(); 
 | 
        } 
 | 
        function getContentTxt() { 
 | 
            return UE.getEditor('editor').getContentTxt(); 
 | 
        } 
 | 
    </script> 
 | 
  
 | 
    <script type="text/javascript"> 
 | 
        var prefix = ctx + "cms/template" 
 | 
        $("#form-template-add").validate({ 
 | 
            focusCleanup: true 
 | 
        }); 
 | 
  
 | 
        function submitHandler() { 
 | 
            if ($.validate.form()) { 
 | 
                var c = getContentTxt(); 
 | 
                if (c == '' || c.length == 0) { 
 | 
                    Fast.msg_error("请输入模板内容!"); 
 | 
                    return; 
 | 
                } 
 | 
                $.operate.save(prefix + "/add", $('#form-template-add').serialize()); 
 | 
            } 
 | 
        } 
 | 
        $(function(){ 
 | 
            $("#editor").css("height","380px"); 
 | 
        }) 
 | 
    </script> 
 | 
</body> 
 | 
</html> 
 |