source: documentViewer/zpt/viewer_text.zpt @ 509:9d05befdd462

elementtree
Last change on this file since 509:9d05befdd462 was 509:9d05befdd462, checked in by casties, 12 years ago

try to get characterNormalization in search result working.

File size: 10.3 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"
4  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
5              tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
6              viewerUrl docinfo/viewerUrl;
7              rootUrl here/getDocumentViewerURL;
8              numPages docinfo/numPages | nothing;">
9<head>
10<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
11  <title
12    tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
13  <link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
14  <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script>
15  <script type="text/javascript">
16            // <!--
17            $(document).ready(function() {
18                // autosubmit forms
19                $('form.autosubmit').find('.autosubmit').change(function() {
20                    this.form.submit();
21                });
22                $('form.autosubmit input[type="submit"]').hide();
23            });
24        // -->
25        </script>
26</head>
27<body tal:condition="numPages">
28  <tal:block
29    tal:define="docpath docinfo/textURLPath;
30                pn pageinfo/pn;
31                flowLtr python:pageinfo.get('pageFlow','ltr')!='rtl';
32                query python:request.get('query', None);
33                queryType python:request.get('queryType','fulltextMorph');
34                textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">
35    <!-- header -->
36    <div class="page-head">
37      <metal:block metal:use-macro="here/template/common_template/macros/head" />
38    </div>
39    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
40      <!--table of contents-->
41      <div class="col-left">
42        <metal:block
43          metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
44      </div>
45
46      <!-- text page -->
47      <div class="col-main">
48        <div class="ruler">
49          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
50        </div>
51        <ul class="switcher">
52          <li>
53            <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
54          </li>
55          <li class="sel">Text</li>
56        </ul>
57        <div class="content">
58          <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
59            tal:content="structure pageinfo/pageHeaderTitle" />
60          <tal:block tal:replace="structure textPage" />
61        </div>
62      </div>
63      <!-- end of col-main -->
64
65      <!-- right-side options -->
66      <div class="col-right">
67        <!--"BEGIN TEXT DISPLAY"  -->
68        <div class="options">
69          <h4>Text display</h4>
70          <pre tal:content="python:repr(viewLayers)" />
71          <pre tal:content="python:repr(viewLayer)" />
72          <form tal:attributes="action viewerUrl" class="autosubmit">
73            <input type="hidden"
74              tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
75              tal:repeat="param params"
76              tal:attributes="name param; value python:params[param]" />
77            <ul>
78              <li>
79                <input class="autosubmit" type="radio" name="viewMode" value="text"
80                  tal:attributes="checked python:viewMode=='text'" /> Text
81                <ul>
82                  <li>
83                    <input type="checkbox" class="autosubmit" name="viewLayer"
84                      value="dict" tal:attributes="checked python:'dict' in viewLayers" />
85                    Dictionary
86                  </li>
87                  <li tal:condition="query">
88                    <input type="checkbox" class="autosubmit" name="viewLayer"
89                      value="search"
90                      tal:attributes="checked python:'search' in viewLayers" /> Search hits
91                  </li>
92                  <li tal:condition="python:docinfo.get('numPlaces',0)">
93                    <input type="checkbox" class="autosubmit" name="viewLayer" value="gis"
94                      tal:attributes="checked python:'gis' in viewLayers" /> Places<br />
95                  </li>
96                </ul>
97              </li>
98              <li>
99                <input type="radio" class="autosubmit" name="viewMode" value="xml"
100                  tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
101                  type="submit" value="Go!" />
102              </li>
103            </ul>
104          </form>
105        </div>
106        <!--"END TEXT DISPLAY"-->
107
108        <!--"BEGIN SEARCH"-->
109        <div class="options">
110          <h4>Search</h4>
111          <form tal:attributes="action viewerUrl">
112            <input type="hidden"
113              tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
114              tal:repeat="param params"
115              tal:attributes="name param; value python:params[param]" />
116            <!-- make sure we have one viewLayer=search -->
117            <tal:block tal:repeat="vl viewLayers">
118                <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'"/>
119            </tal:block>
120            <input type="hidden" name="viewLayer" value="search"/>
121            <!-- query text -->
122            <input type="text" name="query" tal:attributes="value query"/>
123            <input type="submit" value="Search"/>
124            <ul>
125                <li>
126                  <input type="radio" name="queryType" value="fulltext"
127                    tal:attributes="checked python:queryType=='fulltext'"/> Exact
128                </li>
129                <li>
130                  <input type="radio" name="queryType" value="fulltextMorph"
131                    tal:attributes="checked python:queryType=='fulltextMorph'"/> All forms
132                </li>
133                <li>
134                  <input type="radio" name="queryType" value="ftIndex"
135                    tal:attributes="checked python:queryType=='ftIndex'"/> Fulltext index
136                </li>
137                <li>
138                  <input type="radio" name="queryType" value="ftIndexMorph"
139                    tal:attributes="checked python:queryType=='ftIndexMorph'"/> Morphological index
140                </li>
141            </ul>
142          </form>
143        </div>
144        <!--"END SEARCH"-->
145
146        <!--"BEGIN TEXT SIZE"-->
147        <div class="options">
148          <h4>Text size</h4>
149          <ul class="fsizer">
150            <li>
151              <a href="javascript:fontSize(12);" class="fs_sml">S</a>
152            </li>
153            <li>
154              <a href="javascript:fontSize(14);" class="fs_med">M</a>
155            </li>
156            <li>
157              <a href="javascript:fontSize(16);" class="fs_lrg">L</a>
158            </li>
159          </ul>
160        </div>
161        <!--"END TEXT SIZE"-->
162
163        <!--"BEGIN DICTIONARY OVERVIEW"-->
164        <div class="options" tal:condition="python:'dict' in viewLayers">
165          <h4>Dictionary view</h4>
166          <form name="f3" action="">
167            <ul>
168              <li>
169                <input type="radio" name="r3" /> Tab
170              </li>
171              <li>
172                <input type="radio" name="r3" /> Window
173              </li>
174            </ul>
175          </form>
176        </div>
177        <!--"END DICTIONARY OVERVIEW"-->
178
179        <!--"BEGIN TEXT NORMALIZATION"-->
180        <div class="options">
181          <h4>Text normalization</h4>
182          <form tal:attributes="action viewerUrl" class="autosubmit"
183            tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');">
184            <input type="hidden"
185              tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
186              tal:repeat="param params"
187              tal:attributes="name param; value python:params[param]" />
188            <ul>
189              <li>
190                <input type="radio" class="autosubmit" name="characterNormalization"
191                  value="orig" tal:attributes="checked python:norm=='orig'" /> Original
192              </li>
193              <li>
194                <input type="radio" class="autosubmit" name="characterNormalization"
195                  value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized
196              </li>
197              <li>
198                <input type="radio" class="autosubmit" name="characterNormalization"
199                  value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" />
200                Normalized
201              </li>
202            </ul>
203            <input type="submit" value="Go!" />
204          </form>
205        </div>
206        <!--"END TEXT NORMALIZATION"-->
207
208        <!--"BEGIN PLACES"-->
209        <div class="options" tal:condition="python:'gis' in viewLayers">
210          <tal:block tal:define="
211            name docinfo/documentName;
212            places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn);
213            pidlist python:','.join([p['id'] for p in places]);">
214            <h4>Places</h4>
215            <ul>
216            <li><a
217              tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?id=%s&format=gis'%(name,pidlist)"
218              target="_blank">on this page</a>
219            </li>
220            <li>
221              <a
222              tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?format=gis'%(name)"
223              target="_blank">in whole document</a>
224            </li>
225            </ul>
226          </tal:block>
227        </div>
228        <!--"END PLACES"-->
229      </div>
230      <!-- /col-right -->
231
232      <!-- right-side options -->
233      <div class="col-veryright" tal:condition="query">
234        <!--"BEGIN SEARCH RESULTS"  -->
235        <div class="options">
236          <h4>Search results</h4>
237          <div tal:content="structure python:here.getResultsPage(mode=queryType,query=query,pn=1,pageinfo=pageinfo,docinfo=docinfo)"/>
238        </div>
239      </div>
240
241    </div>
242    <!-- /page-body -->
243
244    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
245      <div class="errortext">Sorry, access to this document is restricted.</div>
246    </div>
247
248  </tal:block>
249</body>
250<body tal:condition="not:numPages">
251  <div class="errortext">Sorry, document doesn't exist.</div>
252</body>
253</html>
Note: See TracBrowser for help on using the repository browser.