<@cms.contentList advanced=true status=1 endPublishDate=.now categoryId=categoryId modelId=modelIds title=title
    parentId=parentId containChild=true userId=userId startPublishDate=startPublishDate
    orderField=orderField orderType=orderType pageIndex=pageNum pageSize=numPerPage>
<div class="pageHeader">
    <form class="pagerForm" autocomplete="off" action="cmsContent/lookup_list.html" onsubmit="return divSearch(this, 'content_list');" method="post">
        <#include "../include_page/parameters.html"/>
        <input type="hidden" name="field" value="${field!'relatedContentId'}"/>
        <input type="hidden" name="titleField" value="${titleField!'title'}"/>
        <input type="hidden" name="categoryId" value="${categoryId!}"/>
        <input type="hidden" name="userId" value="${userId!}"/>
        <input type="hidden" name="parentId" value="${parentId!}"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'title'/>:</label>
                    <input type="text" size="40" name="title" value="${title!}"/>
                </li>
                <li>
                    <label><@t.page 'publish_date'/>:</label>
                    <input type="text" name="startPublishDate" class="date" size="10" autocomplete="off" dateFmt="yyyy-MM-dd" maxDate="{%y}-%M-{%d}" value="${startPublishDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                    <span>-</span>
                    <input type="text" name="endPublishDate" class="date" size="10" autocomplete="off" dateFmt="yyyy-MM-dd" maxDate="{%y}-%M-{%d+1}" value="${endPublishDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                </li>
                <li>
                    <label><@t.page 'model'/>:</label>
                    <#if showModel?has_content&&"true"=showModel>
                        <@cms.model ids=modelIds><#list map as k,m>${m.name}<#sep>,</#list></@cms.model>
                    <#else>
                        <#assign queryAll=true/>
                        <#include "../include_page/modelId.html"/>
                    </#if>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button class="button" type="button" onclick="$.bringBack({'${field!'relatedContentId'}':'', 'url':'', '${titleField!'title'}':'', 'description':''}); return false;"><@t.page 'button.clear_select'/></button>
                    </li>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<table class="table" width="100%" layoutH rel="content_list" orderField="${orderField!}" orderType="${orderType!}">
    <thead>
        <tr>
            <th width="20"><@t.page 'use'/></th>
            <th width="20"><@t.page 'id'/></th>
            <th width="200"><@t.page 'content'/></th>
            <th width="30" orderField="comments"><@t.page 'content.comments'/></th>
            <th width="30" orderField="clicks"><@t.page 'clicks'/></th>
            <th width="70" orderField="publishDate"><@t.page 'publish_date'/></th>
        </tr>
    </thead>
    <tbody>
        <#list page.list as a>
            <@t.merge 'userIds' a.userId!/>
            <@t.merge 'userIds' a.checkUserId!/>
            <@t.merge 'categoryIds' a.categoryId!/>
            <@t.merge 'modelIds' a.modelId!/>
        </#list>

        <@sys.user ids=t.userIds!><#assign userMap=map!/></@sys.user>
        <@cms.category ids=t.categoryIds!><#assign categoryMap=map!/></@cms.category>
        <@cms.model ids=t.modelIds!><#assign modelMap=map!/></@cms.model>

        <#list page.list as a>
        <tr>
            <td>
                <a href="javascript:;" class="btnText green" onclick="$.bringBack({'${field!'relatedContentId'}':'${a.id}', 'url':'${a.url!}', '${titleField!'title'}':'${a.title?js_string}', 'description':'${(a.description!)?js_string}'}); return false;"><i class="icon-ok"></i><@t.page 'select'/></a>
            </td>
            <td>${a.id}</td>
            <td>
                <div class="box">
                    <h3>
                        [<span class="exclude-translate">${(categoryMap[a.categoryId?string].name)!}</span>]
                        ${(a.copied?then('['+t.pageMessage('copied')+']',''))!}
                        <a href="cmsContent/view.html?id=${a.id}" class="exclude-translate" target="dialog" width="1200" height="600" rel="viewContent${a.id}">${(a.title)!}</a>
                    </h3>
                    <p>
                        <label><@t.page 'content.promulgator'/>:</label><span class="exclude-translate">${(userMap[a.userId?string].nickname)!}</span>
                        <label><@t.page 'model'/>:</label><span class="exclude-translate">${(modelMap[a.modelId].name)!}</span>
                        <#if modelMap[a.modelId]?has_content&&modelMap[a.modelId].hasChild>
                            <label><a href="cmsContent/lookup_list.html?parentId=${a.id}&categoryId=${a.categoryId}&field=${(field?url)!'relatedContentId'}&titleField=${(titleField?url)!'title'}" target="ajax" rel="content_list"><@t.page 'content.child_management'/></a></label>
                        </#if>
                        <#if a.expiryDate?has_content><label><@t.page 'expiry_date'/>:</label><span class="exclude-translate">${a.expiryDate!}</span></#if>
                    </p>
                </div>
            </td>
            <td>${a.comments!}</td>
            <td>${a.clicks!}</td>
            <td>${a.publishDate!}</td>
        </tr>
        </#list>
    </tbody>
</table>
<#assign rel='content_list'/>
<#include "../include_page/pageDialog.html"/>
</@cms.contentList>