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