Mercurial > hg > documentViewer
annotate zpt/viewer_text.zpt @ 510:4fb35343d2e7 elementtree
more search. nicer css.
author | casties |
---|---|
date | Tue, 28 Feb 2012 10:39:21 +0100 |
parents | 9d05befdd462 |
children | 551ca1641a5e |
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--> | |
510 | 41 <div class="col toc"> |
501 | 42 <metal:block |
43 metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> | |
44 </div> | |
45 | |
46 <!-- text page --> | |
510 | 47 <div class="col main"> |
501 | 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 |
510 | 65 <!-- right-side search results --> |
66 <div class="col search" tal:condition="query"> | |
67 <!--"BEGIN SEARCH RESULTS" --> | |
68 <div class="options"> | |
69 <h4>Search results</h4> | |
70 <div tal:content="structure python:here.getResultsPage(mode=queryType,query=query,pn=1,pageinfo=pageinfo,docinfo=docinfo)"/> | |
71 </div> | |
72 </div> | |
73 | |
501 | 74 <!-- right-side options --> |
510 | 75 <div class="col buttons"> |
501 | 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" | |
503 | 81 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" |
501 | 82 tal:repeat="param params" |
508 | 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="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> | |
501 | 111 </form> |
112 </div> | |
113 <!--"END TEXT DISPLAY"--> | |
114 | |
508 | 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 <ul> | |
132 <li> | |
133 <input type="radio" name="queryType" value="fulltext" | |
134 tal:attributes="checked python:queryType=='fulltext'"/> Exact | |
135 </li> | |
136 <li> | |
137 <input type="radio" name="queryType" value="fulltextMorph" | |
138 tal:attributes="checked python:queryType=='fulltextMorph'"/> All forms | |
139 </li> | |
140 <li> | |
141 <input type="radio" name="queryType" value="ftIndex" | |
142 tal:attributes="checked python:queryType=='ftIndex'"/> Fulltext index | |
143 </li> | |
144 <li> | |
145 <input type="radio" name="queryType" value="ftIndexMorph" | |
146 tal:attributes="checked python:queryType=='ftIndexMorph'"/> Morphological index | |
147 </li> | |
148 </ul> | |
149 </form> | |
150 </div> | |
151 <!--"END SEARCH"--> | |
152 | |
501 | 153 <!--"BEGIN TEXT SIZE"--> |
154 <div class="options"> | |
155 <h4>Text size</h4> | |
508 | 156 <ul class="fsizer"> |
157 <li> | |
158 <a href="javascript:fontSize(12);" class="fs_sml">S</a> | |
159 </li> | |
160 <li> | |
161 <a href="javascript:fontSize(14);" class="fs_med">M</a> | |
162 </li> | |
163 <li> | |
164 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> | |
165 </li> | |
166 </ul> | |
501 | 167 </div> |
168 <!--"END TEXT SIZE"--> | |
485 | 169 |
501 | 170 <!--"BEGIN DICTIONARY OVERVIEW"--> |
508 | 171 <div class="options" tal:condition="python:'dict' in viewLayers"> |
501 | 172 <h4>Dictionary view</h4> |
173 <form name="f3" action=""> | |
508 | 174 <ul> |
175 <li> | |
176 <input type="radio" name="r3" /> Tab | |
177 </li> | |
178 <li> | |
179 <input type="radio" name="r3" /> Window | |
180 </li> | |
181 </ul> | |
501 | 182 </form> |
183 </div> | |
184 <!--"END DICTIONARY OVERVIEW"--> | |
185 | |
186 <!--"BEGIN TEXT NORMALIZATION"--> | |
508 | 187 <div class="options"> |
501 | 188 <h4>Text normalization</h4> |
189 <form tal:attributes="action viewerUrl" class="autosubmit" | |
190 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | |
191 <input type="hidden" | |
509
9d05befdd462
try to get characterNormalization in search result working.
casties
parents:
508
diff
changeset
|
192 tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})" |
501 | 193 tal:repeat="param params" |
508 | 194 tal:attributes="name param; value python:params[param]" /> |
195 <ul> | |
196 <li> | |
197 <input type="radio" class="autosubmit" name="characterNormalization" | |
198 value="orig" tal:attributes="checked python:norm=='orig'" /> Original | |
199 </li> | |
200 <li> | |
201 <input type="radio" class="autosubmit" name="characterNormalization" | |
202 value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized | |
203 </li> | |
204 <li> | |
205 <input type="radio" class="autosubmit" name="characterNormalization" | |
206 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | |
207 Normalized | |
208 </li> | |
209 </ul> | |
210 <input type="submit" value="Go!" /> | |
501 | 211 </form> |
212 </div> | |
213 <!--"END TEXT NORMALIZATION"--> | |
214 | |
215 <!--"BEGIN PLACES"--> | |
508 | 216 <div class="options" tal:condition="python:'gis' in viewLayers"> |
506 | 217 <tal:block tal:define=" |
218 name docinfo/documentName; | |
219 places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn); | |
220 pidlist python:','.join([p['id'] for p in places]);"> | |
221 <h4>Places</h4> | |
222 <ul> | |
223 <li><a | |
224 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?id=%s&format=gis'%(name,pidlist)" | |
225 target="_blank">on this page</a> | |
226 </li> | |
227 <li> | |
228 <a | |
229 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?format=gis'%(name)" | |
230 target="_blank">in whole document</a> | |
231 </li> | |
232 </ul> | |
501 | 233 </tal:block> |
234 </div> | |
235 <!--"END PLACES"--> | |
236 </div> | |
237 <!-- /col-right --> | |
238 | |
239 </div> | |
240 <!-- /page-body --> | |
241 | |
242 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> | |
243 <div class="errortext">Sorry, access to this document is restricted.</div> | |
244 </div> | |
245 | |
246 </tal:block> | |
247 </body> | |
248 <body tal:condition="not:numPages"> | |
249 <div class="errortext">Sorry, document doesn't exist.</div> | |
250 </body> | |
251 </html> |