<dtml-comment>### Blog main interface ###</dtml-comment>
<dtml-var blog_header>

<dtml-comment>### banner ###</dtml-comment>
<dtml-var blog_banner>


<dtml-comment>* set noheader,noextendlink,nocomment to hide header,link to extend,comment and trackback</dtml-comment>
<dtml-call "REQUEST.set('nocomment',1)">
<dtml-call "REQUEST.set('nocommentform',1)">

<div id="content">

<dtml-if cat_id>

<dtml-comment>### category name,description(if exist) ###</dtml-comment>
<dl class="category-banner">
<dtml-with "getCategory(id=cat_id)">
<dtml-call "REQUEST.set('cat_count',count)">
<dt>Entries : Category [ <dtml-var name> ] </dt>
<dd><dtml-var description missing=""></dd>
</dtml-with>
</dl>

<dtml-comment>* Show all categories in the blog .</dtml-comment>
<div class="category">
<dtml-in category_list>
<a href="<dtml-var blogurl missing="">/categorylist_html?cat_id=<dtml-var id>">[<dtml-var name missing="category name is missing">]</a>&nbsp;
</dtml-in>
</div>

<dtml-comment>Set the values</dtml-comment>
<dtml-unless start>
<dtml-call "REQUEST.set('start',0)">
</dtml-unless start>
<dtml-call "REQUEST.set('count',module_item_count)">
<dtml-call "REQUEST.set('showsize',280)">
<dtml-call "REQUEST.set('liststart',_.max(0,start-(showsize/2)))">
<dtml-call "REQUEST.set('listend',_.min(cat_count,liststart+showsize))">
<dtml-call "REQUEST.set('start',_.int(start))">

<br />

<dtml-in "rev_category_entry_items(category_id=cat_id)" size=count start=start>
<dtml-var entry_body>
<dtml-else>
<div id="content">
There are no entries.
</div>
</dtml-in>

<dtml-comment>Batch</dtml-comment>
<div align="right">
<dtml-if "start !=0"> 
<a href="./categorylist_html?cat_id=<dtml-var cat_id>&start:int=<dtml-var "start - count">">Prev</a>&nbsp;
</dtml-if>
<dtml-if "liststart !=0">
<a href="./categorylist_html?cat_id=<dtml-var cat_id>&start:int=<dtml-var "min(0,liststart - count)">">...</a>&nbsp;
</dtml-if>
<dtml-in "_.range(liststart,listend,count)">
<dtml-call "REQUEST.set('seqitem',_['sequence-item'])">
<dtml-if "seqitem <= start and seqitem > start-count">
<b>[<dtml-var  "_['sequence-index'] + (liststart/count)+1">]</b>
&nbsp;
<dtml-else>
<a href="./categorylist_html?cat_id=<dtml-var cat_id>&start:int=<dtml-var seqitem>">
<dtml-var  "_['sequence-index'] + (liststart/count)+1">
</a>&nbsp;
</dtml-if>
</dtml-in>
<dtml-if "listend !=cat_count">
<a href="./categorylist_html?cat_id=<dtml-var cat_id>&start:int=<dtml-var "seqitem + count">">...</a>&nbsp;
</dtml-if>
<dtml-if "cat_count > (start + count)">
<a href="./categorylist_html?cat_id=<dtml-var cat_id>&start:int=<dtml-var "start + count">">Next</a>
</dtml-if>
</div>

<dtml-else>
cat_id is missing.
</dtml-if>

</div>

<br />

<dtml-var blog_footer>
