<@_place id=id!copyId absoluteURL=false>
    <#assign a=object/>
</@_place>
<@_placeMetadata path=(a.path)!path!><#assign metadata=object/></@_placeMetadata>
<#if metadata?has_content>
<#if !a?has_content&&itemType?has_content>
<#switch itemType>
    <#case 'content'>
        <@_content id=itemId absoluteURL=false><#assign content=object/></@_content>
    <#break>
    <#case 'category'>
        <@_category id=itemId absoluteURL=false><#assign category=object/></@_category>
    <#break>
</#switch>
</#if>
<form method="post" autocomplete="off" action="cmsPlace/save?callbackType=closeCurrent&navTabId=cmsPlace/dataList" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);">
    <input name="id" type="hidden" value="${id!}"/>
    <input name="path" type="hidden" value="${(a.path)!(path)!}"/>
    <input type="hidden" name="_csrf" value="<@_csrfToken admin=true/>"/>
    <div class="formBar">
        <ul>
            <li><button type="submit" class="buttonActive"><@t.page 'button.save'/></button></li>
            <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
        </ul>
    </div>
    <div class="pageFormContent" layoutH>
        <#assign fieldList=metadata.fieldList![]/>
        <#assign requiredFieldList=metadata.requiredFieldList![]/>
        <dl>
            <dt>${(metadata.fieldTextMap['title'])!t.pageMessage('title')}:</dt>
            <dd>
                <input class="required" name="title" type="text" maxlength="255" size="60" value="${(a.title)!(content.title)!(category.name)!title!}"/>
            <#if !(metadata.acceptItemTypes)?has_content>
                <a class="btnLook" href="cmsPlace/lookup.html" lookupGroup="" width="1200" ><@t.page 'select'/></a>
            </#if>
            </dd>
        </dl>
    <#if (metadata.acceptItemTypes)?has_content>
        <dl>
            <dt><@t.page 'place_data.item_type'/>:</dt>
            <dd>
                <input class="required" name="itemType" type="text" readonly="readonly" value="${(a.itemType)!itemType!}"/>
                <input name="itemId" type="hidden" readonly="readonly" value="${(a.itemId)!itemId!}" />
                <a class="btnLook" href="cmsPlace/lookup.html<#if (metadata.acceptItemTypes)?has_content>?acceptItemTypes=<#list metadata.acceptItemTypes as a>${a}<#sep>,</#list></#if>" lookupGroup="" width="1200" ><@t.page 'select'/></a>
            </dd>
        </dl>
    <#else>
        <input name="itemType" type="hidden" value="${(a.itemType)!itemType!}" />
        <input name="itemId" type="hidden" value="${(a.itemId)!itemId!}" />
    </#if>
    <#if fieldList?seq_contains('url')>
        <dl class="nowrap">
            <dt>${(metadata.fieldTextMap['url'])}:</dt>
            <dd><input name="url" type="text"<#if requiredFieldList?seq_contains('url')> class="required"</#if> maxlength="1000" size="60" value="${(a.url)!(content.url)!(category.url)!url!}"/></dd>
        </dl>
    </#if>
        <dl>
            <dt><@t.page 'publish_date'/>:</dt>
            <dd>
                <input type="text" name="publishDate" class="date" size="20" autocomplete="off" dateFmt="yyyy-MM-dd HH:mm:ss" value="${(a.publishDate)!(content.publishDate)!.now}"/>
            </dd>
        </dl>
        <dl>
            <dt><@t.page 'expiry_date'/>:</dt>
            <dd>
                <input type="text" name="expiryDate" class="date" size="20" autocomplete="off" dateFmt="yyyy-MM-dd HH:mm:ss" value="${(a.expiryDate)!(content.expiryDate)!}"/>
            </dd>
        </dl>
    <#if fieldList?seq_contains('cover')>
        <dl class="nowrap">
            <dt>${(metadata.fieldTextMap['cover'])}:</dt>
            <dd>
                <input name="cover" value="${(a.cover)!(content.cover)!}"<#if requiredFieldList?seq_contains('cover')> class="required"</#if> maxlength="300" size="40" type="text"/>
                <a class="btnAttach" href="common/upload.html?field=cover&fileTypes=image" lookupGroup="" width="1000" height="600"><@t.page 'image'/></a>
                <#include "../include_page/preview.html"/>
                <@preview 'page' 'input[name=cover]'/>
            </dd>
        </dl>
    </#if>
        <#include "../include_page/extendData.html"/>
        <@_placeMetadata path=(a.path)!path!''><#assign metadata=object/></@_placeMetadata>
        <#assign
            extendList=(metadata.extendList)![]
            attribute=getPlaceAttribute((a.id)!)!{}
        />
        <@extendData 'extendDataList' extendList attribute/>
    </div>
</form>
<#else>
    
</#if>