Mercurial > hg > documentViewer
comparison zpt/viewer_text.zpt @ 526:3f375a048402
moved search and dict into separate layers.
removed search_template.
added tocMode=concordance.
fixed bug with paging tocs.
author | casties |
---|---|
date | Tue, 10 Apr 2012 19:41:44 +0200 |
parents | 70c3ae5eac7c |
children | 5c7433c2515c |
comparison
equal
deleted
inserted
replaced
525:70c3ae5eac7c | 526:3f375a048402 |
---|---|
21 }); | 21 }); |
22 $('form.autosubmit input[type="submit"]').hide(); | 22 $('form.autosubmit input[type="submit"]').hide(); |
23 }); | 23 }); |
24 // --> | 24 // --> |
25 </script> | 25 </script> |
26 <!-- layer headers --> | 26 <!-- layer headers (rendered always) --> |
27 <tal:block tal:repeat="layer viewLayers"> | 27 <tal:block tal:repeat="layer availableLayers"> |
28 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" | 28 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" |
29 tal:condition="python:exists(mpath)"> | 29 tal:condition="python:exists(mpath)"> |
30 <metal:block metal:use-macro="python:path(mpath)" /> | 30 <metal:block metal:use-macro="python:path(mpath)" /> |
31 </tal:block> | 31 </tal:block> |
32 </tal:block> | 32 </tal:block> |
35 <body tal:condition="numPages"> | 35 <body tal:condition="numPages"> |
36 <tal:block | 36 <tal:block |
37 tal:define="docpath docinfo/textURLPath; | 37 tal:define="docpath docinfo/textURLPath; |
38 pn pageinfo/pn; | 38 pn pageinfo/pn; |
39 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl'; | 39 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl'; |
40 query python:request.get('query', None); | |
41 queryType python:request.get('queryType','fulltextMorph'); | |
42 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> | 40 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
43 <!-- header --> | 41 <!-- header --> |
44 <div class="page-head"> | 42 <div class="page-head"> |
45 <metal:block metal:use-macro="here/template/common_template/macros/head" /> | 43 <metal:block metal:use-macro="here/template/common_template/macros/head" /> |
46 </div> | 44 </div> |
68 <tal:block tal:replace="structure textPage" /> | 66 <tal:block tal:replace="structure textPage" /> |
69 </div> | 67 </div> |
70 </div> | 68 </div> |
71 <!-- end of col-main --> | 69 <!-- end of col-main --> |
72 | 70 |
73 <!-- right-side search results --> | 71 <!-- layer columns (rendered always) --> |
74 <div class="col results" tal:condition="query"> | 72 <tal:block tal:repeat="layer availableLayers"> |
75 <!--"BEGIN SEARCH RESULTS" --> | 73 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/extra_column" |
76 <div class="options"> | 74 tal:condition="python:exists(mpath)"> |
77 <h4>Search results</h4> | 75 <metal:block metal:use-macro="python:path(mpath)" /> |
78 <div metal:use-macro="here/template/search_template/macros/results_div" /> | 76 </tal:block> |
79 </div> | 77 </tal:block> |
80 </div> | |
81 | 78 |
82 <!-- right-side options --> | 79 <!-- right-side options --> |
83 <div class="col buttons"> | 80 <div class="col buttons"> |
84 <!--"BEGIN TEXT DISPLAY" --> | 81 <!--"BEGIN TEXT DISPLAY" --> |
85 <div class="options"> | 82 <div class="options"> |
92 <ul> | 89 <ul> |
93 <li> | 90 <li> |
94 <input class="autosubmit" type="radio" name="viewMode" value="text" | 91 <input class="autosubmit" type="radio" name="viewMode" value="text" |
95 tal:attributes="checked python:viewMode=='text'" /> Text | 92 tal:attributes="checked python:viewMode=='text'" /> Text |
96 <ul> | 93 <ul> |
97 <!-- text layers --> | 94 <!-- text layer select buttons (rendered always) --> |
98 <li> | |
99 <input type="checkbox" class="autosubmit" name="viewLayer" | |
100 value="dict" tal:attributes="checked python:'dict' in viewLayers" /> | |
101 Dictionary | |
102 </li> | |
103 <li tal:condition="python:query"> | |
104 <input type="checkbox" class="autosubmit" name="viewLayer" | |
105 value="search" | |
106 tal:attributes="checked python:'search' in viewLayers" /> Search | |
107 hits | |
108 </li> | |
109 <!-- auto-layer select buttons --> | |
110 <tal:block tal:repeat="layer availableLayers"> | 95 <tal:block tal:repeat="layer availableLayers"> |
111 <tal:block | 96 <tal:block |
112 tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li" | 97 tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li" |
113 tal:condition="python:exists(mpath)"> | 98 tal:condition="python:exists(mpath)"> |
114 <li metal:use-macro="python:path(mpath)" /> | 99 <li metal:use-macro="python:path(mpath)" /> |
124 </ul> | 109 </ul> |
125 </form> | 110 </form> |
126 </div> | 111 </div> |
127 <!--"END TEXT DISPLAY"--> | 112 <!--"END TEXT DISPLAY"--> |
128 | 113 |
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"> | |
139 <input type="hidden" name="viewLayer" tal:attributes="value vl" | |
140 tal:condition="python:vl != 'search'" /> | |
141 </tal:block> | |
142 <input type="hidden" name="viewLayer" value="search" /> | |
143 <!-- query text --> | |
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> | |
147 <ul> | |
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> | |
165 </ul> | |
166 </form> | |
167 </div> | |
168 <!--"END SEARCH"--> | |
169 | |
170 <!--"BEGIN TEXT SIZE"--> | 114 <!--"BEGIN TEXT SIZE"--> |
171 <div class="options"> | 115 <div class="options"> |
172 <h4>Text size</h4> | 116 <h4>Text size</h4> |
173 <ul class="fsizer"> | 117 <ul class="fsizer"> |
174 <li> | 118 <li> |
181 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> | 125 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> |
182 </li> | 126 </li> |
183 </ul> | 127 </ul> |
184 </div> | 128 </div> |
185 <!--"END TEXT SIZE"--> | 129 <!--"END TEXT SIZE"--> |
186 | |
187 <!--"BEGIN DICTIONARY OVERVIEW"--> | |
188 <div class="options" tal:condition="python:'dict' in viewLayers"> | |
189 <h4>Dictionary view</h4> | |
190 <form name="f3" action=""> | |
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> | |
199 </form> | |
200 </div> | |
201 <!--"END DICTIONARY OVERVIEW"--> | |
202 | 130 |
203 <!--"BEGIN TEXT NORMALIZATION"--> | 131 <!--"BEGIN TEXT NORMALIZATION"--> |
204 <div class="options"> | 132 <div class="options"> |
205 <h4>Text normalization</h4> | 133 <h4>Text normalization</h4> |
206 <form tal:attributes="action viewerUrl" class="autosubmit" | 134 <form tal:attributes="action viewerUrl" class="autosubmit" |
227 <input type="submit" value="Go!" /> | 155 <input type="submit" value="Go!" /> |
228 </form> | 156 </form> |
229 </div> | 157 </div> |
230 <!--"END TEXT NORMALIZATION"--> | 158 <!--"END TEXT NORMALIZATION"--> |
231 | 159 |
232 <!-- auto-layer option boxes --> | 160 <!-- layer option boxes (rendered if active) --> |
233 <tal:block tal:repeat="layer viewLayers"> | 161 <tal:block tal:repeat="layer availableLayers"> |
234 <tal:block | 162 <tal:block |
235 tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box" | 163 tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box" |
236 tal:condition="python:exists(mpath)"> | 164 tal:condition="python:exists(mpath)"> |
237 <metal:block metal:use-macro="python:path(mpath)" /> | 165 <metal:block metal:use-macro="python:path(mpath)" /> |
238 </tal:block> | 166 </tal:block> |