changeset 540:4b43a57ad9b3

more nicer
author casties
date Thu, 16 Aug 2012 19:09:49 +0200
parents 37d122560028
children c4cc01b104d7
files css/docuviewer.css zpt/layer_text_search.zpt zpt/toc_concordance.zpt zpt/toc_figures.zpt zpt/toc_text.zpt zpt/toc_thumbs.zpt zpt/viewer_images.zpt zpt/viewer_index.zpt zpt/viewer_text.zpt zpt/viewer_thumbs.zpt zpt/viewer_xml.zpt
diffstat 11 files changed, 121 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/css/docuviewer.css	Wed Aug 15 16:59:45 2012 +0200
+++ b/css/docuviewer.css	Thu Aug 16 19:09:49 2012 +0200
@@ -126,9 +126,14 @@
 	margin-top: 0;
 	margin-bottom: 0.5em;
 }
-div.tocbody div.ruler {
+div.tocbody div.ruler.top {
 	text-align: center;
-	margin-bottom: 0.5em;
+	padding-bottom: 0.5em;
+}
+div.tocbody div.ruler.bottom {
+	clear: both;
+	text-align: center;
+	padding-top: 0.5em;
 }
 
 div.tocbody.text, 
@@ -196,9 +201,6 @@
 div.col.main div.content {
 	min-width: 30em;
     background-color: white;
-    font-family: Junicode,Gentium,Georgia,serif;
-    font-size: 14px;
-	line-height: 1.3;
 	border: 1px solid silver;
     padding: 1em;
 }
@@ -231,16 +233,41 @@
     margin-top: 0;
     margin-bottom: 0.5em;
 }
-
 div.options.digilib li img {
 	vertical-align: middle;
 }
 
 /*
+ * text page
+ */
+div.col.main div.content.text {
+    font-family: Junicode,Gentium,Georgia,serif;
+    font-size: 14px;
+	line-height: 1.3;
+}
+
+/*
  * search results
  */
 div.col.results {
     max-width: 20em;
+    padding-right: 5px;
+}
+div.col.results div.result {
+	border: 1px solid silver;
+    border-radius: 5px;
+    padding: 0.5em;
+}
+div.col.results h4 {
+    margin-top: 0;
+    margin-bottom: 0.5em;
+}
+div.col.results div.ruler {
+	text-align: center;
+	margin-bottom: 0.5em;
+}
+div.col.results div.query {
+	margin-bottom: 0.5em;
 }
 
 /*
@@ -259,6 +286,9 @@
 	margin-top: 0.5em;
 	margin-bottom: 0.5em;
 }
+div.index-info td {
+	vertical-align: top;
+}
 div.index-info td.type {
 	font-weight: bold;
 }
@@ -278,19 +308,33 @@
 /*
  * image page
  */
