changeset 538:dbf25bd05fc6

digilib buttons get icons. pid on index page.
author casties
date Mon, 30 Jul 2012 19:41:48 +0200
parents ad6f97fd3944
children 37d122560028
files css/docuviewer.css documentViewer.py zpt/viewer_images.zpt zpt/viewer_index.zpt
diffstat 4 files changed, 123 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/css/docuviewer.css	Fri Jul 27 17:09:59 2012 +0200
+++ b/css/docuviewer.css	Mon Jul 30 19:41:48 2012 +0200
@@ -232,6 +232,10 @@
     margin-bottom: 0.5em;
 }
 
+div.options.digilib li img {
+	vertical-align: middle;
+}
+
 /*
  * search results
  */
--- a/documentViewer.py	Fri Jul 27 17:09:59 2012 +0200
+++ b/documentViewer.py	Mon Jul 30 19:41:48 2012 +0200
@@ -568,14 +568,18 @@
             if attribution:
                 logging.debug("getDocinfo: attribution=%s"%repr(attribution))
                 docinfo['attribution'] = attribution
-                #docinfo = self.getDocinfoFromAccess(docinfo, access)
 
             # copyright info
             copyright = self.metadataService.getCopyrightData(dom=metaDom)
             if copyright:
                 logging.debug("getDocinfo: copyright=%s"%repr(copyright))
                 docinfo['copyright'] = copyright
-                #docinfo = self.getDocinfoFromAccess(docinfo, access)
+
+            # DRI (permanent ID)
+            dri = self.metadataService.getDRI(dom=metaDom, type='escidoc-test')
+            if dri:
+                logging.debug("getDRI: dri=%s"%repr(dri))
+                docinfo['DRI'] = dri
 
         # image path
         if mode != 'texttool':
--- a/zpt/viewer_images.zpt	Fri Jul 27 17:09:59 2012 +0200
+++ b/zpt/viewer_images.zpt	Mon Jul 30 19:41:48 2012 +0200
@@ -70,34 +70,39 @@
       </div>
       <!-- /col-main -->
       <div class="col buttons">
-        <div class="digilib-buttons">
-          <div>
-            <a href="javascript:$digilib.digilib('zoomBy', 1.4)">zoom in</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('zoomBy', 0.7)">zoom out</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('zoomArea')">zoom area</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('zoomFull')">full page</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('zoomFull', 'width')">page width</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('setMark')">set mark</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('removeMark')">remove mark</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('reference')">get reference</a>
-          </div>
-          <div>
-            <a href="javascript:$digilib.digilib('digilibUrl', 'open_new')">digilib</a>
-          </div>
+        <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>
       </div>
     </div>
--- a/zpt/viewer_index.zpt	Fri Jul 27 17:09:59 2012 +0200
+++ b/zpt/viewer_index.zpt	Mon Jul 30 19:41:48 2012 +0200
@@ -16,85 +16,99 @@
   <div class="page-head">
     <metal:block metal:use-macro="here/template/common_template/macros/head" />
   </div>
-  
+
   <!-- main -->
   <div class="page-body">
 
-  <div class="col index-image">
-    <!-- image -->
-    <a tal:define="tp docinfo/titlePage | nothing" tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img
-      tal:condition="tp" border="0" tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img
-      tal:condition="python:not tp and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
-  </div>
+    <div class="col index-image">
+      <!-- image -->
+      <a tal:define="tp docinfo/titlePage | nothing"
+        tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img tal:condition="tp" border="0"
+        tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img
+        tal:condition="python:not tp and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
+    </div>
 
-  <div class="col">
-  <div class="index-info">
-    <table border="0"
-      tal:define="formattedData python:here.metadata.getBibFormattedMetaDataExtended(bibdata=docinfo.get('bib', None))">
-      <tal:x condition="python:formattedData">
-        <!-- wenn es bibinfo in docinfo gibt -->
-        <tr tal:replace="structure python:formattedData" />
-      </tal:x>
+    <div class="col">
+      <div class="index-info">
+        <table border="0"
+          tal:define="formattedData python:here.metadata.getBibFormattedMetaDataExtended(bibdata=docinfo.get('bib', None))">
+          <tal:x condition="python:formattedData">
+            <!-- wenn es bibinfo in docinfo gibt -->
+            <tr tal:replace="structure python:formattedData" />
+          </tal:x>
 
-      <tal:x condition="not:formattedData">
-        <!-- kein template fuer die daten -->
-        <tal:x condition="exists:docinfo/bib">
-          <tr tal:define="bibinfo docinfo/bib" tal:repeat="bib bibinfo">
-            <td class="type" tal:content="python:bib.capitalize().replace('_',' ') + ':'" />
-            <td class="content" tal:content="bibinfo/bib" />
-          </tr>
-        </tal:x>
+          <tal:x condition="not:formattedData">
+            <!-- kein template fuer die daten -->
+            <tal:x condition="exists:docinfo/bib">
+              <tr tal:define="bibinfo docinfo/bib" tal:repeat="bib bibinfo">
+                <td class="type" tal:content="python:bib.capitalize().replace('_',' ') + ':'" />
+                <td class="content" tal:content="bibinfo/bib" />
+              </tr>
+            </tal:x>
 
