Mercurial > hg > documentViewer
comparison 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 |
comparison
equal
deleted
inserted
replaced
507:3c01e8f4e72b | 508:d5a47f82e755 |
---|---|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
3 <html xmlns="http://www.w3.org/1999/xhtml" | 3 <html xmlns="http://www.w3.org/1999/xhtml" |
4 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; | 4 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; |
5 tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewerUrl docinfo/viewerUrl; | 5 tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers; |
6 viewerUrl docinfo/viewerUrl; | |
6 rootUrl here/getDocumentViewerURL; | 7 rootUrl here/getDocumentViewerURL; |
7 numPages docinfo/numPages | nothing;"> | 8 numPages docinfo/numPages | nothing;"> |
8 <head> | 9 <head> |
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
10 <title | 11 <title |
26 <body tal:condition="numPages"> | 27 <body tal:condition="numPages"> |
27 <tal:block | 28 <tal:block |
28 tal:define="docpath docinfo/textURLPath; | 29 tal:define="docpath docinfo/textURLPath; |
29 pn pageinfo/pn; | 30 pn pageinfo/pn; |
30 flowLtr python:pageinfo.get('pageFlow','ltr')!='rtl'; | 31 flowLtr python:pageinfo.get('pageFlow','ltr')!='rtl'; |
32 query python:request.get('query', None); | |
33 queryType python:request.get('queryType','fulltextMorph'); | |
31 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> | 34 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
32 <!-- header --> | 35 <!-- header --> |
33 <div class="page-head"> | 36 <div class="page-head"> |
34 <metal:block metal:use-macro="here/template/common_template/macros/head" /> | 37 <metal:block metal:use-macro="here/template/common_template/macros/head" /> |
35 </div> | 38 </div> |
55 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" | 58 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" |
56 tal:content="structure pageinfo/pageHeaderTitle" /> | 59 tal:content="structure pageinfo/pageHeaderTitle" /> |
57 <tal:block tal:replace="structure textPage" /> | 60 <tal:block tal:replace="structure textPage" /> |
58 </div> | 61 </div> |
59 </div> | 62 </div> |
60 <!-- col-main --> | 63 <!-- end of col-main --> |
61 | 64 |
62 <!-- right-side options --> | 65 <!-- right-side options --> |
63 <div class="col-right"> | 66 <div class="col-right"> |
64 <!--"BEGIN TEXT DISPLAY" --> | 67 <!--"BEGIN TEXT DISPLAY" --> |
65 <div class="options"> | 68 <div class="options"> |
66 <h4>Text display</h4> | 69 <h4>Text display</h4> |
70 <pre tal:content="python:repr(viewLayers)" /> | |
67 <form tal:attributes="action viewerUrl" class="autosubmit"> | 71 <form tal:attributes="action viewerUrl" class="autosubmit"> |
68 <input type="hidden" | 72 <input type="hidden" |
69 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" | 73 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" |
70 tal:repeat="param params" | 74 tal:repeat="param params" |
71 tal:attributes="name param; value python:params[param]" /> <input | 75 tal:attributes="name param; value python:params[param]" /> |
72 class="autosubmit" type="radio" name="viewMode" value="text" | 76 <ul> |
73 tal:attributes="checked python:viewMode=='text'" /> Text<br /> <span | 77 <li> |
74 class="optionsText"> <input type="checkbox" | 78 <input class="autosubmit" type="radio" name="viewMode" value="text" |
75 class="autosubmit" name="viewLayer" value="dict" | 79 tal:attributes="checked python:viewMode=='text'" /> Text |
76 tal:attributes="checked python:viewLayer=='dict'" /> Dictionary<br /> | 80 <ul> |
77 </span> <span class="optionsText" tal:condition="python:docinfo.get('numPlaces',0)"> | 81 <li> |
78 <input type="checkbox" class="autosubmit" name="viewLayer" | 82 <input type="checkbox" class="autosubmit" name="viewLayer" |
79 value="gis" tal:attributes="checked python:viewLayer=='gis'" /> Places<br /> | 83 value="dict" tal:attributes="checked python:'dict' in viewLayers" /> |
80 </span> <input type="radio" class="autosubmit" name="viewMode" value="xml" | 84 Dictionary |
81 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input | 85 </li> |
82 type="submit" value="Go!" /> | 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> | |
83 </form> | 103 </form> |
84 </div> | 104 </div> |
85 <!--"END TEXT DISPLAY"--> | 105 <!--"END TEXT DISPLAY"--> |
86 | 106 |
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 | |
87 <!--"BEGIN TEXT SIZE"--> | 145 <!--"BEGIN TEXT SIZE"--> |
88 <div class="options"> | 146 <div class="options"> |
89 <h4>Text size</h4> | 147 <h4>Text size</h4> |
90 <div class="fsizer"> | 148 <ul class="fsizer"> |
91 <a href="javascript:fontSize(12);" class="fs_sml">S</a> <a | 149 <li> |
92 href="javascript:fontSize(14);" class="fs_med">M</a> <a | 150 <a href="javascript:fontSize(12);" class="fs_sml">S</a> |
93 href="javascript:fontSize(16);" class="fs_lrg">L</a> | 151 </li> |
94 </div> | 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> | |
95 </div> | 159 </div> |
96 <!--"END TEXT SIZE"--> | 160 <!--"END TEXT SIZE"--> |
97 | 161 |
98 <!--"BEGIN DICTIONARY OVERVIEW"--> | 162 <!--"BEGIN DICTIONARY OVERVIEW"--> |
99 <div class="options" tal:condition="python:viewLayer=='dict'"> | 163 <div class="options" tal:condition="python:'dict' in viewLayers"> |
100 <h4>Dictionary view</h4> | 164 <h4>Dictionary view</h4> |
101 <form name="f3" action=""> | 165 <form name="f3" action=""> |
102 <input type="radio" name="r3" />Tab<br /> <input type="radio" name="r3" />Window<br /> | 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> | |
103 </form> | 174 </form> |
104 </div> | 175 </div> |
105 <!--"END DICTIONARY OVERVIEW"--> | 176 <!--"END DICTIONARY OVERVIEW"--> |
106 | 177 |
107 <!--"BEGIN TEXT NORMALIZATION"--> | 178 <!--"BEGIN TEXT NORMALIZATION"--> |
108 <div class="options" tal:condition="python:viewLayer!='xml'"> | 179 <div class="options"> |
109 <h4>Text normalization</h4> | 180 <h4>Text normalization</h4> |
110 <form tal:attributes="action viewerUrl" class="autosubmit" | 181 <form tal:attributes="action viewerUrl" class="autosubmit" |
111 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | 182 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> |
112 <input type="hidden" | 183 <input type="hidden" |
113 tal:define="params python:here.getParams('characterNormalization',None)" | 184 tal:define="params python:here.getParams('characterNormalization',None)" |
114 tal:repeat="param params" | 185 tal:repeat="param params" |
115 tal:attributes="name param; value python:params[param]" /> <input | 186 tal:attributes="name param; value python:params[param]" /> |
116 type="radio" class="autosubmit" name="characterNormalization" value="orig" | 187 <ul> |
117 tal:attributes="checked python:norm=='orig'" /> Original<br /> <input | 188 <li> |
118 type="radio" class="autosubmit" name="characterNormalization" value="reg" | 189 <input type="radio" class="autosubmit" name="characterNormalization" |
119 tal:attributes="checked python:norm=='reg'" /> Regularized<br /> <input | 190 value="orig" tal:attributes="checked python:norm=='orig'" /> Original |
120 type="radio" class="autosubmit" name="characterNormalization" | 191 </li> |
121 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | 192 <li> |
122 Normalized<br /> <input type="submit" value="Go!" /> | 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!" /> | |
123 </form> | 203 </form> |
124 </div> | 204 </div> |
125 <!--"END TEXT NORMALIZATION"--> | 205 <!--"END TEXT NORMALIZATION"--> |
126 | 206 |
127 <!--"BEGIN PLACES"--> | 207 <!--"BEGIN PLACES"--> |
128 <div class="options" tal:condition="python:viewLayer=='gis'"> | 208 <div class="options" tal:condition="python:'gis' in viewLayers"> |
129 <tal:block tal:define=" | 209 <tal:block tal:define=" |
130 name docinfo/documentName; | 210 name docinfo/documentName; |
131 places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn); | 211 places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn); |
132 pidlist python:','.join([p['id'] for p in places]);"> | 212 pidlist python:','.join([p['id'] for p in places]);"> |
133 <h4>Places</h4> | 213 <h4>Places</h4> |
145 </tal:block> | 225 </tal:block> |
146 </div> | 226 </div> |
147 <!--"END PLACES"--> | 227 <!--"END PLACES"--> |
148 </div> | 228 </div> |
149 <!-- /col-right --> | 229 <!-- /col-right --> |
230 | |
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> | |
150 | 239 |
151 </div> | 240 </div> |
152 <!-- /page-body --> | 241 <!-- /page-body --> |
153 | 242 |
154 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> | 243 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> |