-div.col.main div.content-images {
-	border: 1px solid silver;
+div.col.main div.content.images {
+	background-color: inherit;
+	padding: 0;
 }
-div.col.main div.content-images table {
+div.col.main div.content.images table {
 	border-collapse: collapse; /* for tight digilib */
 }
 
 /*
+ * xml page
+ */
+div.col.main div.content.xml {
+	font-family: Monaco,Courier,monospace;
+	font-size: 12px;
+}
+div.col.main div.content.xml div.pageHeaderTitle {
+	display: none;
+}
+
+
+
+/*
  * thumbnail overview
  */
 div.col.main div.content-thumbs {
 	border: 1px solid silver;
-    padding: 1em;
+    padding: 0.5em;
 }
 div.col.main table.thumbs td {
 	text-align: center;
--- a/zpt/layer_text_search.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/layer_text_search.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -16,7 +16,7 @@
     <ul>
       <metal:block metal:define-macro="layer_select_li">
         <li tal:condition="python:query"><input type="checkbox" class="autosubmit" name="viewLayer" value="search"
-          tal:attributes="checked python:'search' in viewLayers" /> Search hits</li>
+          tal:attributes="checked python:'search' in viewLayers" /> Search results</li>
       </metal:block>
     </ul>
   </div>
@@ -24,8 +24,7 @@
   <metal:block metal:define-macro="extra_column" tal:condition="python:'search' in viewLayers">
     <!-- right-side search results -->
     <div class="col results" tal:condition="query">
-      <!--"BEGIN SEARCH RESULTS"  -->
-      <div class="options">
+      <div class="result">
         <h4>Search results</h4>
         <div
           tal:define="start pageinfo/resultStart; resultsize python:docinfo.get('resultSize',0); grpsize pageinfo/resultPageSize;
@@ -33,6 +32,9 @@
           <div class="ruler" tal:define="startParam string:resultStart">
             <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
           </div>
+          <div class="query">
+            Searching "<span tal:content="query" />" (<span tal:content="queryType" />)
+          </div>
           <div class="content"
             tal:content="structure python:here.getResultsPage(mode=queryType,query=query,start=start,size=grpsize,pageinfo=pageinfo,docinfo=docinfo)" />
         </div>
@@ -41,7 +43,7 @@
   </metal:block>
 
   <metal:block metal:define-macro="options_box">
-    <!--"BEGIN SEARCH"-->
+    <!-- search options -->
     <div class="options">
       <h4>Search</h4>
       <form tal:attributes="action viewerUrl">
@@ -54,7 +56,7 @@
         <input type="hidden" name="viewLayer" value="search" />
         <!-- query text -->
         <input type="text" name="query" tal:attributes="value query" /> <br /> <input type="submit" value="Search" /> <a
-          tal:attributes="href python:here.getLink('query',None)">Clear</a>
+          tal:condition="query" tal:attributes="href python:here.getLink('query',None)">Clear</a>
         <ul>
           <li><input type="radio" name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" />
             Exact</li>
@@ -67,7 +69,7 @@
         </ul>
       </form>
     </div>
-    <!--"END SEARCH"-->
+    <!-- end search options-->
   </metal:block>
 
 </body>
--- a/zpt/toc_concordance.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/toc_concordance.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -13,7 +13,7 @@
                 pageNumbers docinfo/pageNumbers | nothing;
                 batch python:here.getBatch(start=start,size=grpsize,end=tocsize,data=pageNumbers);">
       <h4>Page concordance</h4>              
-      <div class="ruler">
+      <div class="ruler top">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
       <div class="content">
@@ -35,7 +35,7 @@
           </tr>
         </table>
       </div>
-      <div class="ruler">
+      <div class="ruler bottom">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
     </div>
--- a/zpt/toc_figures.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/toc_figures.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -12,12 +12,12 @@
       tal:define="start pageinfo/start; tocsize docinfo/numFigureEntries; grpsize pageinfo/tocPageSize;
                 batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
       <h4>Table of figures</h4>
-      <div class="ruler">
+      <div class="ruler top">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
       <div class="content"
         tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
-      <div class="ruler">
+      <div class="ruler bottom">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
     </div>
--- a/zpt/toc_text.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/toc_text.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -12,11 +12,11 @@
     <!-- block used for main content area -->
     <div class="tocbody text">
       <h4>Table of contents</h4>
-      <div class="ruler">
+      <div class="ruler top">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
       <div class="content" tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
-      <div class="ruler">
+      <div class="ruler bottom">
         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
       </div>
     </div>
--- a/zpt/toc_thumbs.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/toc_thumbs.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -19,7 +19,7 @@
 
       <div class="content">
         <h4>List of thumbnails</h4>
-        <div class="ruler">
+        <div class="ruler top">
           <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
         </div>
         <table class="thumbs">
@@ -34,7 +34,7 @@
             </a></td>
           </tr>
         </table>
-        <div class="ruler">
+        <div class="ruler bottom">
           <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
         </div>
       </div>
--- a/zpt/viewer_images.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/viewer_images.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -58,10 +58,10 @@
       </div>
       <!-- col-main: text page -->
       <div class="col main">
-        <div class="ruler">
+        <div class="ruler top">
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <div class="content-images">
+        <div class="content images">
           <div id="scaler">
             <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
           </div>
--- a/zpt/viewer_index.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/viewer_index.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -22,7 +22,7 @@
 
     <div class="col index-image">
       <!-- image -->
-      <a tal:define="tp docinfo/titlePage | nothing"
+      <a tal:define="tp docinfo/titlePage | string:1"
         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>
@@ -67,33 +67,41 @@
         </table>
 
         <tal:block tal:define="dri docinfo/DRI | nothing" tal:condition="dri">
-        <h2>Permanent URL</h2>
-        <table>
-          <tr>
-            <td class="type">Document ID:</td>
-            <td class="content" tal:content="dri" />
-          </tr>
-          <tr>
-            <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>
-        </table>
+          <h2>Permanent URL</h2>
+          <table>
+            <tr>
+              <td class="type">Document ID:</td>
+              <td class="content" tal:content="dri" />
+            </tr>
+            <tr>
+              <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>
+          </table>
         </tal:block>
 
         <tal:block tal:define="attribution docinfo/attribution | nothing; copyright docinfo/copyright | nothing">
-        <h2>Copyright information</h2>
-        <table border="0" tal:condition="attribution | copyright">
-          <!-- attribution -->
-          <tr tal:condition="attribution"
-            tal:replace="structure python:here.metadataService.getAttributionFormatted('metadata_template', data=attribution)" />
-          <!-- copyright -->
-          <tr tal:condition="copyright"
-            tal:replace="structure python:here.metadataService.getCopyrightFormatted('metadata_template', data=copyright)" />
-        </table>
-        <table border="0" tal:condition="not:attribution | copyright">
-          <tr><td></td></tr>
-        </table>        
+          <h2>Copyright information</h2>
+          <table border="0" tal:condition="attribution | copyright">
+            <!-- attribution -->
+            <tr tal:condition="attribution"
+              tal:replace="structure python:here.metadataService.getAttributionFormatted('metadata_template', data=attribution)" />
+            <!-- copyright -->
+            <tr tal:condition="copyright"
+              tal:replace="structure python:here.metadataService.getCopyrightFormatted('metadata_template', data=copyright)" />
+          </table>
+          <table border="0" tal:condition="not:attribution | copyright">
+            <tr>
+              <td class="type">Copyright:</td>
+              <td class="content"><a target="_blank" href="http://www.mpiwg-berlin.mpg.de">Max Planck Institute for the
+                  History of Science</a> (unless otherwise stated)</td>
+            </tr>
+            <tr>
+              <td class="type">License:</td>
+              <td class="content"><a href="http://creativecommons.org/licenses/by-sa/3.0/de/">CC-BY-SA</a></td>
+            </tr>
+          </table>
         </tal:block>
       </div>
 
@@ -106,14 +114,21 @@
             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>
+          (copyright and license see above)
         </div>
         <div class="action">
           <!--BEGIN search -->
-          <form tal:condition="docpath" tal:attributes="action python:here.getLink()">
+          <form tal:define="queryType string:fulltextMorph" 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" />
+              tal:attributes="name param; value python:params[param]" /> <input type="hidden" name="viewLayer" value="search" />
+            <!-- query text -->
+            <input type="text" name="query" tal:attributes="value query" /> <input type="submit" value="Search full document" /> <a
+              tal:condition="query" tal:attributes="href python:here.getLink('query',None)">Clear</a><br /> <input type="radio"
+              name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" /> Exact <input type="radio"
+              name="queryType" value="fulltextMorph" tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms <input
+              type="radio" name="queryType" value="ftIndex" tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
+            <input type="radio" name="queryType" value="ftIndexMorph" tal:attributes="checked python:queryType=='ftIndexMorph'" />
+            Morphological index
           </form>
           <!-- END search-->
         </div>
--- a/zpt/viewer_text.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/viewer_text.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -51,10 +51,10 @@
 
       <!-- text page -->
       <div class="col main">
-        <div class="ruler">
+        <div class="ruler top">
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <div class="content">
+        <div class="content text">
           <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
             tal:content="structure pageinfo/pageHeaderTitle" />
           <tal:block tal:replace="structure textPage" />
--- a/zpt/viewer_thumbs.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/viewer_thumbs.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -58,10 +58,9 @@
             </tr>
           </table>
         </div>
-        <div class="ruler down">
+        <div class="ruler bottom">
           <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
         </div>
-
       </div>
       <!-- /col-main -->
 
--- a/zpt/viewer_xml.zpt	Wed Aug 15 16:59:45 2012 +0200
+++ b/zpt/viewer_xml.zpt	Thu Aug 16 19:09:49 2012 +0200
@@ -42,10 +42,10 @@
 
       <!-- text page -->
       <div class="col main">
-        <div class="ruler">
+        <div class="ruler top">
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
-        <div class="content">
+        <div class="content xml">
           <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
             tal:content="structure pageinfo/pageHeaderTitle" />
           <tal:block tal:replace="structure textPage" />