Mercurial > hg > documentViewer
diff zpt/toc_text.zpt @ 482:7ca8ac7db06e elementtree
more new template stuff. more batching methods in documentViewer.
author | casties |
---|---|
date | Tue, 16 Aug 2011 18:27:08 +0200 |
parents | 0a0f7f570f90 |
children | ec3d848fe9e8 |
line wrap: on
line diff
--- a/zpt/toc_text.zpt Tue Aug 16 12:02:00 2011 +0200 +++ b/zpt/toc_text.zpt Tue Aug 16 18:27:08 2011 +0200 @@ -7,19 +7,48 @@ <body> <!-- block used for main content area --> <div class="col_left" metal:define-macro="main" - tal:define="docinfo options/docinfo; pageinfo options/pageinfo; - pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_text']); grpsize python:int(pageinfo['tocPageSize']); - maxpn python:int(tocsize/grpsize);"> - <div class="thumbruler"> - <span tal:condition="python:(pn>1)"> - <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)"><</a> - </span> - <span tal:content="string:$pn of $tocsize"/> - <span> - <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">></a> - </span> -</div> - <div class="content" tal:content="structure python:here.getTocPage(mode='text',pageinfo=pageinfo,docinfo=docinfo)"/> -</div> <!-- toc --> + tal:define="start pageinfo/start; tocsize docinfo/tocSize_text; grpsize pageinfo/tocPageSize; + batch python:here.getBatch(start=start,size=grpsize,end=tocsize);"> + <ul class="switcher"> + <li><a + tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a> + </li> + <li class="sel" + tal:condition="python:docpath and docinfo.get('numTocEntries', None)"> + <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a> + </li> + <li + tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"> + <a + tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a> + </li> + <li><a + tal:attributes="href python:here.getLink('tocMode','none')">None</a> + </li> + </ul> + <div class="ruler"> + <form class="autosubmit" tal:attributes="action viewerUrl"> + <input type="hidden" + tal:define="params python:here.getParams('start', None)" + tal:repeat="param params" + tal:attributes="name param; value python:params[param]" /> + <a tal:condition="batch/prevStart" + tal:attributes="href python:here.getLink('start',batch['prevStart'])"><</a> + <span tal:condition="not:batch/prevStart"><</span> + <select class="autosubmit" name="start"> + <option tal:repeat="grp batch/batches" + tal:attributes="selected python:(start==grp['start']); value grp/start" + tal:content="string:${grp/start} - ${grp/end}" /> + </select> + <input type="submit" value="Go" /> + <a tal:condition="batch/nextStart" + tal:attributes="href python:here.getLink('start',batch['nextStart'])">></a> + <span tal:condition="not:batch/nextStart">></span> + </form> + </div> + <div class="content" + tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" /> + </div> + <!-- toc --> </body> </html>