diff zpt/viewer/common_template.zpt @ 607:cb5a9c4f5e3a

CLOSED - # 268: display of subdocuments https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/268
author casties
date Fri, 14 Dec 2012 17:28:31 -0500
parents da7daa783df4
children 0c6056271654
line wrap: on
line diff
--- a/zpt/viewer/common_template.zpt	Tue Dec 11 16:33:12 2012 -0500
+++ b/zpt/viewer/common_template.zpt	Fri Dec 14 17:28:31 2012 -0500
@@ -44,9 +44,9 @@
 
   <!-- page ruler with previous/next page buttons -->
   <metal:block metal:define-macro="page_ruler"
-    tal:define="
-              prev python:test(pn>1,pn-1,None); next python:test(pn<numPages,pn+1,None);
-              first python:test(pn>1,1,None); last python:test(pn<numPages,numPages,None);
+    tal:define="minPageNo docinfo/minPageNo; maxPageNo docinfo/maxPageNo;
+              prev python:test(pn>minPageNo,pn-1,None); next python:test(pn<maxPageNo,pn+1,None);
+              first python:test(pn>minPageNo,minPageNo,None); last python:test(pn<maxPageNo,maxPageNo,None);
               left python:test(flowLtr,prev,next); right python:test(flowLtr,next,prev);
               leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
     <form class="autosubmit" tal:attributes="action viewerUrl">
@@ -89,16 +89,16 @@
   <metal:block metal:define-macro="toc_ruler_thumbs">
     <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]" /><span class="ruler-main"><a tal:condition="left"
-        tal:attributes="href python:here.getLink('start',left)">&lt;</a> <span tal:condition="not:left">&lt;</span> <select
+        tal:attributes="name param; value python:params[param]" /><span class="ruler-main"><a tal:omit-tag="not:left"
+        tal:attributes="href python:here.getLink('start',left)">&lt;</a> <select
         class="autosubmit" name="start" tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
           <tal:block>
             <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:(start>=grp['start'] and start<=grp['end']); value grp/start;"
               tal:content="string:${grp/start} - ${grp/end}" />
             <option tal:condition="python:start>pageBatch['last']" selected="selected" value="1">[out of range]</option>
           </tal:block>
-      </select> <input type="submit" value="Go" /> <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
-        <span tal:condition="not:right">&gt;</span></span>
+      </select> <input type="submit" value="Go" /> <a tal:omit-tag="not:right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
+      </span>
     </form>
   </metal:block>