Mercurial > hg > documentViewer
annotate zpt/viewer_text.zpt @ 508:d5a47f82e755 elementtree
more cleanup.
search works mostly now.
layers work better now.
author | casties |
---|---|
date | Mon, 27 Feb 2012 21:26:52 +0100 |
parents | 67014399894d |
children | 9d05befdd462 |
rev | line source |
---|---|
479 | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
490
6f116b86a226
more new template stuff. moved ImageFile index method to SrvTxtUtils
casties
parents:
489
diff
changeset
|
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
479 | 3 <html xmlns="http://www.w3.org/1999/xhtml" |
501 | 4 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; |
508 | 5 tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers; |
6 viewerUrl docinfo/viewerUrl; | |
501 | 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; | |
506 | 30 pn pageinfo/pn; |
31 flowLtr python:pageinfo.get('pageFlow','ltr')!='rtl'; | |
508 | 32 query python:request.get('query', None); |
33 queryType python:request.get('queryType','fulltextMorph'); | |
506 | 34 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
502 | 35 <!-- header --> |
501 | 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> | |
508 | 63 <!-- end of col-main --> |
501 | 64 |
65 <!-- right-side options --> | |
66 <div class="col-right"> | |
67 <!--"BEGIN TEXT DISPLAY" --> | |
68 <div class="options"> | |
69 <h4>Text display</h4> | |
508 | 70 <pre tal:content="python:repr(viewLayers)" /> |
501 | 71 <form tal:attributes="action viewerUrl" class="autosubmit"> |
72 <input type="hidden" | |
503 | 73 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" |
501 | 74 tal:repeat="param params" |
508 | 75 tal:attributes="name param; value python:params[param]" /> |
76 <ul> | |
77 <li> | |
78 <input class="autosubmit" type="radio" name="viewMode" value="text" | |
79 tal:attributes="checked python:viewMode=='text'" /> Text | |
80 <ul> | |
81 <li> | |
82 <input type="checkbox" class="autosubmit" name="viewLayer" | |
83 value="dict" tal:attributes="checked python:'dict' in viewLayers" /> | |
84 Dictionary | |
85 </li> | |
86 <li tal:condition="query"> | |
87 <input type="checkbox" class="autosubmit" name="viewLayer" | |
88 value="search" | |
89 tal:attributes="checked python:'search' in viewLayers" /> Search hits | |
90 </li> | |
91 <li tal:condition="python:docinfo.get('numPlaces',0)"> | |
92 <input type="checkbox" class="autosubmit" name="viewLayer" value="gis" | |
93 tal:attributes="checked python:'gis' in viewLayers" /> Places<br /> | |
94 </li> | |
95 </ul> | |
96 </li> | |
97 <li> | |
98 <input type="radio" class="autosubmit" name="viewMode" value="xml" | |
99 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input | |
100 type="submit" value="Go!" /> | |
101 </li> | |
102 </ul> | |
501 | 103 </form> |
104 </div> | |
105 <!--"END TEXT DISPLAY"--> | |
106 | |
508 | 107 <!--"BEGIN SEARCH"--> |
108 <div class="options"> | |
109 <h4>Search</h4> | |
110 <form tal:attributes="action viewerUrl"> | |
111 <input type="hidden" | |
112 tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})" | |
113 tal:repeat="param params" | |
114 tal:attributes="name param; value python:params[param]" /> | |
115 <!-- make sure we have one viewLayer=search --> | |
116 <tal:block tal:repeat="vl viewLayers"> | |
117 <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'"/> | |
118 </tal:block> | |
119 <input type="hidden" name="viewLayer" value="search"/> | |
120 <!-- query text --> | |
121 <input type="text" name="query" tal:attributes="value query"/> | |
122 <input type="submit" value="Search"/> | |
123 <ul> | |
124 <li> | |
125 <input type="radio" name="queryType" value="fulltext" | |
126 tal:attributes="checked python:queryType=='fulltext'"/> Exact | |
127 </li> | |
128 <li> | |
129 <input type="radio" name="queryType" value="fulltextMorph" | |
130 tal:attributes="checked python:queryType=='fulltextMorph'"/> All forms | |
131 </li> | |
132 <li> | |
133 <input type="radio" name="queryType" value="ftIndex" | |
134 tal:attributes="checked python:queryType=='ftIndex'"/> Fulltext index | |
135 </li> | |
136 <li> | |
137 <input type="radio" name="queryType" value="ftIndexMorph" | |
138 tal:attributes="checked python:queryType=='ftIndexMorph'"/> Morphological index | |
139 </li> | |
140 </ul> | |
141 </form> | |
142 </div> | |
143 <!--"END SEARCH"--> | |
144 | |
501 | 145 <!--"BEGIN TEXT SIZE"--> |
146 <div class="options"> | |
147 <h4>Text size</h4> | |
508 | 148 <ul class="fsizer"> |
149 <li> | |
150 <a href="javascript:fontSize(12);" class="fs_sml">S</a> | |
151 </li> | |
152 <li> | |
153 <a href="javascript:fontSize(14);" class="fs_med">M</a> | |
154 </li> | |
155 <li> | |
156 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> | |
157 </li> | |
158 </ul> | |
501 | 159 </div> |
160 <!--"END TEXT SIZE"--> | |
485 | 161 |
501 | 162 <!--"BEGIN DICTIONARY OVERVIEW"--> |
508 | 163 <div class="options" tal:condition="python:'dict' in viewLayers"> |
501 | 164 <h4>Dictionary view</h4> |
165 <form name="f3" action=""> | |
508 | 166 <ul> |
167 <li> | |
168 <input type="radio" name="r3" /> Tab | |
169 </li> | |
170 <li> | |
171 <input type="radio" name="r3" /> Window | |
172 </li> | |
173 </ul> | |
501 | 174 </form> |
175 </div> | |
176 <!--"END DICTIONARY OVERVIEW"--> | |
177 | |
178 <!--"BEGIN TEXT NORMALIZATION"--> | |
508 | 179 <div class="options"> |
501 | 180 <h4>Text normalization</h4> |
181 <form tal:attributes="action viewerUrl" class="autosubmit" | |
182 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | |
183 <input type="hidden" | |
184 tal:define="params python:here.getParams('characterNormalization',None)" | |
185 tal:repeat="param params" | |
508 | 186 tal:attributes="name param; value python:params[param]" /> |
187 <ul> | |
188 <li> | |
189 <input type="radio" class="autosubmit" name="characterNormalization" | |
190 value="orig" tal:attributes="checked python:norm=='orig'" /> Original | |
191 </li> | |
192 <li> | |
193 <input type="radio" class="autosubmit" name="characterNormalization" | |
194 value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized | |
195 </li> | |
196 <li> | |
197 <input type="radio" class="autosubmit" name="characterNormalization" | |
198 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | |
199 Normalized | |
200 </li> | |
201 </ul> | |
202 <input type="submit" value="Go!" /> | |
501 | 203 </form> |
204 </div> | |
205 <!--"END TEXT NORMALIZATION"--> | |
206 | |
207 <!--"BEGIN PLACES"--> | |
508 | 208 <div class="options" tal:condition="python:'gis' in viewLayers"> |
506 | 209 <tal:block tal:define=" |
210 name docinfo/documentName; | |
211 places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn); | |
212 pidlist python:','.join([p['id'] for p in places]);"> | |
213 <h4>Places</h4> | |
214 <ul> | |
215 <li><a | |
216 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?id=%s&format=gis'%(name,pidlist)" | |
217 target="_blank">on this page</a> | |
218 </li> | |
219 <li> | |
220 <a | |
221 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?format=gis'%(name)" | |
222 target="_blank">in whole document</a> | |
223 </li> | |
224 </ul> | |
501 | 225 </tal:block> |
226 </div> | |
227 <!--"END PLACES"--> | |
228 </div> | |
229 <!-- /col-right --> | |
230 | |
508 | 231 <!-- right-side options --> |
232 <div class="col-veryright" tal:condition="query"> | |
233 <!--"BEGIN SEARCH RESULTS" --> | |
234 <div class="options"> | |
235 <h4>Search results</h4> | |
236 <div tal:content="structure python:here.getResultsPage(mode=queryType,query=query,pn=1,pageinfo=pageinfo,docinfo=docinfo)"/> | |
237 </div> | |
238 </div> | |
239 | |
501 | 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> |