Mercurial > hg > documentViewer
annotate 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 |
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> | |
526 | 26 <!-- layer headers (rendered always) --> |
27 <tal:block tal:repeat="layer availableLayers"> | |
525 | 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'; |
506 | 40 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
502 | 41 <!-- header --> |
501 | 42 <div class="page-head"> |
43 <metal:block metal:use-macro="here/template/common_template/macros/head" /> | |
44 </div> | |
45 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)"> | |
46 <!--table of contents--> | |
510 | 47 <div class="col toc"> |
501 | 48 <metal:block |
49 metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> | |
50 </div> | |
51 | |
52 <!-- text page --> | |
510 | 53 <div class="col main"> |
501 | 54 <div class="ruler"> |
55 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" /> | |
56 </div> | |
57 <ul class="switcher"> | |
58 <li> | |
59 <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a> | |
60 </li> | |
61 <li class="sel">Text</li> | |
62 </ul> | |
63 <div class="content"> | |
64 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" | |
65 tal:content="structure pageinfo/pageHeaderTitle" /> | |
66 <tal:block tal:replace="structure textPage" /> | |
67 </div> | |
68 </div> | |
508 | 69 <!-- end of col-main --> |
501 | 70 |
526 | 71 <!-- layer columns (rendered always) --> |
72 <tal:block tal:repeat="layer availableLayers"> | |
73 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/extra_column" | |
74 tal:condition="python:exists(mpath)"> | |
75 <metal:block metal:use-macro="python:path(mpath)" /> | |
76 </tal:block> | |
77 </tal:block> | |
510 | 78 |
501 | 79 <!-- right-side options --> |
510 | 80 <div class="col buttons"> |
501 | 81 <!--"BEGIN TEXT DISPLAY" --> |
82 <div class="options"> | |
83 <h4>Text display</h4> | |
84 <form tal:attributes="action viewerUrl" class="autosubmit"> | |
85 <input type="hidden" | |
503 | 86 tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" |
501 | 87 tal:repeat="param params" |
508 | 88 tal:attributes="name param; value python:params[param]" /> |
89 <ul> | |
90 <li> | |
91 <input class="autosubmit" type="radio" name="viewMode" value="text" | |
92 tal:attributes="checked python:viewMode=='text'" /> Text | |
93 <ul> | |
526 | 94 <!-- text layer select buttons (rendered always) --> |
525 | 95 <tal:block tal:repeat="layer availableLayers"> |
96 <tal:block | |
97 tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li" | |
98 tal:condition="python:exists(mpath)"> | |
99 <li metal:use-macro="python:path(mpath)" /> | |
100 </tal:block> | |
101 </tal:block> | |
508 | 102 </ul> |
103 </li> | |
104 <li> | |
105 <input type="radio" class="autosubmit" name="viewMode" value="xml" | |
106 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input | |
107 type="submit" value="Go!" /> | |
108 </li> | |
109 </ul> | |
501 | 110 </form> |
111 </div> | |
112 <!--"END TEXT DISPLAY"--> | |
113 | |
114 <!--"BEGIN TEXT SIZE"--> | |
115 <div class="options"> | |
116 <h4>Text size</h4> | |
508 | 117 <ul class="fsizer"> |
118 <li> | |
119 <a href="javascript:fontSize(12);" class="fs_sml">S</a> | |
120 </li> | |
121 <li> | |
122 <a href="javascript:fontSize(14);" class="fs_med">M</a> | |
123 </li> | |
124 <li> | |
125 <a href="javascript:fontSize(16);" class="fs_lrg">L</a> | |
126 </li> | |
127 </ul> | |
501 | 128 </div> |
129 <!--"END TEXT SIZE"--> | |
485 | 130 |
501 | 131 <!--"BEGIN TEXT NORMALIZATION"--> |
508 | 132 <div class="options"> |
501 | 133 <h4>Text normalization</h4> |
134 <form tal:attributes="action viewerUrl" class="autosubmit" | |
135 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | |
136 <input type="hidden" | |
509
9d05befdd462
try to get characterNormalization in search result working.
casties
parents:
508
diff
changeset
|
137 tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})" |
501 | 138 tal:repeat="param params" |
508 | 139 tal:attributes="name param; value python:params[param]" /> |
140 <ul> | |
141 <li> | |
142 <input type="radio" class="autosubmit" name="characterNormalization" | |
143 value="orig" tal:attributes="checked python:norm=='orig'" /> Original | |
144 </li> | |
145 <li> | |
146 <input type="radio" class="autosubmit" name="characterNormalization" | |
147 value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized | |
148 </li> | |
149 <li> | |
150 <input type="radio" class="autosubmit" name="characterNormalization" | |
151 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | |
152 Normalized | |
153 </li> | |
154 </ul> | |
155 <input type="submit" value="Go!" /> | |
501 | 156 </form> |
157 </div> | |
158 <!--"END TEXT NORMALIZATION"--> | |
159 | |
526 | 160 <!-- layer option boxes (rendered if active) --> |
161 <tal:block tal:repeat="layer availableLayers"> | |
525 | 162 <tal:block |
163 tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box" | |
164 tal:condition="python:exists(mpath)"> | |
165 <metal:block metal:use-macro="python:path(mpath)" /> | |
501 | 166 </tal:block> |
525 | 167 </tal:block> |
501 | 168 </div> |
169 <!-- /col-right --> | |
170 | |
171 </div> | |
172 <!-- /page-body --> | |
173 | |
174 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> | |
175 <div class="errortext">Sorry, access to this document is restricted.</div> | |
176 </div> | |
177 | |
178 </tal:block> | |
179 </body> | |
180 <body tal:condition="not:numPages"> | |
181 <div class="errortext">Sorry, document doesn't exist.</div> | |
182 </body> | |
183 </html> |