<!DOCTYPE html>
<html lang="zh">
<head>
    <@meta/>
	<title>资源-配置</title>
    <#include "admin/common/include_hplus.ftl">
    <#include "admin/common/include_form.ftl">
</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form class="form-horizontal" action="<@contextPath/>/sys/module/config/saveEntity" method="post">
                        <#if module.visiturlType == 1>
<#--                            <div class="form-group">-->
<#--                                <label class="col-sm-4 control-label">列表页启用SEO：</label>-->
<#--                                <div class="col-sm-8">-->
<#--                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listSeoEnable" value="1" <#if entity.listSeoEnable == 'true'>checked</#if>></label>-->
<#--                                </div>-->
<#--                            </div>-->
<#--                            <div class="form-group">-->
<#--                                <label class="col-sm-4 control-label">详情页启用SEO：</label>-->
<#--                                <div class="col-sm-8">-->
<#--                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageSeoEnable" value="1" <#if entity.pageSeoEnable == 'true'>checked</#if>></label>-->
<#--                                </div>-->
<#--                            </div>-->
<#--                            <div class="form-group">-->
<#--                                <label class="col-sm-4 control-label">详情页SEO允许单独定义：<br><span style="font-size: 10px;font-weight: normal;">(详情页SEO启用时有效)&nbsp;&nbsp;&nbsp;</span></label>-->
<#--                                <div class="col-sm-8">-->
<#--                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageSeoAllowDefine" value="1" <#if entity.pageSeoAllowDefine == 'true'>checked</#if>></label>-->
<#--                                </div>-->
<#--                            </div>-->
                            <div class="form-group">
                                <label class="col-sm-4 control-label">列表页文章类型：</label>
                                <div class="col-sm-8">
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listPageType" value="1">文章</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listPageType" value="2">URL</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listPageType" value="3">视频</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listPageType" value="4">图册</label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">列表页默认排序字段：</label>
                                <div class="col-sm-8">
                                    <div class="radio i-checks">
                                        <label><input type="radio" name="listSortField" value="publishTime" checked>发布时间</label>
                                        <label><input type="radio" name="listSortField" value="sort" <#if entity.listSortField == 'sort'>checked</#if>>排序</label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">列表页显示字段：</label>
                                <div class="col-sm-8">
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listField" value="previewUrl">预览图</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listField" value="categoryCode">文章分类</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listField" value="subtitle">副标题</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listField" value="introduction">简介</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="listField" value="sort">排序</label>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">详情页显示字段：</label>
                                <div class="col-sm-8">
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="previewUrl">预览图</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="previewUrlMobile">预览图(移动端)</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="categoryCode">文章分类</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="subtitle">副标题</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="introduction">简介</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="content">内容</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="fileUrl">附件</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="jumpUrl">跳转链接</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="sort">排序</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="publishTime">发布时间</label>
                                </div>
                            </div>
                        </#if>
                        <#if module.visiturlType == 2>
<#--                            <div class="form-group">-->
<#--                                <label class="col-sm-4 control-label">单页启用SEO：</label>-->
<#--                                <div class="col-sm-8">-->
<#--                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageSeoEnable" value="1" <#if entity.pageSeoEnable == 'true'>checked</#if>></label>-->
<#--                                </div>-->
<#--                            </div>-->
                            <div class="form-group">
                                <label class="col-sm-4 control-label">单页类型：</label>
                                <div class="col-sm-8">
                                    <div class="radio i-checks">
                                        <label><input type="radio" value="1" name="pageType" checked>文章</label>
                                        <label><input type="radio" value="2" name="pageType" <#if entity.pageType == 2>checked</#if>>URL</label>
                                        <label><input type="radio" value="3" name="pageType" <#if entity.pageType == 3>checked</#if>>视频</label>
                                        <label><input type="radio" value="4" name="pageType" <#if entity.pageType == 4>checked</#if>>图册</label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-4 control-label">单页显示字段：</label>
                                <div class="col-sm-8">
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="previewUrl">预览图</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="previewUrlMobile">预览图(移动端)</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="subtitle">副标题</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="introduction">简介</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="content">内容</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="fileUrl">附件</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="jumpUrl">跳转链接</label>
                                    <label class="checkbox-inline i-checks"><input type="checkbox" name="pageField" value="publishTime">发布时间</label>
                                </div>
                            </div>
                        </#if>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">预览图尺寸说明：</label>
                            <div class="col-sm-7">
                                <input class="form-control input-sm" type="text" name="previewSizeDesc" value="${entity.previewSizeDesc }" placeholder="如：60*60">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">附件类型：</label>
                            <div class="col-sm-7">
                                <input class="form-control input-sm" type="text" name="fileType" value="${entity.fileType }" placeholder="如：pdf,doc">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </div>
                        <input type="hidden" name="oid" value="${entity.oid }">
                        <input type="hidden" id="listField_value" value="${entity.listField }">
                        <input type="hidden" id="listPageType_value" value="${entity.listPageType }">
                        <input type="hidden" id="pageField_value" value="${entity.pageField }">
                        <input type="hidden" name="moduleId" value="${module.oid }">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){

        $.form.render(function () {
            parent.MsgBox.windowReturnData();
        });

        //初始化列表页字段
        var listField_value = $('#listField_value').val();
        if(listField_value){
            var listVals = listField_value.split(',');
            for (var i = 0; i < listVals.length; i ++){
                $("input:checkbox[name='listField'][value='" + listVals[i] + "']").iCheck('check');
            }
        }

        //初始化列表文章类型字段
        var listPageType_value = $('#listPageType_value').val();
        if(listPageType_value){
            var listVals = listPageType_value.split(',');
            for (var i = 0; i < listVals.length; i ++){
                $("input:checkbox[name='listPageType'][value='" + listVals[i] + "']").iCheck('check');
            }
        }

        //初始化单页字段
        var pageField_value = $('#pageField_value').val();
        if(pageField_value){
            var pageVals = pageField_value.split(',');
            for (var i = 0; i < pageVals.length; i ++){
                $("input:checkbox[name='pageField'][value='" + pageVals[i] + "']").iCheck('check');
            }
        }

    });
</script>
</body>
</html>
