<@cms.content id=id absoluteId=true>
    <#assign
        a=object
        parentId=a.parentId!''
        categoryId=a.categoryId!''
        modelId=a.modelId!''
        attribute=getContentAttribute(a.id)
    />
</@cms.content>
<@cms.category id=categoryId!><#assign category=object/></@cms.category>
<@cms.model id=modelId!><#assign model=object/></@cms.model>
<#macro bread category>
    <#if category.parentId?has_content>
        <@cms.category id=category.parentId>
            <@bread object/>
            <a href="${object.url!}" target="_blank">${object.name}</a> &gt;
        </@cms.category>
    </#if>
</#macro>
<style>
#content img,#content video{max-width:100%;}
</style>
<div class="pageFormContent" layoutH>
    <#if model?has_content>
        <#assign fieldList=model.fieldList![]/>
        <@cms.content id=parentId>
            <dl class="nowrap">
                <dt><@t.page 'content.parent'/>:</dt>
                <dd>
                    ${(object.title)!}
                </dd>
            </dl>
        </@cms.content>
            <dl>
                <dt><@t.page 'category'/>:</dt>
                <dd class="exclude-translate">
                    <@bread category/> <a href="${(category.url)!}" target="_blank">${(category.name)!}</a>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'model'/>:</dt>
                <dd class="exclude-translate">
                    ${(model.name)!}
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['title'])!}:</dt>
                <dd>
                    ${(a.copied?then('['+t.pageMessage('copied')+']',''))!}<span class="exclude-translate">${(a.title)!}</span>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'status'/>:</dt>
                <dd>
                    <@t.page 'status.content.'+(a.status)!/>
                </dd>
            </dl>
            <dl>
                <dt><@t.page 'content.score'/>:</dt>
                <dd>${a.score!}/${a.scoreUsers!}</dd>
            </dl>
        <#if 1=a.status>
            <dl>
                <dt><@t.page 'inspector'/>:</dt>
                <dd class="exclude-translate">
                     <@sys.user id=a.checkUserId>${(object.nickname)!}</@sys.user>
                </dd>
            </dl>
        </#if>
            <dl class="nowrap">
                <dt><#if model.onlyUrl>${(model.fieldTextMap['url'])!}<#else><@t.page 'url'/></#if>:</dt>
                <dd class="exclude-translate">
                    <a href="${(a.url)!}" target="_blank">${(a.url)!}</a>
                </dd>
            </dl>
        <#if a?has_content&&a.copied>
            <dl>
                <dt>${(model.fieldTextMap['source'])!}:</dt>
                <dd class="exclude-translate">${(attribute.source)!}</dd>
            </dl>
            <dl>
                <dt>${(model.fieldTextMap['sourceUrl'])!}:</dt>
                <dd class="exclude-translate">
                    <a href="${(attribute.sourceUrl)!}" target="_blank">${(attribute.sourceUrl)!}</a>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('author')>
            <dl>
                <dt>${(model.fieldTextMap['author'])!}:</dt>
                <dd class="exclude-translate">${(a.author)!}</dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('editor')>
            <dl>
                <dt>${(model.fieldTextMap['editor'])!}:</dt>
                <dd class="exclude-translate">${(a.editor)!}</dd>
            </dl>
        </#if>
        <#if category?has_content && (a.tagIds)?has_content>
<#if category.tagTypeIds?has_content>
    <@cms.tagType ids=category.tagTypeIds>
        <#list map as k,tagType>
            <dl class="nowrap">
                <dt>${tagType.name}:</dt>
                <dd class="exclude-translate">
                    <@cms.tag ids=a.tagIds>
                        <#list map as j,tag>
                            <#if tag.typeId?has_content && tag.typeId=tagType.id>
                                ${tag.name},
                            </#if>
                        </#list>
                    </@cms.tag>
                </dd>
            </dl>
        </#list>
    </@cms.tagType>
<#else>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['tag'])!}:</dt>
                <dd class="exclude-translate">
                    <@cms.tag ids=a.tagIds>
                        <#list map as j,tag>
                            ${tag.name}<#sep>,
                        </#list>
                    </@cms.tag>
                </dd>
            </dl>