-        <tal:y condition="not:exists:docinfo/bib">
-          <!-- wenn es kein bibinfo gibt (archimedes-texte) -->
+            <tal:y condition="not:exists:docinfo/bib">
+              <!-- wenn es kein bibinfo gibt (archimedes-texte) -->
+              <tr>
+                <td class="type">Author:</td>
+                <td class="content" tal:content="docinfo/creator" />
+              </tr>
+              <tr>
+                <td class="type">Title:</td>
+                <td class="content" tal:content="docinfo/title" />
+              </tr>
+              <tr>
+                <td class="type">Date:</td>
+                <td class="content" tal:content="docinfo/date" />
+              </tr>
+            </tal:y>
+          </tal:x>
+          <!-- ende kein template fuer die daten -->
+        </table>
+
+        <table tal:define="dri docinfo/DRI | nothing" tal:condition="dri">
           <tr>
-            <td class="type">Author:</td>
-            <td class="content" tal:content="docinfo/creator" />
-          </tr>
-          <tr>
-            <td class="type">Title:</td>
-            <td class="content" tal:content="docinfo/title" />
+            <td class="type">Document ID:</td>
+            <td class="content" tal:content="dri" />
           </tr>
           <tr>
-            <td class="type">Date:</td>
-            <td class="content" tal:content="docinfo/date" />
+            <td class="type">Permanent URL:</td>
+            <td class="content"><a tal:attributes="href string:http://echo.mpiwg-berlin.mpg.de/$dri"
+              tal:content="string:http://echo.mpiwg-berlin.mpg.de/$dri" /></td>
           </tr>
-        </tal:y>
-      </tal:x>
-      <!-- ende kein template fuer die daten -->
-    </table>
+        </table>
 
-    <table border="0">
-      <!-- attribution -->
-      <tr tal:condition="exists:docinfo/attribution"
-        tal:replace="structure python:here.metadataService.getAttributionFormatted('metadata_template', data=docinfo['attribution'])" />
-      <!-- copyright -->
-      <tr tal:condition="exists:docinfo/copyright"
-        tal:replace="structure python:here.metadataService.getCopyrightFormatted('metadata_template', data=docinfo['copyright'])" />
-    </table>
-  </div>
+        <table border="0">
+          <!-- attribution -->
+          <tr tal:condition="exists:docinfo/attribution"
+            tal:replace="structure python:here.metadataService.getAttributionFormatted('metadata_template', data=docinfo['attribution'])" />
+          <!-- copyright -->
+          <tr tal:condition="exists:docinfo/copyright"
+            tal:replace="structure python:here.metadataService.getCopyrightFormatted('metadata_template', data=docinfo['copyright'])" />
+        </table>
+      </div>
 
-  <div class="index-actions">
-    <div class="action">
-      <a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">&#8594;Browse document</a>
-    </div>
-    <div class="action" tal:condition="docpath">
-      Download full document as <a
-        tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath.replace('.xml','.html'))"
-        target="_blank">&#8594;HTML</a> or <a
-        tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">&#8594;XML</a>
+      <div class="index-actions">
+        <div class="action">
+          <a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">&#8594;Browse document</a>
+        </div>
+        <div class="action" tal:condition="docpath">
+          Download full document as <a
+            tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath.replace('.xml','.html'))"
+            target="_blank">&#8594;HTML</a> or <a
+            tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">&#8594;XML</a>
+        </div>
+        <div class="action">
+          <!--BEGIN search -->
+          <form tal:condition="docpath" tal:attributes="action python:here.getLink()">
+            <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" tal:repeat="param params"
+              tal:attributes="name param; value python:params[param]" /> <input class="textMain" name="query"
+              onfocus="this.select();" type="text" tal:attributes="value query" /> <input type="submit" class="buttonMain"
+              value="Search in Book" />
+          </form>
+          <!-- END search-->
+        </div>
+      </div>
     </div>
-    <div class="action">
-      <!--BEGIN search -->
-      <form tal:condition="docpath" tal:attributes="action python:here.getLink()">
-        <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" tal:repeat="param params"
-          tal:attributes="name param; value python:params[param]" /> <input class="textMain" name="query" onfocus="this.select();"
-          type="text" tal:attributes="value query" /> <input type="submit" class="buttonMain" value="Search in Book" />
-      </form>
-      <!-- END search-->
-    </div>
-  </div>
-  </div>
   </div>
 </body>
 <body tal:condition="not:numPages">