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