source: documentViewer/zpt/viewer_text.zpt @ 511:551ca1641a5e

elementtree
Last change on this file since 511:551ca1641a5e was 511:551ca1641a5e, checked in by casties, 12 years ago

more cleanup.
search really works now.

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 toc">
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 search results -->
66      <div class="col results" tal:condition="query">
67        <!--"BEGIN SEARCH RESULTS"  -->
68        <div class="options">
69          <h4>Search results</h4>
70          <div metal:use-macro="here/template/search_template/macros/results_div"/>
71        </div>
72      </div>
73
74      <!-- right-side options -->
75      <div class="col buttons">
76        <!--"BEGIN TEXT DISPLAY"  -->
77        <div class="options">
78          <h4>Text display</h4>
79          <form tal:attributes="action viewerUrl" class="autosubmit">
80            <input type="hidden"
81              tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
82              tal:repeat="param params"
83              tal:attributes="name param; value python:params[param]" />
84            <ul>
85              <li>
86                <input class="autosubmit" type="radio" name="viewMode" value="text"
87                  tal:attributes="checked python:viewMode=='text'" /> Text
88                <ul>
89                  <li>
90                    <input type="checkbox" class="autosubmit" name="viewLayer"
91                      value="dict" tal:attributes="checked python:'dict' in viewLayers" />
92                    Dictionary
93                  </li>
94                  <li tal:condition="python:query">
95                    <input type="checkbox" class="autosubmit" name="viewLayer"
96                      value="search"
97                      tal:attributes="checked python:'search' in viewLayers" /> Search hits
98                  </li>
99                  <li tal:condition="python:docinfo.get('numPlaces',0)">
100                    <input type="checkbox" class="autosubmit" name="viewLayer" value="gis"
101                      tal:attributes="checked python:'gis' in viewLayers" /> Places<br />
102                  </li>
103                </ul>
104              </li>
105              <li>
106                <input type="radio" class="autosubmit" name="viewMode" value="xml"
107                  tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
108                  type="submit" value="Go!" />
109              </li>
110            </ul>
111          </form>
112        </div>
113        <!--"END TEXT DISPLAY"-->
114
115        <!--"BEGIN SEARCH"-->
116        <div class="options">
117          <h4>Search</h4>
118          <form tal:attributes="action viewerUrl">
119            <input type="hidden"
120              tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
121              tal:repeat="param params"
122              tal:attributes="name param; value python:params[param]" />
123            <!-- make sure we have one viewLayer=search -->
124            <tal:block tal:repeat="vl viewLayers">
125                <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'"/>
126            </tal:block>
127            <input type="hidden" name="viewLayer" value="search"/>
128            <!-- query text -->
129            <input type="text" name="query" tal:attributes="value query"/>
130            <input type="submit" value="Search"/>
131            <a tal:attributes="href python:here.getLink('query',None)">Clear</a>
132            <ul>
133                <li>
134                  <input type="radio" name="queryType" value="fulltext"
135                    tal:attributes="checked python:queryType=='fulltext'"/> Exact
136                </li>
137                <li>
138                  <input type="radio" name="queryType" value="fulltextMorph"
139                    tal:attributes="checked python:queryType=='fulltextMorph'"/> All forms
140                </li>
141                <li>
142                  <input type="radio" name="queryType" value="ftIndex"
143                    tal:attributes="checked python:queryType=='ftIndex'"/> Fulltext index
144                </li>
145                <li>
146                  <input type="radio" name="queryType" value="ftIndexMorph"
147                    tal:attributes="checked python:queryType=='ftIndexMorph'"/> Morphological index
148                </li>
149            </ul>
150          </form>
151        </div>
152        <!--"END SEARCH"-->
153
154        <!--"BEGIN TEXT SIZE"-->
155        <div class="options">
156          <h4>Text size</h4>
157          <ul class="fsizer">
158            <li>
159              <a href="javascript:fontSize(12);" class="fs_sml">S</a>
160            </li>
161            <li>
162              <a href="javascript:fontSize(14);" class="fs_med">M</a>
163            </li>
164            <li>
165              <a href="javascript:fontSize(16);" class="fs_lrg">L</a>
166            </li>
167          </ul>
168        </div>
169        <!--"END TEXT SIZE"-->
170
171        <!--"BEGIN DICTIONARY OVERVIEW"-->
172        <div class="options" tal:condition="python:'dict' in viewLayers">
173          <h4>Dictionary view</h4>
174          <form name="f3" action="">
175            <ul>
176              <li>
177                <input type="radio" name="r3" /> Tab
178              </li>
179              <li>
180                <input type="radio" name="r3" /> Window
181              </li>
182            </ul>
183          </form>
184        </div>
185        <!--"END DICTIONARY OVERVIEW"-->
186
187        <!--"BEGIN TEXT NORMALIZATION"-->
188        <div class="options">
189          <h4>Text normalization</h4>
190          <form tal:attributes="action viewerUrl" class="autosubmit"
191            tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');">
192            <input type="hidden"
193              tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
194              tal:repeat="param params"
195              tal:attributes="name param; value python:params[param]" />
196            <ul>
197              <li>
198                <input type="radio" class="autosubmit" name="characterNormalization"
199                  value="orig" tal:attributes="checked python:norm=='orig'" /> Original
200              </li>
201              <li>
202                <input type="radio" class="autosubmit" name="characterNormalization"
203                  value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized
204              </li>
205              <li>
206                <input type="radio" class="autosubmit" name="characterNormalization"
207                  value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" />
208                Normalized
209              </li>
210            </ul>
211            <input type="submit" value="Go!" />
212          </form>
213        </div>
214        <!--"END TEXT NORMALIZATION"-->
215
216        <!--"BEGIN PLACES"-->
217        <div class="options" tal:condition="python:'gis' in viewLayers">
218          <tal:block tal:define="
219            name docinfo/documentName;
220            places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn);
221            pidlist python:','.join([p['id'] for p in places]);">
222            <h4>Places</h4>
223            <ul>
224            <li><a
225              tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?id=%s&format=gis'%(name,pidlist)"
226              target="_blank">on this page</a>
227            </li>
228            <li>
229              <a
230              tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?format=gis'%(name)"
231              target="_blank">in whole document</a>
232            </li>
233            </ul>
234          </tal:block>
235        </div>
236        <!--"END PLACES"-->
237      </div>
238      <!-- /col-right -->
239
240    </div>
241    <!-- /page-body -->
242
243    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
244      <div class="errortext">Sorry, access to this document is restricted.</div>
245    </div>
246
247  </tal:block>
248</body>
249<body tal:condition="not:numPages">
250  <div class="errortext">Sorry, document doesn't exist.</div>
251</body>
252</html>
Note: See TracBrowser for help on using the repository browser.