Mercurial > hg > documentViewer
annotate zpt/viewer_text.zpt @ 525:70c3ae5eac7c
layers can have their own templates.
first version of annotations layer.
author | casties |
---|---|
date | Thu, 05 Apr 2012 19:29:50 +0200 |
parents | c55e376be01b |
children | 3f375a048402 |
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; |
525 | 6 availableLayers python:here.getAvailableLayers().get('text', None); |
508 | 7 viewerUrl docinfo/viewerUrl; |
501 | 8 rootUrl here/getDocumentViewerURL; |
9 numPages docinfo/numPages | nothing;"> | |
10 <head> | |
525 | 11 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
12 <title 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 <!-- layer headers --> | |
27 <tal:block tal:repeat="layer viewLayers"> | |
28 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" | |
29 tal:condition="python:exists(mpath)"> | |
30 <metal:block metal:use-macro="python:path(mpath)" /> | |
31 </tal:block> | |
32 </tal:block> | |
33 | |
501 | 34 </head> |
35 <body tal:condition="numPages"> | |
36 <tal:block | |
37 tal:define="docpath docinfo/textURLPath; | |
506 | 38 pn pageinfo/pn; |
512 | 39 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl'; |
508 | 40 query python:request.get('query', None); |
41 queryType python:request.get('queryType','fulltextMorph'); | |
506 | 42 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
502 | 43 <!-- header --> |
501 | 44 <div class="page-head"> |
45 <metal:block metal:use-macro="here/template/common_template/macros/head" /> | |
46 </div> | |
47 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)"> | |
48 <!--table of contents--> | |
510 | 49 <div class="col toc"> |
501 | 50 <metal:block |
51 metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> | |
52 </div> | |
53 | |
54 <!-- text page --> | |
510 | 55 <div class="col main"> |
501 | 56 <div class="ruler"> |
57 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" /> | |
58 </div> | |
59 <ul class="switcher"> | |
60 <li> | |
61 <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a> | |
62 </li> | |
63 <li class="sel">Text</li> | |
64 </ul> | |
65 <div class="content"> | |
66 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" | |
67 tal:content="structure pageinfo/pageHeaderTitle" /> | |
68 <tal:block tal:replace="structure textPage" /> | |
69 </div> | |
70 </div> | |
508 | 71 <!-- end of col-main --> |
501 | 72 |
510 | 73 <!-- right-side search results --> |
511 | 74 <div class="col results" tal:condition="query"> |
510 | 75 <!--"BEGIN SEARCH RESULTS" --> |
76 <div class="options"> | |
77 <h4>Search results</h4> | |
525 | 78 <div metal:use-macro="here/template/search_template/macros/results_div" /> |
510 | 79 </div> |
80 </div> | |
81 | |
501 | 82 <!-- right-side options --> |
510 | 83 <div class="col buttons"> |
501 | 84 <!--"BEGIN TEXT DISPLAY" --> |
85 <div class="options"> | |
86 <h4>Text display</h4> | |
87 <form tal:attributes="action viewerUrl" class="autosubmit"> | |
88 <input type="hidden" | |
503 | 89 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" |
501 | 90 tal:repeat="param params" |
508 | 91 tal:attributes="name param; value python:params[param]" /> |
92 <ul> | |
93 <li> | |
94 <input class="autosubmit" type="radio" name="viewMode" value="text" | |
95 tal:attributes="checked python:viewMode=='text'" /> Text | |
96 <ul> | |
525 | 97 <!-- text layers --> |
508 | 98 <li> |
99 <input type="checkbox" class="autosubmit" name="viewLayer" | |
100 value="dict" tal:attributes="checked python:'dict' in viewLayers" /> | |
101 Dictionary | |
102 </li> | |
511 | 103 <li tal:condition="python:query"> |
508 | 104 <input type="checkbox" class="autosubmit" name="viewLayer" |
105 value="search" | |
525 | 106 tal:attributes="checked python:'search' in viewLayers" /> Search |
107 hits | |
508 | 108 </li> |
525 | 109 <!-- auto-layer select buttons --> |
110 <tal:block tal:repeat="layer availableLayers"> | |
111 <tal:block | |
112 tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li" | |
113 tal:condition="python:exists(mpath)"> | |
114 <li metal:use-macro="python:path(mpath)" /> | |
115 </tal:block> | |
116 </tal:block> | |
508 | 117 </ul> |
118 </li> | |
119 <li> | |
120 <input type="radio" class="autosubmit" name="viewMode" value="xml" | |
121 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input | |
122 type="submit" value="Go!" /> | |
123 </li> | |
124 </ul> | |
501 | 125 </form> |
126 </div> | |
127 <!--"END TEXT DISPLAY"--> | |
128 | |
508 | 129 <!--"BEGIN SEARCH"--> |
130 <div class="options"> | |
131 <h4>Search</h4> | |
132 <form tal:attributes="action viewerUrl"> | |
133 <input type="hidden" | |
134 tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})" | |
135 tal:repeat="param params" | |
136 tal:attributes="name param; value python:params[param]" /> | |
137 <!-- make sure we have one viewLayer=search --> | |
138 <tal:block tal:repeat="vl viewLayers"> | |
525 | 139 <input type="hidden" name="viewLayer" tal:attributes="value vl" |
140 tal:condition="python:vl != 'search'" /> | |
508 | 141 </tal:block> |
525 | 142 <input type="hidden" name="viewLayer" value="search" /> |
508 | 143 <!-- query text --> |
525 | 144 <input type="text" name="query" tal:attributes="value query" /> <input |
145 type="submit" value="Search" /> <a | |
146 tal:attributes="href python:here.getLink('query',None)">Clear</a> | |
508 | 147 <ul> |
525 | 148 <li> |
149 <input type="radio" name="queryType" value="fulltext" | |
150 tal:attributes="checked python:queryType=='fulltext'" /> Exact | |
151 </li> | |
152 <li> | |
153 <input type="radio" name="queryType" value="fulltextMorph" | |
154 tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms | |
155 </li> | |
156 <li> | |
157 <input type="radio" name="queryType" value="ftIndex" | |
158 tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index | |
159 </li> | |
160 <li> | |
161 <input type="radio" name="queryType" value="ftIndexMorph" | |
162 tal:attributes="checked python:queryType=='ftIndexMorph'" /> | |
163 Morphological index | |
164 </li> | |
508 | 165 </ul> |
166 </form> | |
167 </div> | |
168 <!--"END SEARCH"--> | |
169 | |
501 | 170 <!--"BEGIN TEXT SIZE"--> |
171 <div class="options"> | |
172 <h4>Text size</h4> | |
508 | 173 <ul class="fsizer"> |
174 <li> | |
175 <a href="javascript:fontSize(12);" class="fs_sml">S</a> | |
176 </li> | |
177 <li> | |
178 <a href="javascript:fontSize(14);" class="fs_med">M</a> | |
179 </li> | |
180 <li> | |
181 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> | |
182 </li> | |
183 </ul> | |
501 | 184 </div> |
185 <!--"END TEXT SIZE"--> | |
485 | 186 |
501 | 187 <!--"BEGIN DICTIONARY OVERVIEW"--> |
508 | 188 <div class="options" tal:condition="python:'dict' in viewLayers"> |
501 | 189 <h4>Dictionary view</h4> |
190 <form name="f3" action=""> | |
508 | 191 <ul> |
192 <li> | |
193 <input type="radio" name="r3" /> Tab | |
194 </li> | |
195 <li> | |
196 <input type="radio" name="r3" /> Window | |
197 </li> | |
198 </ul> | |
501 | 199 </form> |
200 </div> | |
201 <!--"END DICTIONARY OVERVIEW"--> | |
202 | |
203 <!--"BEGIN TEXT NORMALIZATION"--> | |
508 | 204 <div class="options"> |
501 | 205 <h4>Text normalization</h4> |
206 <form tal:attributes="action viewerUrl" class="autosubmit" | |
207 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | |
208 <input type="hidden" | |
509
9d05befdd462
try to get characterNormalization in search result working.
casties
parents:
508
diff
changeset
|
209 tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})" |
501 | 210 tal:repeat="param params" |
508 | 211 tal:attributes="name param; value python:params[param]" /> |
212 <ul> | |
213 <li> | |
214 <input type="radio" class="autosubmit" name="characterNormalization" | |
215 value="orig" tal:attributes="checked python:norm=='orig'" /> Original | |
216 </li> | |
217 <li> | |
218 <input type="radio" class="autosubmit" name="characterNormalization" | |
219 value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized | |
220 </li> | |
221 <li> | |
222 <input type="radio" class="autosubmit" name="characterNormalization" | |
223 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | |
224 Normalized | |
225 </li> | |
226 </ul> | |
227 <input type="submit" value="Go!" /> | |
501 | 228 </form> |
229 </div> | |
230 <!--"END TEXT NORMALIZATION"--> | |
231 | |
525 | 232 <!-- auto-layer option boxes --> |
233 <tal:block tal:repeat="layer viewLayers"> | |
234 <tal:block | |
235 tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box" | |
236 tal:condition="python:exists(mpath)"> | |
237 <metal:block metal:use-macro="python:path(mpath)" /> | |
501 | 238 </tal:block> |
525 | 239 </tal:block> |
501 | 240 </div> |
241 <!-- /col-right --> | |
242 | |
243 </div> | |
244 <!-- /page-body --> | |
245 | |
246 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> | |
247 <div class="errortext">Sorry, access to this document is restricted.</div> | |
248 </div> | |
249 | |
250 </tal:block> | |
251 </body> | |
252 <body tal:condition="not:numPages"> | |
253 <div class="errortext">Sorry, document doesn't exist.</div> | |
254 </body> | |
255 </html> |