comparison zpt/viewer_text.zpt @ 525:70c3ae5eac7c

layers can have their own templates. first version of annotations layer.
author casties
date Thu, 05 Apr 2012 19:29:50 +0200
parents c55e376be01b
children 3f375a048402
comparison
equal deleted inserted replaced
524:1a20621f2555 525:70c3ae5eac7c
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; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers; 5 tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
6 availableLayers python:here.getAvailableLayers().get('text', None);
6 viewerUrl docinfo/viewerUrl; 7 viewerUrl docinfo/viewerUrl;
7 rootUrl here/getDocumentViewerURL; 8 rootUrl here/getDocumentViewerURL;
8 numPages docinfo/numPages | nothing;"> 9 numPages docinfo/numPages | nothing;">
9 <head> 10 <head>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 11 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11 <title 12 <title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
12 tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" /> 13 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
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>
14 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script> 15 <script type="text/javascript">
15 <script type="text/javascript"> 16 // <!--
16 // <!-- 17 $(document).ready(function() {
17 $(document).ready(function() { 18 // autosubmit forms
18 // autosubmit forms 19 $('form.autosubmit').find('.autosubmit').change(function() {
19 $('form.autosubmit').find('.autosubmit').change(function() { 20 this.form.submit();
20 this.form.submit(); 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 -->
27 <tal:block tal:repeat="layer viewLayers">
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
26 </head> 34 </head>
27 <body tal:condition="numPages"> 35 <body tal:condition="numPages">
28 <tal:block 36 <tal:block
29 tal:define="docpath docinfo/textURLPath; 37 tal:define="docpath docinfo/textURLPath;
30 pn pageinfo/pn; 38 pn pageinfo/pn;
65 <!-- right-side search results --> 73 <!-- right-side search results -->
66 <div class="col results" tal:condition="query"> 74 <div class="col results" tal:condition="query">
67 <!--"BEGIN SEARCH RESULTS" --> 75 <!--"BEGIN SEARCH RESULTS" -->
68 <div class="options"> 76 <div class="options">
69 <h4>Search results</h4> 77 <h4>Search results</h4>
70 <div metal:use-macro="here/template/search_template/macros/results_div"/> 78 <div metal:use-macro="here/template/search_template/macros/results_div" />
71 </div> 79 </div>
72 </div> 80 </div>
73 81
74 <!-- right-side options --> 82 <!-- right-side options -->
75 <div class="col buttons"> 83 <div class="col buttons">
84 <ul> 92 <ul>
85 <li> 93 <li>
86 <input class="autosubmit" type="radio" name="viewMode" value="text" 94 <input class="autosubmit" type="radio" name="viewMode" value="text"
87 tal:attributes="checked python:viewMode=='text'" /> Text 95 tal:attributes="checked python:viewMode=='text'" /> Text
88 <ul> 96 <ul>
97 <!-- text layers -->
89 <li> 98 <li>
90 <input type="checkbox" class="autosubmit" name="viewLayer" 99 <input type="checkbox" class="autosubmit" name="viewLayer"
91 value="dict" tal:attributes="checked python:'dict' in viewLayers" /> 100 value="dict" tal:attributes="checked python:'dict' in viewLayers" />
92 Dictionary 101 Dictionary
93 </li> 102 </li>
94 <li tal:condition="python:query"> 103 <li tal:condition="python:query">
95 <input type="checkbox" class="autosubmit" name="viewLayer" 104 <input type="checkbox" class="autosubmit" name="viewLayer"
96 value="search" 105 value="search"
97 tal:attributes="checked python:'search' in viewLayers" /> Search hits 106 tal:attributes="checked python:'search' in viewLayers" /> Search
107 hits
98 </li> 108 </li>
99 <li tal:condition="python:docinfo.get('numPlaces',0)"> 109 <!-- auto-layer select buttons -->
100 <input type="checkbox" class="autosubmit" name="viewLayer" value="gis" 110 <tal:block tal:repeat="layer availableLayers">
101 tal:attributes="checked python:'gis' in viewLayers" /> Places<br /> 111 <tal:block
102 </li> 112 tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
113 tal:condition="python:exists(mpath)">
114 <li metal:use-macro="python:path(mpath)" />
115 </tal:block>
116 </tal:block>
103 </ul> 117 </ul>
104 </li> 118 </li>
105 <li> 119 <li>
106 <input type="radio" class="autosubmit" name="viewMode" value="xml" 120 <input type="radio" class="autosubmit" name="viewMode" value="xml"
107 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input 121 tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
120 tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})" 134 tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
121 tal:repeat="param params" 135 tal:repeat="param params"
122 tal:attributes="name param; value python:params[param]" /> 136 tal:attributes="name param; value python:params[param]" />
123 <!-- make sure we have one viewLayer=search --> 137 <!-- make sure we have one viewLayer=search -->
124 <tal:block tal:repeat="vl viewLayers"> 138 <tal:block tal:repeat="vl viewLayers">
125 <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'"/> 139 <input type="hidden" name="viewLayer" tal:attributes="value vl"
140 tal:condition="python:vl != 'search'" />
126 </tal:block> 141 </tal:block>
127 <input type="hidden" name="viewLayer" value="search"/> 142 <input type="hidden" name="viewLayer" value="search" />
128 <!-- query text --> 143 <!-- query text -->
129 <input type="text" name="query" tal:attributes="value query"/> 144 <input type="text" name="query" tal:attributes="value query" /> <input
130 <input type="submit" value="Search"/> 145 type="submit" value="Search" /> <a
131 <a tal:attributes="href python:here.getLink('query',None)">Clear</a> 146 tal:attributes="href python:here.getLink('query',None)">Clear</a>
132 <ul> 147 <ul>
133 <li> 148 <li>
134 <input type="radio" name="queryType" value="fulltext" 149 <input type="radio" name="queryType" value="fulltext"
135 tal:attributes="checked python:queryType=='fulltext'"/> Exact 150 tal:attributes="checked python:queryType=='fulltext'" /> Exact
136 </li> 151 </li>
137 <li> 152 <li>
138 <input type="radio" name="queryType" value="fulltextMorph" 153 <input type="radio" name="queryType" value="fulltextMorph"
139 tal:attributes="checked python:queryType=='fulltextMorph'"/> All forms 154 tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
140 </li> 155 </li>
141 <li> 156 <li>
142 <input type="radio" name="queryType" value="ftIndex" 157 <input type="radio" name="queryType" value="ftIndex"
143 tal:attributes="checked python:queryType=='ftIndex'"/> Fulltext index 158 tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
144 </li> 159 </li>
145 <li> 160 <li>
146 <input type="radio" name="queryType" value="ftIndexMorph" 161 <input type="radio" name="queryType" value="ftIndexMorph"
147 tal:attributes="checked python:queryType=='ftIndexMorph'"/> Morphological index 162 tal:attributes="checked python:queryType=='ftIndexMorph'" />
148 </li> 163 Morphological index
164 </li>
149 </ul> 165 </ul>
150 </form> 166 </form>
151 </div> 167 </div>
152 <!--"END SEARCH"--> 168 <!--"END SEARCH"-->
153 169
211 <input type="submit" value="Go!" /> 227 <input type="submit" value="Go!" />
212 </form> 228 </form>
213 </div> 229 </div>
214 <!--"END TEXT NORMALIZATION"--> 230 <!--"END TEXT NORMALIZATION"-->
215 231
216 <!--"BEGIN PLACES"--> 232 <!-- auto-layer option boxes -->
217 <div class="options" tal:condition="python:'gis' in viewLayers"> 233 <tal:block tal:repeat="layer viewLayers">
218 <tal:block tal:define=" 234 <tal:block
219 name docinfo/documentName; 235 tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
220 places python:here.getPlacesOnPage(docinfo=docinfo, pn=pn); 236 tal:condition="python:exists(mpath)">
221 pidlist python:','.join([p['id'] for p in places]);"> 237 <metal:block metal:use-macro="python:path(mpath)" />
222 <h4>Places</h4>
223 <ul>
224 <li><a
225 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?id=%s&format=gis'%(name,pidlist)"
226 target="_blank">on this page</a>
227 </li>
228 <li>
229 <a
230 tal:attributes="href python:'http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/mpdl/%s?format=gis'%(name)"
231 target="_blank">in whole document</a>
232 </li>
233 </ul>
234 </tal:block> 238 </tal:block>
235 </div> 239 </tal:block>
236 <!--"END PLACES"-->
237 </div> 240 </div>
238 <!-- /col-right --> 241 <!-- /col-right -->
239 242
240 </div> 243 </div>
241 <!-- /page-body --> 244 <!-- /page-body -->