changeset 510:4fb35343d2e7 elementtree

more search. nicer css.
author casties
date Tue, 28 Feb 2012 10:39:21 +0100
parents 9d05befdd462
children 551ca1641a5e
files MpdlXmlTextServer.py css/docuviewer.css zpt/viewer_images.zpt zpt/viewer_text.zpt
diffstat 4 files changed, 31 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Mon Feb 27 21:57:18 2012 +0100
+++ b/MpdlXmlTextServer.py	Tue Feb 28 10:39:21 2012 +0100
@@ -306,11 +306,10 @@
             elif dc == 'queryResultHits':
                 docinfo['resultSize_%s_%s'%(mode,query)] = getInt(div.text)
 
-        if pagediv:
+        if pagediv is not None:
             # store XML in docinfo
             docinfo['resultXML_%s_%s'%(mode,query)] = ET.tostring(pagediv, 'UTF-8')
 
-        logging.debug("getSearchResults: pagediv=%s"%pagediv)
         return docinfo
     
 
@@ -335,7 +334,7 @@
 
         fullresult = ET.fromstring(resultxml)
         
-        if fullresult:
+        if fullresult is not None:
             # paginate
             first = start
             len = size
@@ -408,7 +407,7 @@
             elif dc == 'queryResultHits':
                 docinfo['tocSize_%s'%mode] = getInt(div.text)
 
-        if pagediv:
+        if pagediv is not None:
             # store XML in docinfo
             docinfo['tocXML_%s'%mode] = ET.tostring(pagediv, 'UTF-8')
 
@@ -439,7 +438,7 @@
 
         fulltoc = ET.fromstring(tocxml)
         
-        if fulltoc:
+        if fulltoc is not None:
             # paginate
             first = (start - 1) * 2
             len = size * 2
--- a/css/docuviewer.css	Mon Feb 27 21:57:18 2012 +0100
+++ b/css/docuviewer.css	Tue Feb 28 10:39:21 2012 +0100
@@ -2,15 +2,7 @@
 div.page-body {
     display: table-row;
 }
-div.col-left {
-    display: table-cell;
-    vertical-align: top;
-}
-div.col-main {
-    display: table-cell;
-    vertical-align: top;
-}
-div.col-right {
+div.page-body div.col {
     display: table-cell;
     vertical-align: top;
 }
@@ -19,21 +11,21 @@
     max-width: 20em;
 }
 
-div.col-left .thumb {
+div.toc-text .toc, div.toc-figures .toc {
+    float:left;
+    clear:right; 
+}
+div.toc-text .toc.float.right, div.toc-figures .toc.float.right  {
+    float:right;
+}
+
+div.toc-thumbs .thumb {
     padding: 3px;
 }
-div.col-left .thumbsel {
+div.toc-thumbs .thumbsel {
     padding: 2px;
     border: 1px solid blue;
 }
-div.col-left .thumbcap {
+div.toc-thumbs .thumbcap {
     color: black;
 }
-
-div.col-left .toc {
-    float:left;
-    clear:right; 
-}
-div.col-left .toc.float.right {
-    float:right;
-}
--- a/zpt/viewer_images.zpt	Mon Feb 27 21:57:18 2012 +0100
+++ b/zpt/viewer_images.zpt	Tue Feb 28 10:39:21 2012 +0100
@@ -60,12 +60,12 @@
     </div>
     <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
       <!-- table of contents -->
-      <div class="col-left">
+      <div class="col toc">
         <metal:block
           metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
       </div>
       <!-- col-main: text page -->
-      <div class="col-main">
+      <div class="col main">
         <div class="ruler">
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
@@ -85,7 +85,7 @@
         <!-- /content -->
       </div>
       <!-- /col-main -->
-      <div class="col-right">
+      <div class="col buttons">
         <div class="digilib-buttons">
           <div>
             <a href="javascript:$digilib.digilib('zoomBy', 1.4)">zoom in</a>
--- a/zpt/viewer_text.zpt	Mon Feb 27 21:57:18 2012 +0100
+++ b/zpt/viewer_text.zpt	Tue Feb 28 10:39:21 2012 +0100
@@ -38,13 +38,13 @@
     </div>
     <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
       <!--table of contents-->
-      <div class="col-left">
+      <div class="col toc">
         <metal:block
           metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
       </div>
 
       <!-- text page -->
-      <div class="col-main">
+      <div class="col main">
         <div class="ruler">
           <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
         </div>
@@ -62,13 +62,20 @@
       </div>
       <!-- end of col-main -->
 
+      <!-- right-side search results -->
+      <div class="col search" tal:condition="query">
+        <!--"BEGIN SEARCH RESULTS"  -->
+        <div class="options">
+          <h4>Search results</h4>
+          <div tal:content="structure python:here.getResultsPage(mode=queryType,query=query,pn=1,pageinfo=pageinfo,docinfo=docinfo)"/>
+        </div>
+      </div>
+
       <!-- right-side options -->
-      <div class="col-right">
+      <div class="col buttons">
         <!--"BEGIN TEXT DISPLAY"  -->
         <div class="options">
           <h4>Text display</h4>
-          <pre tal:content="python:repr(viewLayers)" />
-          <pre tal:content="python:repr(viewLayer)" />
           <form tal:attributes="action viewerUrl" class="autosubmit">
             <input type="hidden"
               tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
@@ -229,15 +236,6 @@
       </div>
       <!-- /col-right -->
 
-      <!-- right-side options -->
-      <div class="col-veryright" tal:condition="query">
-        <!--"BEGIN SEARCH RESULTS"  -->
-        <div class="options">
-          <h4>Search results</h4>
-          <div tal:content="structure python:here.getResultsPage(mode=queryType,query=query,pn=1,pageinfo=pageinfo,docinfo=docinfo)"/>
-        </div>
-      </div>
-
     </div>
     <!-- /page-body -->