<@cms.search word=word exclude=exclude fields=fields phrase=phrase tagIds=tagId categoryId=categoryId containChild=true extendsValues=extendsValues
            dictionaryValues=dictionaryValues dictionaryUnion=dictionaryUnion highlight=true
            startPublishDate=startPublishDate endPublishDate=endPublishDate absoluteId=false
            orderField=orderField orderType=orderType pageIndex=pageNum pageSize=numPerPage>
<@sys.authorized roleIds=admin.roles urls='cmsContent/add,cmsContent/delete,cmsContent/moveParameters,cmsContent/uncheck,cmsContent/push,cmsCategory/lookupBySiteId,cmsContent/refresh,cmsContent/publish,cmsComment/list'><#assign authorizedMap=map/></@sys.authorized>
<div class="pageHeader card">
    <form class="pagerForm" action="cmsContent/search.html" autocomplete="off" onsubmit="return navTabSearch(this);" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label><@t.page 'search_word'/>:</label><input type="text" size="20" name="word" value="${word!}"/>
                    <label><input name="phrase" type="checkbox" class="form-check-input" value="true" <@t.compare phrase!'' 'true' 'checked="checked"'/>/><@t.page 'search.phrase'/></label>
                </li>
                <li>
                    <label><@t.page 'exclude'/>:</label><input type="text" size="20" name="exclude" value="${exclude!}"/>
                </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 'tag'/>:</label>
                    <input name="tagId" type="hidden" value="${tagId!}" suffix="id"/>
                    <input name="tagName" type="text" size="10" suffix="name" postField="tagName" suggestfields="id,name" callbackFields="tagId,tagName" lookupgroup="" suggestUrl="common/tagSuggest.html" value="<@cms.tag id=tagId>${object.name}</@cms.tag>"/>
                    <a class="inputClearButton" href="javascript:$('input[name=tagId],input[name=tagName]',navTab.getCurrentPanel()).val('');"></a>
                </li>
                <li>
                    <label><@t.page 'field'/>:</label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="title" <@t.compare fields!'' 'title' 'checked="checked"'/>/><@t.page 'title'/></label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="author" <@t.compare fields!'' 'author' 'checked="checked"'/>/><@t.page 'content.author'/></label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="editor" <@t.compare fields!'' 'editor' 'checked="checked"'/>/><@t.page 'editor'/></label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="description" <@t.compare fields!'' 'description' 'checked="checked"'/>/><@t.page 'description'/></label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="text" <@t.compare fields!'' 'text' 'checked="checked"'/>/><@t.page 'text'/></label>
                    <label><input name="fields" type="checkbox" class="form-check-input" value="files" <@t.compare fields!'' 'files' 'checked="checked"'/>/><@t.page 'content_file'/></label>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="card">
    <div class="panelBar">
        <ul class="toolBar">
        <#if authorizedMap['cmsContent/uncheck']>
            <li><a href="cmsContent/uncheck?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_uncheck'/>" target="selectedTodo" rel="ids"><i class="icon-check icon-large"></i><@t.page 'button.batch_uncheck'/></a></li>
        </#if>
        <#if authorizedMap['cmsContent/refresh'] && !site.useStatic>
            <li><a href="cmsContent/refresh?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_refresh'/>" target="selectedTodo" rel="ids"><i class="icon-refresh icon-large"></i><@t.page 'button.batch_refresh'/></a></li>
        </#if>
        <#if authorizedMap['cmsContent/publish']>
            <li><a href="cmsContent/publish?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_publish'/>" target="selectedTodo" rel="ids"><i class="icon-file-text-alt icon-large"></i><@t.page 'button.batch_publish'/></a></li>
        </#if>
        <#if !parentId?has_content&&authorizedMap['cmsContent/moveParameters']>
            <li><a href="cmsContent/moveParameters.html" target="dialog" mask="true"><i class="icon-move icon-large"></i><@t.page 'button.batch_move'/></a></li>
        </#if>
        <#if authorizedMap['cmsContent/delete']>
            <li class="line">line</li>
            <li><a href="cmsContent/delete?_csrf=<@tools.csrfToken admin=true/>" title="<@t.page 'confirm.batch_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="200"><@t.page 'content'/></th>
                <th width="30"><@t.page 'content.comments'/></th>
                <th width="30" orderField="clicks"><@t.page 'clicks'/></th>
                <th width="30" orderField="score"><@t.page 'content.score'/></th>
                <th width="70" orderField="publishDate"><@t.page 'publish_date'/></th>
                <th width="100"><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody class="searchResult">
            <#list page.list as a>
                <@t.merge 'userIds' a.userId!/>
                <@t.merge 'userIds' a.checkUserId!/>
                <@t.merge 'categoryIds' a.categoryId!/>
                <@t.merge 'modelId' a.modelId!/>
                <@t.merge 'ids' a.id/>
            </#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.modelId!><#assign modelMap=map!/></@cms.model>

            <#list page.list as a>
            <tr>
                <td class="center" title="${a.id}"><input name="ids" value="${a.id}" type="checkbox"></td>
                <td class="wrap">
                    <#if a.cover?has_content>
                        <div class="thumbnail">
                            <img src="${(a.cover)!}" alt="${a.title!}"/>
                        </div>
                    </#if>
                    <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?no_esc)!}</a>
                        </h3>
                        <p>
                            <#if modelMap[a.modelId]?has_content&&modelMap[a.modelId].hasChild>
                                <label><a href="cmsContent/list.html?parentId=${a.id}&categoryId=${a.categoryId!}" class="btnText" target="navTab" rel="cmsContent/list"><@t.page 'content.child_management'/></a></label>
                            </#if>
                            <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>
                        </p>
                        <#if a.expiryDate?has_content><p><label><@t.page 'expiry_date'/>:</label><span class="exclude-translate">${a.expiryDate!}</span></p></#if>
                    </div>
                </td>
                <td class="center">
                    <#if authorizedMap['cmsComment/list']>
                        <a href="cmsComment/list.html?contentId=${a.id}" target="navTab" rel="cmsComment/list" title="<@t.page 'comment.management'/>">${a.comments!}</a>
                    <#else>
                        ${a.comments!}
                    </#if>
                </td>
                <td class="center">${a.clicks!}</td>
                <td class="center">${a.score!}</td>
                <td class="center" title="<@t.page 'create_date'/>:${a.createDate!}">${a.publishDate!}</td>
                <td class="wrap">
                    <a href="cmsContent/add.html?id=${a.id}" class="edit btnText blue" target="navTab" rel="cmsContent/edit"><i class="icon-edit"></i><@t.page 'content.edit'/></a>
                    <#if authorizedMap['cmsContent/add']>
                        <a href="cmsContent/add.html?copyId=${a.id}" class="btnText blue" target="navTab" rel="cmsContent/add" title="<@t.page 'content.add'/>"><i class="icon-copy"></i><@t.page 'button.copy'/></a>
                    </#if>
                    <#if authorizedMap['cmsCategory/lookupBySiteId']>
                        <a href="cmsCategory/lookupBySiteId.html?id=${a.id}&modelId=${a.modelId!}&currentCategoryId=${a.categoryId!}" class="btnText blue" target="dialog" mask="true"><i class="icon-asterisk"></i><@t.page 'button.distribute'/></a>
                    </#if>
                    <#if authorizedMap['cmsContent/push']>
                        <a href="cmsContent/push.html?contentId=${a.id}" class="btnText blue" target="dialog" mask="true"><@t.page 'button.push'/></a>
                    </#if>
                </td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#include "../include_page/page.html"/>
</div>
</@cms.search>