diff zpt/common_template.zpt @ 536:abd36d4d97b8

new version of index page. improvements for digilib page and thumbnail overview.
author casties
date Thu, 26 Jul 2012 21:22:56 +0200
parents 510bae2b593b
children 6cdc31e9ed8e
line wrap: on
line diff
--- a/zpt/common_template.zpt	Thu Jul 26 19:32:31 2012 +0200
+++ b/zpt/common_template.zpt	Thu Jul 26 21:22:56 2012 +0200
@@ -12,30 +12,31 @@
                 bib docinfo/bib | nothing; bibType docinfo/bibType | nothing;
                 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);">
     <div class="logo" tal:condition="exists:here/template/logo.png">
-      <img tal:attributes="src here/template/logo.png/absolute_url"/>
+      <img tal:attributes="src here/template/logo.png/absolute_url" />
     </div>
     <div class="title-block">
-    <div class="title" tal:condition="not:formattedLabel">
-      <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">
-        <i tal:content="docinfo/creator" />,
+      <div class="title" tal:condition="not:formattedLabel">
+        <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">
+          <i tal:content="docinfo/creator" />,
         <span tal:content="docinfo/title" />, <span tal:content="docinfo/date" />
-      </tal:block>
-      <span tal:condition="not:python:docinfo['creator'] or docinfo['title']"
-        tal:content="string:[no bibliographical information for this document (type ${bibType})]" />
-    </div>
-    <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" />
-    <ul class="view-switcher">
-      <li tal:attributes="class python:here.getStyle(viewMode, 'text')"><a tal:omit-tag="python:viewMode=='text'"
-        tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li>
-      <li tal:attributes="class python:here.getStyle(viewMode, 'images')"><a tal:omit-tag="python:viewMode=='images'"
-        tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li>
-      <li tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a tal:omit-tag="python:viewMode=='xml'"
-        tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li>
-      <li tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a tal:omit-tag="python:viewMode=='thumbs'"
-        tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a></li>
-      <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'"
-        tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li>
-    </ul>
+        </tal:block>
+        <span tal:condition="not:python:docinfo['creator'] or docinfo['title']"
+          tal:content="string:[no bibliographical information for this document (type ${bibType})]" />
+      </div>
+      <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" />
+      <ul class="view-switcher">
+        <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'text')"><a
+          tal:omit-tag="python:viewMode=='text'" tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li>
+        <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'images')"><a
+          tal:omit-tag="python:viewMode=='images'" tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li>
+        <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a
+          tal:omit-tag="python:viewMode=='xml'" tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li>
+        <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a
+          tal:omit-tag="python:viewMode=='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail
+            overview</a></li>
+        <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'"
+          tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li>
+      </ul>
     </div>
   </metal:block>
   <!-- /head -->
@@ -50,20 +51,21 @@
               leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
     <form class="autosubmit" tal:attributes="action viewerUrl">
       <input type="hidden" tal:define="params python:here.getParams('pn', None)" tal:repeat="param params"
-        tal:attributes="name param; value python:params[param]" />
-        <span class="ruler-main">page <a tal:condition="leftest"
+        tal:attributes="name param; value python:params[param]" /> <span class="ruler-main">page <a tal:condition="leftest"
         tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span tal:condition="not:leftest">|&lt;</span> <a
         tal:condition="left" tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span tal:condition="not:left">&lt;</span>
         <input class="autosubmit" size="3" type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
         title="Original page number" tal:define="originalPage pageinfo/pageNumberOrig | nothing"
         tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span
           tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None">
-            [<span tal:replace="originalPageNorm" />]</span>)
-        </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right"
+            [<span tal:replace="originalPageNorm" />]
+        </span>)
+      </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right"
         tal:attributes="href python:here.getLink('pn',right)">&gt;</a> <span tal:condition="not:right">&gt;</span> <a
         tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
         tal:condition="not:rightest">&gt;|</span>
-      </span> <!-- ruler-main -->
+      </span>
+      <!-- ruler-main -->
     </form>
   </metal:block>
   <!-- /ruler -->
@@ -86,38 +88,38 @@
   <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]" /> <a tal:condition="left"
+        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
         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']; value grp/start;"
-            tal:content="string:${grp/start} - ${grp/end}" />
-        </tal:block>
+          <tal:block>
+            <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:start==grp['start']; value grp/start;"
+              tal:content="string:${grp/start} - ${grp/end}" />
+          </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 tal:condition="not:right">&gt;</span></span>
     </form>
   </metal:block>
 
   <!-- toc type switcher -->
   <metal:block metal:define-macro="toc_switcher">
-  <div class="toc-switcher-col">
-    <div class="toc-switcher">
-      <ul>
-        <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a tal:omit-tag="python:tocMode=='none'"
-            tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li>
-        <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')"
-          tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a
-            tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>
-        <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"
-          tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a
-            tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li>
-        <li tal:attributes="class python:here.getStyle(tocMode, 'text')"
-          tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a
-            tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li>
-        <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a
-            tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li>
-      </ul>
-    </div>
+    <div class="toc-switcher-col">
+      <div class="toc-switcher">
+        <ul>
+          <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a
+              tal:omit-tag="python:tocMode=='none'" tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li>
+          <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')"
+            tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a
+              tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>
+          <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"
+            tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a
+              tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li>
+          <li tal:attributes="class python:here.getStyle(tocMode, 'text')"
+            tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a
+              tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li>
+          <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a
+              tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li>
+        </ul>
+      </div>
     </div>
   </metal:block>