Changeset 482:7ca8ac7db06e in documentViewer for zpt
- Timestamp:
- Aug 16, 2011, 4:27:08 PM (13 years ago)
- Branch:
- elementtree
- Location:
- zpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
zpt/toc_figures.zpt
r481 r482 8 8 <!-- block used for main content area --> 9 9 <div class="col_left" metal:define-macro="main" 10 tal:define=" pn pageinfo/tocPN; tocsize docinfo/tocSize_figures; grpsize pageinfo/tocPageSize;11 maxpn python:int(math.ceil(tocsize/float(grpsize)));">10 tal:define="start pageinfo/start; tocsize docinfo/tocSize_figures; grpsize pageinfo/tocPageSize; 11 batch python:here.getBatch(start=start,size=grpsize,end=tocsize);"> 12 12 <ul class="switcher"> 13 13 <li><a … … 18 18 <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a> 19 19 </li> 20 <li 20 <li class="sel" 21 21 tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"> 22 22 <a … … 30 30 <form class="autosubmit" tal:attributes="action viewerUrl"> 31 31 <input type="hidden" 32 tal:define="params python:here.getParams(' tocPN', None)"32 tal:define="params python:here.getParams('start', None)" 33 33 tal:repeat="param params" 34 34 tal:attributes="name param; value python:params[param]" /> 35 <a tal:condition=" python:(pn>1)"36 tal:attributes="href python:here.getLink(' tocPN',pn-1)"><</a>37 <span tal:condition=" python:(pn<=1)"><</span>38 <select class="autosubmit" name=" tocPN">39 <option tal:repeat=" idx python:range(maxpn)"40 tal:attributes="selected python:( pn==idx*grpsize+1); value python:(idx*grpsize+1)"41 tal:content=" python:str(idx*grpsize+1)" />35 <a tal:condition="batch/prevStart" 36 tal:attributes="href python:here.getLink('start',batch['prevStart'])"><</a> 37 <span tal:condition="not:batch/prevStart"><</span> 38 <select class="autosubmit" name="start"> 39 <option tal:repeat="grp batch/batches" 40 tal:attributes="selected python:(start==grp['start']); value grp/start" 41 tal:content="string:${grp/start} - ${grp/end}" /> 42 42 </select> 43 43 <input type="submit" value="Go" /> 44 <a tal:condition=" python:(pn<maxpn)"45 tal:attributes="href python:here.getLink(' tocPN',pn+1)">></a>46 <span tal:condition=" python:(pn>=maxpn)">></span>44 <a tal:condition="batch/nextStart" 45 tal:attributes="href python:here.getLink('start',batch['nextStart'])">></a> 46 <span tal:condition="not:batch/nextStart">></span> 47 47 </form> 48 48 </div> 49 49 <div class="content" 50 tal:content="structure python:here.getTocPage(mode='figures', pageinfo=pageinfo,docinfo=docinfo)" />50 tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" /> 51 51 </div> 52 52 <!-- toc --> -
zpt/toc_text.zpt
r481 r482 8 8 <!-- block used for main content area --> 9 9 <div class="col_left" metal:define-macro="main" 10 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; 11 pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_text']); grpsize python:int(pageinfo['tocPageSize']); 12 maxpn python:int(tocsize/grpsize);"> 13 <div class="thumbruler"> 14 <span tal:condition="python:(pn>1)"> 15 <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)"><</a> 16 </span> 17 <span tal:content="string:$pn of $tocsize"/> 18 <span> 19 <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">></a> 20 </span> 21 </div> 22 <div class="content" tal:content="structure python:here.getTocPage(mode='text',pageinfo=pageinfo,docinfo=docinfo)"/> 23 </div> <!-- toc --> 10 tal:define="start pageinfo/start; tocsize docinfo/tocSize_text; grpsize pageinfo/tocPageSize; 11 batch python:here.getBatch(start=start,size=grpsize,end=tocsize);"> 12 <ul class="switcher"> 13 <li><a 14 tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a> 15 </li> 16 <li class="sel" 17 tal:condition="python:docpath and docinfo.get('numTocEntries', None)"> 18 <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a> 19 </li> 20 <li 21 tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"> 22 <a 23 tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a> 24 </li> 25 <li><a 26 tal:attributes="href python:here.getLink('tocMode','none')">None</a> 27 </li> 28 </ul> 29 <div class="ruler"> 30 <form class="autosubmit" tal:attributes="action viewerUrl"> 31 <input type="hidden" 32 tal:define="params python:here.getParams('start', None)" 33 tal:repeat="param params" 34 tal:attributes="name param; value python:params[param]" /> 35 <a tal:condition="batch/prevStart" 36 tal:attributes="href python:here.getLink('start',batch['prevStart'])"><</a> 37 <span tal:condition="not:batch/prevStart"><</span> 38 <select class="autosubmit" name="start"> 39 <option tal:repeat="grp batch/batches" 40 tal:attributes="selected python:(start==grp['start']); value grp/start" 41 tal:content="string:${grp/start} - ${grp/end}" /> 42 </select> 43 <input type="submit" value="Go" /> 44 <a tal:condition="batch/nextStart" 45 tal:attributes="href python:here.getLink('start',batch['nextStart'])">></a> 46 <span tal:condition="not:batch/nextStart">></span> 47 </form> 48 </div> 49 <div class="content" 50 tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" /> 51 </div> 52 <!-- toc --> 24 53 </body> 25 54 </html> -
zpt/toc_thumbs.zpt
r481 r482 39 39 <select class="autosubmit" name="start" 40 40 tal:define="ofs python:test(pageinfo['pageZero'],0,1)"> 41 <tal:block tal:repeat="grp python:range(numgroups)">42 <option tal: define="idx python:max(grp*grpsize+ofs,1)"43 tal:attributes="selected python:start== idx; value idx;"44 tal:content=" python:'%s - %s'%(idx,min((grp+1)*grpsize+ofs-1,numPages))" />41 <tal:block > 42 <option tal:repeat="grp pageBatch/batches" 43 tal:attributes="selected python:start==grp['start']; value grp/start;" 44 tal:content="string:${grp/start} - ${grp/end}" /> 45 45 </tal:block> 46 46 </select>
Note: See TracChangeset
for help on using the changeset viewer.