Mercurial > hg > documentViewer
annotate zpt/viewer_text.zpt @ 515:0afba3afd538
more cleanup.
author | casties |
---|---|
date | Tue, 28 Feb 2012 21:22:52 +0100 |
parents | c55e376be01b |
children | 70c3ae5eac7c |
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> | |
514 | 10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
501 | 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; |
512 | 31 flowLtr python:docinfo.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 --> |
511 | 66 <div class="col results" tal:condition="query"> |
510 | 67 <!--"BEGIN SEARCH RESULTS" --> |
68 <div class="options"> | |
69 <h4>Search results</h4> | |
511 | 70 <div metal:use-macro="here/template/search_template/macros/results_div"/> |
510 | 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> | |
511 | 94 <li tal:condition="python:query"> |
508 | 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"/> | |
511 | 131 <a tal:attributes="href python:here.getLink('query',None)">Clear</a> |
508 | 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 | |
501 | 154 <!--"BEGIN TEXT SIZE"--> |
155 <div class="options"> | |
156 <h4>Text size</h4> | |
508 | 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> | |
501 | 168 </div> |
169 <!--"END TEXT SIZE"--> | |
485 | 170 |
501 | 171 <!--"BEGIN DICTIONARY OVERVIEW"--> |
508 | 172 <div class="options" tal:condition="python:'dict' in viewLayers"> |
501 | 173 <h4>Dictionary view</h4> |
174 <form name="f3" action=""> | |
508 | 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> | |
501 | 183 </form> |
184 </div> | |
185 <!--"END DICTIONARY OVERVIEW"--> | |
186 | |
187 <!--"BEGIN TEXT NORMALIZATION"--> | |
508 | 188 <div class="options"> |
501 | 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" | |
509
9d05befdd462
try to get characterNormalization in search result working.
casties
parents:
508
diff
changeset
|
193 tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})" |
501 | 194 tal:repeat="param params" |
508 | 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!" /> | |
501 | 212 </form> |
213 </div> | |
214 <!--"END TEXT NORMALIZATION"--> | |
215 | |
216 <!--"BEGIN PLACES"--> | |
508 | 217 <div class="options" tal:condition="python:'gis' in viewLayers"> |
506 | 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> | |
501 | 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> |