</#if>
        </#if>
            <dl>
                <dt><@t.page 'publish_date'/>:</dt>
                <dd>
                    ${(a.publishDate)!}<#if a.expiryDate?has_content> - ${(a.expiryDate)!}</#if>
                </dd>
            </dl>
        <#include "../include_page/extendData.html"/>
        <#if category?has_content&&category.extendId?has_content>
            <@sys.extendFieldList extendId=category.extendId>
                <@extendData extendList=list extendValues=attribute type='view'/>
            </@sys.extendFieldList>
        </#if>
        <#if model.extendList?has_content>
            <@extendData extendList=model.extendList extendValues=attribute type='view'/>
        </#if>
        <#if a.hasImages>
        <dl class="nowrap">
            <dt><@t.page 'image_list'/>:</dt>
            <dd>
        <@cms.contentFileList contentId=a.id fileTypes='image'>
            <#list page.list as file>
                <div class="thumbnail">
                    <img src="${(file.filePath)!}" alt="${(file.description)!}"/>
                </div>
            </#list>
        </@cms.contentFileList>
            </dd>
        </dl>
        </#if>
        <#if a.hasFiles>
            <dl class="nowrap">
                <dt><@t.page 'attach_list'/>:</dt>
                <dd>
            <@cms.contentFileList contentId=a.id fileTypes='video,audio,document,other'>
                <#list page.list as file>
                    <p><a href="${(file.filePath)!}" download="${(file.description)!}" class="exclude-translate" target="_blank">${(file.description)!}</a> <@t.page 'clicks'/>:${a.clicks!}</p>
                </#list>
            </@cms.contentFileList>
                </dd>
            </dl>
        </#if>
        <#if a.hasProducts>
            <dl class="nowrap">
                <dt><@t.page 'product_list'/>:</dt>
                <dd>
            <@cms.contentProductList contentId=a.id>
                <#list page.list as product>
                    <div class="unit">
                        <#if product.cover?has_content>
                            <p class="thumbnail">
                                <img src="${(product.cover)!}" alt="${product.title}"/>
                            </p>
                        </#if>
                        <p><label><@t.page 'title'/>:</label>${product.title}</p>
                        <p><label><@t.page 'product.price'/>:</label>${product.price}</p>
                        <p><label><@t.page 'product.inventory'/>:</label>${product.inventory}</p>
                        <p><label><@t.page 'product.sales'/>:</label>${product.sales}</p>
                    </div>
                    <div class="divider"></div>
                </#list>
            </@cms.contentProductList>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('cover')&&a.cover?has_content>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['cover'])!}:</dt>
                <dd>
                    <div class="thumbnail">
                        <img src="${(a.cover)!}" alt="${a.title}"/>
                    </div>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('description')>
            <dl class="nowrap">
                <dt>${(model.fieldTextMap['description'])!}:</dt>
                <dd class="exclude-translate">
                    <#list (a.description!'')?split('\n') as line>${line}<#sep><br/></#list>
                </dd>
            </dl>
        </#if>
        <#if fieldList?seq_contains('content')>
            <div class="unit" id="content" class="exclude-translate">
                <h3>${(model.fieldTextMap['content'])!} (<@t.page "word_count"/>:${(attribute.wordCount)!}):</h3>
                ${(attribute.text?no_esc)!}
            </div>
        </#if>
    </#if>
    <@cms.contentRelatedList contentId=a.id>
        <#if page.totalCount gt 0>
        <dl class="nowrap">
            <dt><@t.page 'recommend_info'/>:</dt>
            <dd class="exclude-translate">
                <#list page.list as a>
                    <a href="cmsContent/view.html?id=${a.relatedContentId}" class="exclude-translate" target="dialog" width="1200" height="600" rel="viewContent${a.relatedContentId}">${(a.title)!}</a>
                </#list>
            </dd>
        </dl>
        </#if>
    </@cms.contentRelatedList>
    <@sys.authorized roleIds=admin.roles urls='cmsComment/list,cmsComment/edit'><#assign authorizedMap=map/></@sys.authorized>
    <@cms.commentList advanced=true contentId=a.id pageSize=0>
        <dl class="nowrap">
            <dt>
                <#if authorizedMap['cmsComment/edit']>
                    <a href="cmsComment/edit.html?contentId=${a.id}"  target="dialog" mask="true"><@t.page 'comment'/></a>
                <#else>
                    <@t.page 'comment'/>
                </#if>
                :
            </dt>
            <dd class="exclude-translate">
                <#if authorizedMap['cmsComment/list']>
                    <a href="cmsComment/list.html?contentId=${a.id}" target="navTab" rel="cmsComment/list" title="<@t.page 'comment.management'/>">${page.totalCount!}</a>
                <#else>
                    ${page.totalCount!}
                </#if>
            </dd>
        </dl>
    </@cms.commentList>
</div>
<div class="formBar">
    <ul>
        <#if model?has_content&&model.hasChild>
            <li><a href="cmsContent/list.html?parentId=${a.id}&categoryId=${a.categoryId!}" class="button" target="navTab" rel="cmsContent/list"><@t.page 'content.child_management'/></a></li>
        </#if>
        <@sys.workflowProcessItem itemType="content" itemId=a.id>
            <li><a href="sysWorkflowProcess/view.html?id=${object.processId}" class="button" target="dialog" rel="viewProcess${object.processId}" width="1200" height="500"><@t.page 'workflow.check'/></a></li>
        </@sys.workflowProcessItem>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>