Changeset 526:3f375a048402 in documentViewer for zpt/viewer_text.zpt


Ignore:
Timestamp:
Apr 10, 2012, 5:41:44 PM (12 years ago)
Author:
casties
Branch:
default
Message:

moved search and dict into separate layers.
removed search_template.
added tocMode=concordance.
fixed bug with paging tocs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zpt/viewer_text.zpt

    r525 r526  
    2424// -->
    2525</script>
    26 <!--  layer headers -->
    27 <tal:block tal:repeat="layer viewLayers">
     26<!--  layer headers (rendered always) -->
     27<tal:block tal:repeat="layer availableLayers">
    2828  <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head"
    2929    tal:condition="python:exists(mpath)">
     
    3838                pn pageinfo/pn;
    3939                flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
    40                 query python:request.get('query', None);
    41                 queryType python:request.get('queryType','fulltextMorph');
    4240                textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">
    4341    <!-- header -->
     
    7169      <!-- end of col-main -->
    7270
    73       <!-- right-side search results -->
    74       <div class="col results" tal:condition="query">
    75         <!--"BEGIN SEARCH RESULTS"  -->
    76         <div class="options">
    77           <h4>Search results</h4>
    78           <div metal:use-macro="here/template/search_template/macros/results_div" />
    79         </div>
    80       </div>
     71      <!--  layer columns (rendered always) -->
     72      <tal:block tal:repeat="layer availableLayers">
     73        <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/extra_column"
     74          tal:condition="python:exists(mpath)">
     75          <metal:block metal:use-macro="python:path(mpath)" />
     76        </tal:block>
     77      </tal:block>
    8178
    8279      <!-- right-side options -->
     
    9592                  tal:attributes="checked python:viewMode=='text'" /> Text
    9693                <ul>
    97                   <!-- text layers -->
    98                   <li>
    99                     <input type="checkbox" class="autosubmit" name="viewLayer"
    100                       value="dict" tal:attributes="checked python:'dict' in viewLayers" />
    101                     Dictionary
    102                   </li>
    103                   <li tal:condition="python:query">
    104                     <input type="checkbox" class="autosubmit" name="viewLayer"
    105                       value="search"
    106                       tal:attributes="checked python:'search' in viewLayers" /> Search
    107                     hits
    108                   </li>
    109                   <!-- auto-layer select buttons -->
     94                  <!-- text layer select buttons (rendered always) -->
    11095                  <tal:block tal:repeat="layer availableLayers">
    11196                    <tal:block
     
    127112        <!--"END TEXT DISPLAY"-->
    128113
    129         <!--"BEGIN SEARCH"-->
    130         <div class="options">
    131           <h4>Search</h4>
    132           <form tal:attributes="action viewerUrl">
    133             <input type="hidden"
    134               tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
    135               tal:repeat="param params"
    136               tal:attributes="name param; value python:params[param]" />
    137             <!-- make sure we have one viewLayer=search -->
    138             <tal:block tal:repeat="vl viewLayers">
    139               <input type="hidden" name="viewLayer" tal:attributes="value vl"
    140                 tal:condition="python:vl != 'search'" />
    141             </tal:block>
    142             <input type="hidden" name="viewLayer" value="search" />
    143             <!-- query text -->
    144             <input type="text" name="query" tal:attributes="value query" /> <input
    145               type="submit" value="Search" /> <a
    146               tal:attributes="href python:here.getLink('query',None)">Clear</a>
    147             <ul>
    148               <li>
    149                 <input type="radio" name="queryType" value="fulltext"
    150                   tal:attributes="checked python:queryType=='fulltext'" /> Exact
    151               </li>
    152               <li>
    153                 <input type="radio" name="queryType" value="fulltextMorph"
    154                   tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
    155               </li>
    156               <li>
    157                 <input type="radio" name="queryType" value="ftIndex"
    158                   tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
    159               </li>
    160               <li>
    161                 <input type="radio" name="queryType" value="ftIndexMorph"
    162                   tal:attributes="checked python:queryType=='ftIndexMorph'" />
    163                 Morphological index
    164               </li>
    165             </ul>
    166           </form>
    167         </div>
    168         <!--"END SEARCH"-->
    169 
    170114        <!--"BEGIN TEXT SIZE"-->
    171115        <div class="options">
     
    184128        </div>
    185129        <!--"END TEXT SIZE"-->
    186 
    187         <!--"BEGIN DICTIONARY OVERVIEW"-->
    188         <div class="options" tal:condition="python:'dict' in viewLayers">
    189           <h4>Dictionary view</h4>
    190           <form name="f3" action="">
    191             <ul>
    192               <li>
    193                 <input type="radio" name="r3" /> Tab
    194               </li>
    195               <li>
    196                 <input type="radio" name="r3" /> Window
    197               </li>
    198             </ul>
    199           </form>
    200         </div>
    201         <!--"END DICTIONARY OVERVIEW"-->
    202130
    203131        <!--"BEGIN TEXT NORMALIZATION"-->
     
    230158        <!--"END TEXT NORMALIZATION"-->
    231159
    232         <!--  auto-layer option boxes -->
    233         <tal:block tal:repeat="layer viewLayers">
     160        <!--  layer option boxes (rendered if active) -->
     161        <tal:block tal:repeat="layer availableLayers">
    234162          <tal:block
    235163            tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
Note: See TracChangeset for help on using the changeset viewer.