<@cms.contentList advanced=true status=status categoryId=categoryId containChild=containChild disabled=true
            modelId=modelIds parentId=parentId title=title userId=userId
            startPublishDate=startPublishDate endPublishDate=endPublishDate absoluteId=false
            orderField=orderField orderType=orderType pageIndex=pageNum pageSize=numPerPage>
<#macro modelList parentId=''>
<@cms.modelList parentId=parentId>
    <#list page.list as a>
        <label>
            <input name="modelIds" value="${a.id}" type="checkbox" class="form-check-input"<@t.compare modelIds!'' a.id?string ' checked="checked"'/> />
            ${(a.name)!}
        </label>
        <#if a.hasChild>
            <@modelList a.id/>
        </#if>
    </#list>
</@cms.modelList>
</#macro>
<div class="pageHeader card">
    <form class="pagerForm" autocomplete="off" onsubmit="return navTabSearch(this);" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li class="width:auto">
                    <#include "../include_page/contentStatus.html"/>
                </li>
                <li>
                    <label><@t.page 'content.promulgator'/>:</label>
                    <#include "../include_page/userId.html"/>
                </li>
                <li>
                    <label><@t.page 'publish_date'/>:</label>
                    <input type="text" name="startPublishDate" class="date" size="10" autocomplete="off" dateFmt="yyyy-MM-dd" 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" value="${endPublishDate!}"/>
                    <a class="inputDateButton" href="javascript:void(0);"></a>
                </li>
                <li>
                    <label><@t.page 'title'/>:</label><input type="text" size="20" name="title" value="${title!}"/>
                </li>
                <li style="width:auto">
                    <label><@t.page 'model'/>:</label>
                    <@modelList/>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<@sys.authorized roleIds=admin.roles urls='cmsContent/realDelete,cmsContent/recycle'><#assign authorizedMap=map/></@sys.authorized>
<div class="card">
    <div class="panelBar">
        <ul class="toolBar">
        <#if authorizedMap['cmsContent/recycle']>
            <li><a href="cmsContent/recycle?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_recycle'/>" target="selectedTodo" rel="ids"><i class="icon-reply-all icon-large"></i><@t.page 'button.batch_recycle'/></a></li>
        </#if>
        <#if authorizedMap['cmsContent/realDelete']>
            <li class="line">line</li>
            <li><a href="cmsContent/realDelete?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.delete'/>" target="selectedTodo" rel="ids"><i class="icon-trash icon-large"></i><@t.page 'button.batch_delete'/></a></li>
        </#if>
        </ul>
    </div>
    <table class="table" width="100%" layoutH orderField="${orderField!}" orderType="${orderType!}">
        <thead>
            <tr>
                <th width="20"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                <th width="30"><@t.page 'id'/></th>
                <th width="250"><@t.page 'title'/></th>
                <th width="40"><@t.page 'content.promulgator'/></th>
                <th width="30"><@t.page 'category'/></th>
                <th width="30"><@t.page 'model'/></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>
                <th width="70"><@t.page 'create_date'/></th>
                <th width="50"><@t.page 'status'/>/<@t.page 'inspector'/></th>
                <th width="100"><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody>
            <#list page.list as a>
                <@t.merge 'userIds' a.userId!/>
                <@t.merge 'checkUserIds' a.checkUserId!/>
                <@t.merge 'categoryIds' a.categoryId!/>
                <@t.merge 'modelIds' a.modelId!/>
            </#list>

            <@sys.user ids=t.userIds!><#assign userMap=map!/></@sys.user>
            <@sys.user ids=t.checkUserIds!><#assign checkUserMap=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><input name="ids" value="${a.id}" type="checkbox"></td>
                <td>${a.id}</td>
                <td>${(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></td>
                <td>
                    ${(userMap[a.userId?string].nickname)!}
                </td>
                <td>
                    ${(categoryMap[a.categoryId?string].name)!}
                </td>
                <td>
                    ${(modelMap[a.modelId].name)!}
                </td>
                <td>${a.comments!}</td>
                <td>${a.clicks!}</td>
                <td>${a.publishDate!}</td>
                <td>${a.createDate!}</td>
                <td>
                    <span class="statusText ${a.status?switch(1,'green',2,'orange',3,'red',4,'orange')}"><@t.page 'status.content.'+a.status/></span>
                    <#if 1=a.status>/ ${(checkUserMap[a.checkUserId?string].nickname)!}</#if>
                </td>
                <td class="wrap">
                    <#if authorizedMap['cmsContent/recycle']>
                        <a href="cmsContent/recycle?ids=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText green" title="<@t.page 'confirm.recycle'/>" target="ajaxTodo"><@t.page 'button.recycle'/></a>
                    </#if>
                    <#if authorizedMap['cmsContent/realDelete']>
                        <a href="cmsContent/realDelete?ids=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText warn" title="<@t.page 'confirm.delete'/>" target="ajaxTodo"><i class="icon-trash"></i><@t.page 'button.delete'/></a>
                    </#if>
                </td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#include "../include_page/page.html"/>
</div>
</@cms.contentList>