Mercurial > hg > documentViewer
annotate zpt/viewer_text.zpt @ 501:29c6d09a506c elementtree
more cleanup.
viewMode=index works now.
moved common template parts in common_template.
author | casties |
---|---|
date | Wed, 15 Feb 2012 17:57:02 +0100 |
parents | 6f116b86a226 |
children | daf36d0fcfee |
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; |
5 tocMode pageinfo/tocMode; viewType pageinfo/viewType; viewerUrl docinfo/viewerUrl; | |
6 rootUrl here/getDocumentViewerURL; | |
7 numPages docinfo/numPages | nothing;"> | |
8 <head> | |
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
10 <title | |
11 tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" /> | |
12 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" /> | |
13 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script> | |
14 <script type="text/javascript"> | |
15 // <!-- | |
16 $(document).ready(function() { | |
17 // autosubmit forms | |
18 $('form.autosubmit').find('.autosubmit').change(function() { | |
19 this.form.submit(); | |
20 }); | |
21 $('form.autosubmit input[type="submit"]').hide(); | |
22 }); | |
23 // --> | |
24 </script> | |
25 </head> | |
26 <body tal:condition="numPages"> | |
27 <tal:block | |
28 tal:define="docpath docinfo/textURLPath; | |
490
6f116b86a226
more new template stuff. moved ImageFile index method to SrvTxtUtils
casties
parents:
489
diff
changeset
|
29 pn pageinfo/pn; |
6f116b86a226
more new template stuff. moved ImageFile index method to SrvTxtUtils
casties
parents:
489
diff
changeset
|
30 flowLtr python:pageinfo.get('pageFlow','ltr')!='rtl'; |
501 | 31 textPage python:here.getTextPage(mode=viewType, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';"> |
32 <div class="page-head"> | |
33 <metal:block metal:use-macro="here/template/common_template/macros/head" /> | |
34 </div> | |
35 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)"> | |
36 <!--table of contents--> | |
37 <div class="col-left"> | |
38 <metal:block | |
39 metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> | |
40 </div> | |
41 | |
42 <!-- text page --> | |
43 <div class="col-main"> | |
44 <div class="ruler"> | |
45 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" /> | |
46 </div> | |
47 <ul class="switcher"> | |
48 <li> | |
49 <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a> | |
50 </li> | |
51 <li class="sel">Text</li> | |
52 </ul> | |
53 <div class="content"> | |
54 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" | |
55 tal:content="structure pageinfo/pageHeaderTitle" /> | |
56 <tal:block tal:replace="structure textPage" /> | |
57 </div> | |
58 </div> | |
59 <!-- col-main --> | |
60 | |
61 <!-- right-side options --> | |
62 <div class="col-right"> | |
63 <!--"BEGIN TEXT DISPLAY" --> | |
64 <div class="options"> | |
65 <h4>Text display</h4> | |
66 <form tal:attributes="action viewerUrl" class="autosubmit"> | |
67 <input type="hidden" | |
68 tal:define="params python:here.getParams(params={'viewType':None})" | |
69 tal:repeat="param params" | |
70 tal:attributes="name param; value python:params[param]" /> <input | |
71 class="autosubmit" type="radio" name="viewType" value="" | |
72 tal:attributes="checked python:viewType!='xml'" /> Text<br /> <span | |
73 class="optionsText" tal:condition="python:viewType!='xml'"> | |
74 <input type="checkbox" class="autosubmit" name="viewType" | |
75 value="dict" tal:attributes="checked python:viewType=='dict'" /> Dictionary<br /> | |
76 </span> <span class="optionsText" | |
77 tal:condition="python:viewType!='xml' and docinfo.get('numPlaces',0)"> | |
78 <input type="checkbox" class="autosubmit" name="viewType" | |
79 value="gis" tal:attributes="checked python:viewType=='gis'" /> Places<br /> | |
80 </span> <input type="radio" class="autosubmit" name="viewType" | |
81 tal:attributes="value string:xml; checked python:viewType=='xml'" /> XML<br /> | |
82 <input type="submit" value="Go!" /> | |
83 </form> | |
84 </div> | |
85 <!--"END TEXT DISPLAY"--> | |
86 | |
87 <!--"BEGIN TEXT SIZE"--> | |
88 <div class="options"> | |
89 <h4>Text size</h4> | |
90 <div class="fsizer"> | |
91 <a href="javascript:fontSize(12);" class="fs_sml">S</a> <a | |
92 href="javascript:fontSize(14);" class="fs_med">M</a> <a | |
93 href="javascript:fontSize(16);" class="fs_lrg">L</a> | |
490
6f116b86a226
more new template stuff. moved ImageFile index method to SrvTxtUtils
casties
parents:
489
diff
changeset
|
94 </div> |
501 | 95 </div> |
96 <!--"END TEXT SIZE"--> | |
485 | 97 |
501 | 98 <!--"BEGIN DICTIONARY OVERVIEW"--> |
99 <div class="options" tal:condition="python:viewType=='dict'"> | |
100 <h4>Dictionary view</h4> | |
101 <form name="f3" action=""> | |
102 <input type="radio" name="r3" />Tab<br /> <input type="radio" name="r3" />Window<br /> | |
103 </form> | |
104 </div> | |
105 <!--"END DICTIONARY OVERVIEW"--> | |
106 | |
107 <!--"BEGIN TEXT NORMALIZATION"--> | |
108 <div class="options" tal:condition="python:viewType!='xml'"> | |
109 <h4>Text normalization</h4> | |
110 <form tal:attributes="action viewerUrl" class="autosubmit" | |
111 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');"> | |
112 <input type="hidden" | |
113 tal:define="params python:here.getParams('characterNormalization',None)" | |
114 tal:repeat="param params" | |
115 tal:attributes="name param; value python:params[param]" /> <input | |
116 type="radio" class="autosubmit" name="characterNormalization" value="orig" | |
117 tal:attributes="checked python:norm=='orig'" /> Original<br /> <input | |
118 type="radio" class="autosubmit" name="characterNormalization" value="reg" | |
119 tal:attributes="checked python:norm=='reg'" /> Regularized<br /> <input | |
120 type="radio" class="autosubmit" name="characterNormalization" | |
121 value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" /> | |
122 Normalized<br /> <input type="submit" value="Go!" /> | |
123 </form> | |
124 </div> | |
125 <!--"END TEXT NORMALIZATION"--> | |
126 | |
127 <!--"BEGIN PLACES"--> | |
128 <div class="options" tal:condition="python:viewType=='gis'"> | |
129 <tal:block | |
130 tal:define="gisPlaces python:here.getGisPlaces(docinfo=docinfo, pageinfo=pageinfo); gisAllPlaces python:here.getAllGisPlaces(docinfo=docinfo, pageinfo=pageinfo);"> | |
131 <span><b>Places</b></span> | |
132 <br />(Link to extern:)<br /> | |
133 <span>Page</span> | |
134 <span style="float: right"> <a | |
135 tal:attributes="href python:'http://chinagis.mpiwg-berlin.mpg.de/chinagis/REST/db/mpdl/%s?id=%s&format=%s'%(name,gisPlaces,'gis')" | |
136 target="_blank"> <img src="images/arrow.png" alt="" /> | |
137 </a> | |
138 </span> | |
139 <br /> | |
140 <span>Book</span> | |
141 <span style="float: right"> <a | |
142 tal:attributes="href python:'http://chinagis.mpiwg-berlin.mpg.de/chinagis/REST/db/mpdl/%s?format=%s'%(name,'gis')" | |
143 target="_blank"> <img src="images/arrow.png" alt="" /> | |
144 </a> | |
145 </span> | |
146 <br /> | |
147 </tal:block> | |
148 </div> | |
149 <!--"END PLACES"--> | |
150 </div> | |
151 <!-- /col-right --> | |
152 | |
153 </div> | |
154 <!-- /page-body --> | |
155 | |
156 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> | |
157 <div class="errortext">Sorry, access to this document is restricted.</div> | |
158 </div> | |
159 | |
160 </tal:block> | |
161 </body> | |
162 <body tal:condition="not:numPages"> | |
163 <div class="errortext">Sorry, document doesn't exist.</div> | |
164 </body> | |
165 </html> |