diff zpt/viewer_text.zpt @ 526:3f375a048402

moved search and dict into separate layers. removed search_template. added tocMode=concordance. fixed bug with paging tocs.
author casties
date Tue, 10 Apr 2012 19:41:44 +0200
parents 70c3ae5eac7c
children 5c7433c2515c
line wrap: on
line diff
--- a/zpt/viewer_text.zpt	Thu Apr 05 19:29:50 2012 +0200
+++ b/zpt/viewer_text.zpt	Tue Apr 10 19:41:44 2012 +0200
@@ -23,8 +23,8 @@
     });
 // -->
 </script>
-<!--  layer headers -->
-<tal:block tal:repeat="layer viewLayers">
+<!--  layer headers (rendered always) -->
+<tal:block tal:repeat="layer availableLayers">
   <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head"
     tal:condition="python:exists(mpath)">
     <metal:block metal:use-macro="python:path(mpath)" />
@@ -37,8 +37,6 @@
     tal:define="docpath docinfo/textURLPath;
                 pn pageinfo/pn; 
                 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
-                query python:request.get('query', None); 
-                queryType python:request.get('queryType','fulltextMorph');
                 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">
     <!-- header -->
     <div class="page-head">
@@ -70,14 +68,13 @@
       </div>
       <!-- end of col-main -->
 
-      <!-- right-side search results -->
-      <div class="col results" tal:condition="query">
-        <!--"BEGIN SEARCH RESULTS"  -->
-        <div class="options">
-          <h4>Search results</h4>
-          <div metal:use-macro="here/template/search_template/macros/results_div" />
-        </div>
-      </div>
+      <!--  layer columns (rendered always) -->
+      <tal:block tal:repeat="layer availableLayers">
+        <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/extra_column"
+          tal:condition="python:exists(mpath)">
+          <metal:block metal:use-macro="python:path(mpath)" />
+        </tal:block>
+      </tal:block>
 
       <!-- right-side options -->
       <div class="col buttons">
@@ -94,19 +91,7 @@
                 <input class="autosubmit" type="radio" name="viewMode" value="text"
                   tal:attributes="checked python:viewMode=='text'" /> Text
                 <ul>
-                  <!-- text layers -->
-                  <li>
-                    <input type="checkbox" class="autosubmit" name="viewLayer"
-                      value="dict" tal:attributes="checked python:'dict' in viewLayers" />
-                    Dictionary
-                  </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>
-                  <!-- auto-layer select buttons -->
+                  <!-- text layer select buttons (rendered always) -->
                   <tal:block tal:repeat="layer availableLayers">
                     <tal:block
                       tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
@@ -126,47 +111,6 @@
         </div>
         <!--"END TEXT DISPLAY"-->
 
-        <!--"BEGIN SEARCH"-->
-        <div class="options">
-          <h4>Search</h4>
-          <form tal:attributes="action viewerUrl">
-            <input type="hidden"
-              tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
-              tal:repeat="param params"
-              tal:attributes="name param; value python:params[param]" />
-            <!-- make sure we have one viewLayer=search -->
-            <tal:block tal:repeat="vl viewLayers">
-              <input type="hidden" name="viewLayer" tal:attributes="value vl"
-                tal:condition="python:vl != 'search'" />
-            </tal:block>
-            <input type="hidden" name="viewLayer" value="search" />
-            <!-- query text -->
-            <input type="text" name="query" tal:attributes="value query" /> <input
-              type="submit" value="Search" /> <a
-              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>
-              <li>
-                <input type="radio" name="queryType" value="fulltextMorph"
-                  tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
-              </li>
-              <li>
-                <input type="radio" name="queryType" value="ftIndex"
-                  tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
-              </li>
-              <li>
-                <input type="radio" name="queryType" value="ftIndexMorph"
-                  tal:attributes="checked python:queryType=='ftIndexMorph'" />
-                Morphological index
-              </li>
-            </ul>
-          </form>
-        </div>
-        <!--"END SEARCH"-->
-
         <!--"BEGIN TEXT SIZE"-->
         <div class="options">
           <h4>Text size</h4>
@@ -184,22 +128,6 @@
         </div>
         <!--"END TEXT SIZE"-->
 
-        <!--"BEGIN DICTIONARY OVERVIEW"-->
-        <div class="options" tal:condition="python:'dict' in viewLayers">
-          <h4>Dictionary view</h4>
-          <form name="f3" action="">
-            <ul>
-              <li>
-                <input type="radio" name="r3" /> Tab
-              </li>
-              <li>
-                <input type="radio" name="r3" /> Window
-              </li>
-            </ul>
-          </form>
-        </div>
-        <!--"END DICTIONARY OVERVIEW"-->
-
         <!--"BEGIN TEXT NORMALIZATION"-->
         <div class="options">
           <h4>Text normalization</h4>
@@ -229,8 +157,8 @@
         </div>
         <!--"END TEXT NORMALIZATION"-->
 
-        <!--  auto-layer option boxes -->
-        <tal:block tal:repeat="layer viewLayers">
+        <!--  layer option boxes (rendered if active) -->
+        <tal:block tal:repeat="layer availableLayers">
           <tal:block
             tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
             tal:condition="python:exists(mpath)">