changeset 590:ed4485d2748e

viewMode "images" changed to "image".
author casties
date Fri, 16 Nov 2012 11:44:21 +0100
parents d8d6975cebcb
children 5850689ecfac
files css/docuviewer.css documentViewer.py zpt/common_template.zpt zpt/layer_image_annotator.zpt zpt/layer_images_annotator.zpt zpt/viewer_image.zpt zpt/viewer_images.zpt
diffstat 7 files changed, 269 insertions(+), 263 deletions(-) [+]
line wrap: on
line diff
--- a/css/docuviewer.css	Thu Nov 15 17:58:14 2012 +0100
+++ b/css/docuviewer.css	Fri Nov 16 11:44:21 2012 +0100
@@ -372,11 +372,11 @@
 /*
  * image page
  */
-div.col.main div.content.images {
+div.col.main div.content.image {
 	background-color: inherit;
 	padding: 0;
 }
-div.col.main div.content.images table {
+div.col.main div.content.image table {
 	border-collapse: collapse; /* for tight digilib */
 }
 
--- a/documentViewer.py	Thu Nov 15 17:58:14 2012 +0100
+++ b/documentViewer.py	Fri Nov 16 11:44:21 2012 +0100
@@ -89,13 +89,13 @@
     # viewMode templates
     viewer_text = PageTemplateFile('zpt/viewer_text', globals())
     viewer_xml = PageTemplateFile('zpt/viewer_xml', globals())
-    viewer_images = PageTemplateFile('zpt/viewer_images', globals())
+    viewer_image = PageTemplateFile('zpt/viewer_image', globals())
     viewer_index = PageTemplateFile('zpt/viewer_index', globals())
     viewer_thumbs = PageTemplateFile('zpt/viewer_thumbs', globals())
     viewer_indexonly = PageTemplateFile('zpt/viewer_indexonly', globals())
     # available layer types (annotator not default)
     builtinLayers = {'text': ['dict','search','gis'],
-                     'xml': None, 'images': None, 'index': ['extended']}
+                     'xml': None, 'image': None, 'index': ['extended']}
     availableLayers = builtinLayers;
     # layer templates
     layer_text_dict = PageTemplateFile('zpt/layer_text_dict', globals())
@@ -103,7 +103,7 @@
     layer_text_annotator = PageTemplateFile('zpt/layer_text_annotator', globals())
     layer_text_gis = PageTemplateFile('zpt/layer_text_gis', globals())
     layer_text_pundit = PageTemplateFile('zpt/layer_text_pundit', globals())
-    layer_images_annotator = PageTemplateFile('zpt/layer_images_annotator', globals())
+    layer_image_annotator = PageTemplateFile('zpt/layer_image_annotator', globals())
     layer_index_extended = PageTemplateFile('zpt/layer_index_extended', globals())
     # toc templates
     toc_thumbs = PageTemplateFile('zpt/toc_thumbs', globals())
@@ -210,14 +210,15 @@
         view it
         @param mode: defines how to access the document behind url 
         @param url: url which contains display information
-        @param viewMode: if images display images, if text display text, default is images (text,images or auto)
+        @param viewMode: image: display images, text: display text, default is auto (try text, else image)
         
         '''
         
         if not hasattr(self, 'template'):
-            # create template folder if it doesn't exist
-            self.manage_addFolder('template')
-            
+            # this won't work
+            logging.error("template folder missing!")
+            return "ERROR: template folder missing!"
+                        
         if not self.digilibBaseUrl:
             self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary"
             
@@ -231,7 +232,7 @@
             if docinfo.has_key("textURL") or docinfo.get('textURLPath',None): #texturl gesetzt und textViewer konfiguriert
                 viewMode="text"
             else:
-                viewMode="images"
+                viewMode="image"
                
         return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)
 
@@ -242,7 +243,7 @@
         show page
         @param url: url which contains display information
         @param mode: defines how to access the document behind url 
-        @param viewMode: 'images': display images, 'text': display text, 'xml': display xml, default is 'auto'
+        @param viewMode: 'image': display images, 'text': display text, 'xml': display xml, default is 'auto'
         @param viewLayer: sub-type of viewMode, e.g. layer 'dict' for viewMode='text'
         @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none)
         """
@@ -279,13 +280,18 @@
                     # use layer dict as default 
                     viewLayer = "dict"
             else:
-                viewMode = "images"
+                viewMode = "image"
                 
         elif viewMode == "text_dict":
             # legacy fix
             viewMode = "text"
             viewLayer = "dict"
             
+        elif viewMode == 'images':
+            # legacy fix
+            viewMode = 'image'
+            self.REQUEST['viewMode'] = 'image'
+
         # safe viewLayer in userinfo
         userinfo['viewLayer'] = viewLayer
                 
@@ -404,7 +410,7 @@
         if newLayerString is not None:
             try:
                 layers = json.loads(newLayerString)
-                if 'text' in layers and 'images' in layers:
+                if 'text' in layers and 'image' in layers:
                     self.availableLayers = layers
                     return
             except:
--- a/zpt/common_template.zpt	Thu Nov 15 17:58:14 2012 +0100
+++ b/zpt/common_template.zpt	Fri Nov 16 11:44:21 2012 +0100
@@ -27,8 +27,8 @@
       <ul class="view-switcher" metal:define-slot="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="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'image')"><a
+          tal:omit-tag="python:viewMode=='image'" tal:attributes="href python:here.getLink('viewMode','image')">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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/layer_image_annotator.zpt	Fri Nov 16 11:44:21 2012 +0100
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
+  <!--  annotator for digilib -->
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
+  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
+  <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>
+
+  <script type="text/javascript" 
+    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
+    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
+    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
+    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
+    global annUser python:here.getAuthenticatedUser(anon='anonymous');
+    global annGroup python:request.get('annotator_group', None);
+    permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
+    tal:content="structure string:
+    dlOpts.digilibFrontendPath='/jquery/digilib-ann.html';
+    dlOpts.annotationServerUrl='$annServerUrl/annotator';
+    dlOpts.annotationTokenUrl='$annTokenUrl';
+    dlOpts.annotationUser='$annUser';
+    dlOpts.annotatorPlugins=['Auth','Permissions','Store','Markdown','DigilibIntegrator'];
+    dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
+        'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
+    "></script>
+</metal:block>
+
+</head>
+<body>
+  <!-- right-side options -->
+  <div class="col buttons">
+    <!-- LAYER DISPLAY OPTION  -->
+    <ul>
+      <li metal:define-macro="layer_select_li">
+        <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
+          tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
+      </li>
+    </ul>
+  </div>
+
+  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
+    <!-- BEGIN ANNOTATIONS -->
+    <div class="options">
+      <h4>Annotator</h4>
+      <ul>
+        <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
+            tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
+        </a></li>
+        <li><a href="javascript:$digilib.digilib('setAnnotationRegion')"> <img tal:condition="exists:here/template/annotation-region.png"
+            tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate region
+        </a></li>
+      </ul>
+      <p>
+        User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
+      </p>
+      <!-- TODO: login button -->
+      <form class="autosubmit" tal:attributes="action viewerUrl">
+        <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
+          tal:attributes="name param; value python:params[param]" />
+        <p>
+          In group
+          <select class="autosubmit" name="annotator_group">
+            <option value="" tal:attributes="selected not:annGroup;"> </option>
+            <option
+              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
+              tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
+          </select> <br /> 
+          <input type="submit" value="Go!" />
+        </p>
+      </form>
+      <p tal:define="std modules/Products.PythonScripts.standard">
+        <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
+      </p>
+    </div>
+    <!-- END ANNOTATIONS -->
+  </metal:block>
+
+</body>
+
+</html>
--- a/zpt/layer_images_annotator.zpt	Thu Nov 15 17:58:14 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers">
-  <!--  annotator for digilib -->
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/showdown.js"></script>
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/annotator-dl.js"></script>
-  <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.annotator.js"></script>
-  <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/annotator.min.css"/>
-
-  <script type="text/javascript" 
-    tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager;
-    global annTokenUrl string:$viewerUrl/template/token/getLoginToken;
-    annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']);
-    resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']);
-    global annUser python:here.getAuthenticatedUser(anon='anonymous');
-    global annGroup python:request.get('annotator_group', None);
-    permUser python:test(annGroup, 'group:%s'%annGroup, annUser);"
-    tal:content="structure string:
-    dlOpts.digilibFrontendPath='/jquery/digilib-ann.html';
-    dlOpts.annotationServerUrl='$annServerUrl/annotator';
-    dlOpts.annotationTokenUrl='$annTokenUrl';
-    dlOpts.annotationUser='$annUser';
-    dlOpts.annotatorPlugins=['Auth','Permissions','Store','Markdown','DigilibIntegrator'];
-    dlOpts.annotatorPluginSettings={'Store':{'annotationData':{'uri':'$annUrl','resource':'$resUrl'},'loadFromSearch':{'uri':'$annUrl'}},
-        'Permissions':{'read':[],'update':['$permUser'],'delete':['$permUser'],'admin':['$permUser']}};
-    "></script>
-</metal:block>
-
-</head>
-<body>
-  <!-- right-side options -->
-  <div class="col buttons">
-    <!-- LAYER DISPLAY OPTION  -->
-    <ul>
-      <li metal:define-macro="layer_select_li">
-        <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator"
-          tal:attributes="checked python:'annotator' in viewLayers" /> Annotator
-      </li>
-    </ul>
-  </div>
-
-  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
-    <!-- BEGIN ANNOTATIONS -->
-    <div class="options">
-      <h4>Annotator</h4>
-      <ul>
-        <li><a href="javascript:$digilib.digilib('setAnnotationMark')"> <img tal:condition="exists:here/template/annotation-mark.png"
-            tal:attributes="src here/template/annotation-mark.png/absolute_url" /> annotate point
-        </a></li>
-        <li><a href="javascript:$digilib.digilib('setAnnotationRegion')"> <img tal:condition="exists:here/template/annotation-region.png"
-            tal:attributes="src here/template/annotation-region.png/absolute_url" /> annotate region
-        </a></li>
-      </ul>
-      <p>
-        User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>.
-      </p>
-      <!-- TODO: login button -->
-      <form class="autosubmit" tal:attributes="action viewerUrl">
-        <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params"
-          tal:attributes="name param; value python:params[param]" />
-        <p>
-          In group
-          <select class="autosubmit" name="annotator_group">
-            <option value="" tal:attributes="selected not:annGroup;"> </option>
-            <option
-              tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)"
-              tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" />
-          </select> <br /> 
-          <input type="submit" value="Go!" />
-        </p>
-      </form>
-      <p tal:define="std modules/Products.PythonScripts.standard">
-        <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a>
-      </p>
-    </div>
-    <!-- END ANNOTATIONS -->
-  </metal:block>
-
-</body>
-
-</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/viewer_image.zpt	Fri Nov 16 11:44:21 2012 +0100
@@ -0,0 +1,165 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
+              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
+              availableLayers python:here.getAvailableLayers().get('image', None);
+              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
+              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
+<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script>
+<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script>
+<link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" />
+
+<script type="text/javascript"
+  tal:content="python:'''\n
+       var dlOpts = {\n
+            'interactionMode' : 'fullscreen',\n
+            'digilibBaseUrl' : '%s',\n
+            'fn' : '%s',\n
+            'pn' : '%s',\n
+            'suppressParamNames' : ['fn'],\n
+            'scalerInsets' : {'x':300, 'y':100}\n
+        };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
+
+<!--  layer headers (rendered always) -->
+<tal:block tal:repeat="layer availableLayers">
+  <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
+    <metal:block metal:use-macro="python:path(mpath)" />
+  </tal:block>
+</tal:block>
+
+<script type="text/javascript">
+	// <!--
+	$(document).ready(function() {
+		// autosubmit forms
+		$('form.autosubmit').find('.autosubmit').change(function() {
+			this.form.submit();
+		});
+		$('form.autosubmit input[type="submit"]').hide();
+		// get digilib div
+		$digilib = $('div#scaler');
+		// configure digilib
+		$digilib.digilib(dlOpts);
+	});
+// -->
+</script>
+</head>
+<body tal:condition="numPages">
+  <tal:block
+    tal:define="docpath docinfo/textURLPath | nothing;
+              pn pageinfo/pn; 
+              flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';">
+    <div class="page-head">
+      <metal:block metal:use-macro="here/template/common_template/macros/head" />
+    </div>
+    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
+      <!-- table of contents -->
+      <div class="col toc">
+        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
+      </div>
+      <!-- col-main: document page -->
+      <div class="col main">
+        <div class="ruler top">
+          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
+        </div>
+        <div class="content image">
+          <div id="scaler">
+            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
+          </div>
+        </div>
+        <!-- /content -->
+      </div>
+      <!-- /col-main -->
+      
+      <div class="col buttons">
+        <!-- layer switcher -->
+        <div class="options" tal:condition="availableLayers">
+          <h4>Image layer</h4>
+          <form tal:attributes="action viewerUrl" class="autosubmit">
+            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
+              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
+            <ul>
+              <!-- layer select buttons (rendered always) -->
+              <tal:block tal:repeat="layer availableLayers">
+                <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/layer_select_li"
+                  tal:condition="python:exists(mpath)">
+                  <li metal:use-macro="python:path(mpath)" />
+                </tal:block>
+              </tal:block>
+            </ul>
+            <input type="submit" value="Go!" />
+          </form>
+        </div>
+
+        <!-- digilib options -->
+        <div class="options digilib">
+          <ul>
+            <li><a href="javascript:$digilib.digilib('zoomBy', 1.4)"> <img tal:condition="exists:here/template/zoom-in.png"
+                tal:attributes="src here/template/zoom-in.png/absolute_url" /> zoom in
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomBy', 0.7)"> <img
+                tal:condition="exists:here/template/zoom-out.png" tal:attributes="src here/template/zoom-out.png/absolute_url" />
+                zoom out
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomArea')"> <img tal:condition="exists:here/template/zoom-area.png"
+                tal:attributes="src here/template/zoom-area.png/absolute_url" /> zoom area
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomFull')"> <img tal:condition="exists:here/template/zoom-full.png"
+                tal:attributes="src here/template/zoom-full.png/absolute_url" /> full page
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('zoomFull', 'width')"> <img
+                tal:condition="exists:here/template/pagewidth.png" tal:attributes="src here/template/pagewidth.png/absolute_url" /> page
+                width
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('setMark')"> <img tal:condition="exists:here/template/mark.png"
+                tal:attributes="src here/template/mark.png/absolute_url" /> set mark
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('removeMark')"> <img tal:condition="exists:here/template/delmark.png"
+                tal:attributes="src here/template/delmark.png/absolute_url" /> remove mark
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('reference')"> <img tal:condition="exists:here/template/reference.png"
+                tal:attributes="src here/template/reference.png/absolute_url" /> get reference
+            </a></li>
+            <li><a href="javascript:$digilib.digilib('digilibUrl', 'open_new')"> <img
+                tal:condition="exists:here/template/digilib.png" tal:attributes="src here/template/digilib.png/absolute_url" />
+                digilib
+            </a></li>
+          </ul>
+        </div>
+
+        <!--  layer option boxes (rendered if active) -->
+        <tal:block tal:repeat="layer availableLayers">
+          <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/options_box"
+            tal:condition="python:exists(mpath)">
+            <metal:block metal:use-macro="python:path(mpath)" />
+          </tal:block>
+        </tal:block>
+      </div>
+    </div><!-- /page-body -->
+    
+    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
+      <div class="errortext">Sorry, access to this document is restricted.</div>
+    </div>
+    <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
+      <!-- footer -->
+      <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
+    </tal:block>
+    
+  </tal:block>
+</body>
+<body tal:condition="not:numPages">
+  <div class="errortext">Sorry, document doesn't exist.</div>
+  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
+    <!-- footer -->
+    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
+  </tal:block>
+</body>
+</html>
--- a/zpt/viewer_images.zpt	Thu Nov 15 17:58:14 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
-              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
-              availableLayers python:here.getAvailableLayers().get('images', None);
-              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
-              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
-<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script>
-<script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script>
-<link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" />
-
-<script type="text/javascript"
-  tal:content="python:'''\n
-       var dlOpts = {\n
-            'interactionMode' : 'fullscreen',\n
-            'digilibBaseUrl' : '%s',\n
-            'fn' : '%s',\n
-            'pn' : '%s',\n
-            'suppressParamNames' : ['fn'],\n
-            'scalerInsets' : {'x':300, 'y':100}\n
-        };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
-
-<!--  layer headers (rendered always) -->
-<tal:block tal:repeat="layer availableLayers">
-  <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
-    <metal:block metal:use-macro="python:path(mpath)" />
-  </tal:block>
-</tal:block>
-
-<script type="text/javascript">
-	// <!--
-	$(document).ready(function() {
-		// autosubmit forms
-		$('form.autosubmit').find('.autosubmit').change(function() {
-			this.form.submit();
-		});
-		$('form.autosubmit input[type="submit"]').hide();
-		// get digilib div
-		$digilib = $('div#scaler');
-		// configure digilib
-		$digilib.digilib(dlOpts);
-	});
-// -->
-</script>
-</head>
-<body tal:condition="numPages">
-  <tal:block
-    tal:define="docpath docinfo/textURLPath | nothing;
-              pn pageinfo/pn; 
-              flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';">
-    <div class="page-head">
-      <metal:block metal:use-macro="here/template/common_template/macros/head" />
-    </div>
-    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
-      <!-- table of contents -->
-      <div class="col toc">
-        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
-      </div>
-      <!-- col-main: document page -->
-      <div class="col main">
-        <div class="ruler top">
-          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
-        </div>
-        <div class="content images">
-          <div id="scaler">
-            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
-          </div>
-        </div>
-        <!-- /content -->
-      </div>
-      <!-- /col-main -->
-      
-      <div class="col buttons">
-        <!-- layer switcher -->
-        <div class="options" tal:condition="availableLayers">
-          <h4>Image layer</h4>
-          <form tal:attributes="action viewerUrl" class="autosubmit">
-            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
-              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
-            <ul>
-              <!-- layer select buttons (rendered always) -->
-              <tal:block tal:repeat="layer availableLayers">
-                <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/layer_select_li"
-                  tal:condition="python:exists(mpath)">
-                  <li metal:use-macro="python:path(mpath)" />
-                </tal:block>
-              </tal:block>
-            </ul>
-            <input type="submit" value="Go!" />
-          </form>
-        </div>
-
-        <!-- digilib options -->
-        <div class="options digilib">
-          <ul>
-            <li><a href="javascript:$digilib.digilib('zoomBy', 1.4)"> <img tal:condition="exists:here/template/zoom-in.png"
-                tal:attributes="src here/template/zoom-in.png/absolute_url" /> zoom in
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomBy', 0.7)"> <img
-                tal:condition="exists:here/template/zoom-out.png" tal:attributes="src here/template/zoom-out.png/absolute_url" />
-                zoom out
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomArea')"> <img tal:condition="exists:here/template/zoom-area.png"
-                tal:attributes="src here/template/zoom-area.png/absolute_url" /> zoom area
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomFull')"> <img tal:condition="exists:here/template/zoom-full.png"
-                tal:attributes="src here/template/zoom-full.png/absolute_url" /> full page
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('zoomFull', 'width')"> <img
-                tal:condition="exists:here/template/pagewidth.png" tal:attributes="src here/template/pagewidth.png/absolute_url" /> page
-                width
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('setMark')"> <img tal:condition="exists:here/template/mark.png"
-                tal:attributes="src here/template/mark.png/absolute_url" /> set mark
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('removeMark')"> <img tal:condition="exists:here/template/delmark.png"
-                tal:attributes="src here/template/delmark.png/absolute_url" /> remove mark
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('reference')"> <img tal:condition="exists:here/template/reference.png"
-                tal:attributes="src here/template/reference.png/absolute_url" /> get reference
-            </a></li>
-            <li><a href="javascript:$digilib.digilib('digilibUrl', 'open_new')"> <img
-                tal:condition="exists:here/template/digilib.png" tal:attributes="src here/template/digilib.png/absolute_url" />
-                digilib
-            </a></li>
-          </ul>
-        </div>
-
-        <!--  layer option boxes (rendered if active) -->
-        <tal:block tal:repeat="layer availableLayers">
-          <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/options_box"
-            tal:condition="python:exists(mpath)">
-            <metal:block metal:use-macro="python:path(mpath)" />
-          </tal:block>
-        </tal:block>
-      </div>
-    </div><!-- /page-body -->
-    
-    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
-      <div class="errortext">Sorry, access to this document is restricted.</div>
-    </div>
-    <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
-      <!-- footer -->
-      <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
-    </tal:block>
-    
-  </tal:block>
-</body>
-<body tal:condition="not:numPages">
-  <div class="errortext">Sorry, document doesn't exist.</div>
-  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
-    <!-- footer -->
-    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
-  </tal:block>
-</body>
-</html>