Changeset 607:cb5a9c4f5e3a in documentViewer for zpt


Ignore:
Timestamp:
Dec 14, 2012, 10:28:31 PM (11 years ago)
Author:
casties
Branch:
default
Message:

CLOSED - # 268: display of subdocuments
https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/268

Location:
zpt/viewer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zpt/viewer/common_template.zpt

    r594 r607  
    4545  <!-- page ruler with previous/next page buttons -->
    4646  <metal:block metal:define-macro="page_ruler"
    47     tal:define="
    48               prev python:test(pn>1,pn-1,None); next python:test(pn<numPages,pn+1,None);
    49               first python:test(pn>1,1,None); last python:test(pn<numPages,numPages,None);
     47    tal:define="minPageNo docinfo/minPageNo; maxPageNo docinfo/maxPageNo;
     48              prev python:test(pn>minPageNo,pn-1,None); next python:test(pn<maxPageNo,pn+1,None);
     49              first python:test(pn>minPageNo,minPageNo,None); last python:test(pn<maxPageNo,maxPageNo,None);
    5050              left python:test(flowLtr,prev,next); right python:test(flowLtr,next,prev);
    5151              leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
     
    9090    <form class="autosubmit" tal:attributes="action viewerUrl">
    9191      <input type="hidden" tal:define="params python:here.getParams('start',None)" tal:repeat="param params"
    92         tal:attributes="name param; value python:params[param]" /><span class="ruler-main"><a tal:condition="left"
    93         tal:attributes="href python:here.getLink('start',left)">&lt;</a> <span tal:condition="not:left">&lt;</span> <select
     92        tal:attributes="name param; value python:params[param]" /><span class="ruler-main"><a tal:omit-tag="not:left"
     93        tal:attributes="href python:here.getLink('start',left)">&lt;</a> <select
    9494        class="autosubmit" name="start" tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
    9595          <tal:block>
     
    9898            <option tal:condition="python:start>pageBatch['last']" selected="selected" value="1">[out of range]</option>
    9999          </tal:block>
    100       </select> <input type="submit" value="Go" /> <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
    101         <span tal:condition="not:right">&gt;</span></span>
     100      </select> <input type="submit" value="Go" /> <a tal:omit-tag="not:right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
     101      </span>
    102102    </form>
    103103  </metal:block>
  • zpt/viewer/toc_thumbs.zpt

    r594 r607  
    1111    <div class="tocbody thumbs"
    1212      tal:define="start pageinfo/start;
     13                minPageNo docinfo/minPageNo;
     14                maxPageNo docinfo/maxPageNo;
    1315                grpsize pageinfo/groupsize;
    1416                numgroups pageinfo/numgroups;
     
    2628          <tr tal:repeat="row pageBatch/pages">
    2729            <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a
    28               tal:define="idx thumb/idx" tal:condition="idx" tal:attributes="href python:here.getLink('pn',idx)"> <img
     30              tal:define="idx thumb/idx" tal:condition="idx"
     31              tal:attributes="href python:here.getLink('pn',idx); class python:test(idx<minPageNo or idx>maxPageNo, 'outside')"><img
     32                tal:condition="python:docinfo.get('imageURL',None) or exists('template/text.png')"
    2933                tal:attributes="src python:test(docinfo.get('imageURL',None),here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'template/text.png');
    3034                                alt idx;" /><br />
  • zpt/viewer/viewer_thumbs.zpt

    r594 r607  
    2727    tal:define="pn pageinfo/pn;
    2828                start pageinfo/start;
     29                minPageNo docinfo/minPageNo;
     30                maxPageNo docinfo/maxPageNo;
    2931                thumbRows python:int(request.get('thumbRows', 10));
    3032                thumbCols python:int(request.get('thumbCols', 12));
    3133                thumbSize python:int(request.get('thumbSize', 100));
    3234                flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
    33                 pageBatch python:here.getPageBatch(start=start, rows=thumbRows, cols=thumbCols, pageFlowLtr=flowLtr, maxIdx=numPages);
     35                pageBatch python:here.getPageBatch(start=start, rows=thumbRows, cols=thumbCols, pageFlowLtr=flowLtr, minIdx=minPageNo, maxIdx=maxPageNo);
    3436                pageNumbers docinfo/pageNumbers | nothing;
    3537                left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']);
Note: See TracChangeset for help on using the changeset viewer.