Changeset 482:7ca8ac7db06e in documentViewer for zpt/toc_figures.zpt


Ignore:
Timestamp:
Aug 16, 2011, 4:27:08 PM (13 years ago)
Author:
casties
Branch:
elementtree
Message:

more new template stuff. more batching methods in documentViewer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zpt/toc_figures.zpt

    r481 r482  
    88  <!-- block used for main content area -->
    99  <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);">
    1212    <ul class="switcher">
    1313      <li><a
     
    1818        <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a>
    1919      </li>
    20       <li
     20      <li class="sel"
    2121        tal:condition="python:docpath and docinfo.get('numFigureEntries', None)">
    2222        <a
     
    3030      <form class="autosubmit" tal:attributes="action viewerUrl">
    3131        <input type="hidden"
    32           tal:define="params python:here.getParams('tocPN', None)"
     32          tal:define="params python:here.getParams('start', None)"
    3333          tal:repeat="param params"
    3434          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)">&lt;</a>
    37         <span tal:condition="python:(pn<=1)">&lt;</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'])">&lt;</a>
     37        <span tal:condition="not:batch/prevStart">&lt;</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}" />
    4242        </select>
    4343        <input type="submit" value="Go" />
    44         <a tal:condition="python:(pn<maxpn)"
    45           tal:attributes="href python:here.getLink('tocPN',pn+1)">&gt;</a>
    46         <span tal:condition="python:(pn>=maxpn)">&gt;</span>
     44        <a tal:condition="batch/nextStart"
     45          tal:attributes="href python:here.getLink('start',batch['nextStart'])">&gt;</a>
     46        <span tal:condition="not:batch/nextStart">&gt;</span>
    4747      </form>
    4848    </div>
    4949    <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)" />
    5151  </div>
    5252  <!-- toc -->
Note: See TracChangeset for help on using the changeset viewer.