<@cms.categoryType id=id!copyId><#assign a=object/></@cms.categoryType>
<div class="pageContent">
    <form method="post" autocomplete="off" action="cmsCategoryType/save?callbackType=closeCurrent&navTabId=cmsCategoryType/list" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
        <input name="categoryTypeId" type="hidden" value="${id!}"/>
        <input type="hidden" name="_csrf" value="<@tools.csrfToken admin=true/>"/>
        <div class="formBar card">
            <ul>
            <@sys.authorized roleIds=admin.roles url='cmsCategoryType/save'>
                <li><button type="submit" class="buttonActive" title="ctrl+s"><@t.page 'button.save'/></button></li>
            </@sys.authorized>
                <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
            </ul>
        </div>
        <div class="card">
            <div class="pageFormContent" layoutH>
                <dl class="nowrap">
                    <dt><@t.page 'id'/>:</dt>
                    <dd>
                        <input class="required" name="id" type="text" maxlength="20" size="20" value="${(a.id)!}"/>
                    </dd>
                </dl>
                <dl>
                    <dt><@t.page 'name'/>:</dt>
                    <dd>
                        <input class="required" name="name" type="text" size="20" maxlength="20" value="${(a.name)!}"/>
                    </dd>
                </dl>
                <dl class="nowrap">
                    <dt><@t.page 'sort'/>:</dt>
                    <dd><input class="required digits" name="sort" type="number" size="4" value="${(a.sort)!(category.sort)!0}"/></dd>
                </dl>
                <fieldset>
                    <legend><@t.page 'category.base_info'/></legend>
                    <dl class="nowrap">
                        <dt><@t.page 'url'/>:</dt>
                        <dd>
                            <label><input name="onlyUrl" type="checkbox" class="form-check-input"/></label>
                        </dd>
                    </dl>
                    <dl class="nowrap onlyUrl">
                        <dt><@t.page 'category.page_size'/>:</dt>
                        <dd>
                            <input class="required digits" name="pageSize" type="number" size="4" value="${(a.pageSize)!(categoryType.pageSize)!20}"/>
                            <label><input name="containChild" type="checkbox" class="form-check-input"${(a?has_content&&a.containChild)?then(' checked="checked"','')?no_esc}/><@t.page 'category.contain_child'/></label>
                        </dd>
                    </dl>
                <#if site.useStatic>
                    <dl class="nowrap onlyUrl">
                        <dt><@t.page 'category.template_path'/>:</dt>
                        <dd>
                            <input name="templatePath" type="text" autocomplete="on" maxlength="255" size="50" value="${(a.templatePath)!}"/>
                            <a class="btnLook" href="cmsTemplate/lookup.html?field=templatePath" lookupGroup=""><@t.page 'template.select'/></a>
                            <span class="info"><@t.page 'category.template_path.description'/></span>
                        </dd>
                    </dl>
                </#if>
                    <dl class="nowrap onlyUrl">
                        <dt><@t.page 'category.path'/>:</dt>
                        <dd>
                            <input name="path" type="text" autocomplete="on" maxlength="500" size="100" value="${(a.path)!}"/>
                            <a class="btnLook onlyUrl" href="cmsCategory/categoryPath.html" width="920" lookupGroup=""><@t.page 'select_path'/></a>
                        </dd>
                    </dl>
                </fieldset>
                <fieldset>
                    <legend><@t.page 'category.extend_field'/></legend>
                    <span class="info"><@t.page 'extend_field.use.category'/></span>
                    <span class="info"><@t.page 'extend_field.invalid'/>:title,keywords,description;<@t.page 'metadata.default_value_description'/></span>
                    <#include "../include_page/extends.html"/>
                    <#assign categoryExtendList=[]/>
                    <#if a?has_content&&a.extendList?has_content>
                        <#assign categoryExtendList=a.extendList>
                        <#if copyId?has_content && !id?has_content><#assign copy=true/></#if>
                    </#if>
                    <@extends 'extendList' categoryExtendList false false copy/>
                    <span class="info"><@t.page 'extend_field.name.description'/></span>
                </fieldset>
            </div>
        </div>
    </form>
<script>
    $('input[name=onlyUrl]',navTab.getCurrentPanel()).on("click", function(){
        if($(this).is(':checked')) {
            $('.onlyUrl',navTab.getCurrentPanel()).hide();
            $('.onlyUrl input[type=text]',navTab.getCurrentPanel()).val('');
        } else {
            $('.onlyUrl',navTab.getCurrentPanel()).show();
        }
    });
    <#if a?has_content && a.onlyUrl>
        $('input[name=onlyUrl]',navTab.getCurrentPanel()).trigger("click");
    </#if>
</script>
</div>