source: documentViewer/zpt/viewer_text.zpt @ 525:70c3ae5eac7c

Last change on this file since 525:70c3ae5eac7c was 525:70c3ae5eac7c, checked in by casties, 12 years ago

layers can have their own templates.
first version of annotations layer.

File size: 10.3 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml"
4  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
5              tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
6              availableLayers python:here.getAvailableLayers().get('text', None);
7              viewerUrl docinfo/viewerUrl;
8              rootUrl here/getDocumentViewerURL;
9              numPages docinfo/numPages | nothing;">
10<head>
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>
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
34</head>
35<body tal:condition="numPages">
36  <tal:block
37    tal:define="docpath docinfo/textURLPath;
38                pn pageinfo/pn;
39                flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
40                query python:request.get('query', None);
41                queryType python:request.get('queryType','fulltextMorph');
42                textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">
43    <!-- header -->
44    <div class="page-head">
45      <metal:block metal:use-macro="here/template/common_template/macros/head" />
46    </div>
47    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
48      <!--table of contents-->
49      <div class="col toc">
50        <metal:block
51          metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
52      </div>
53
54      <!-- text page -->
55      <div class="col main">
56        <div class="ruler">
57          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
58        </div>
59        <ul class="switcher">
60          <li>
61            <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
62          </li>
63          <li class="sel">Text</li>
64        </ul>
65        <div class="content">
66          <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
67            tal:content="structure pageinfo/pageHeaderTitle" />
68          <tal:block tal:replace="structure textPage" />
69        </div>
70      </div>
71      <!-- end of col-main -->
72
73      <!-- right-side search results -->
74      <div class="col results" tal:condition="query">
75        <!--"BEGIN SEARCH RESULTS"  -->
76        <div class="options">
77          <h4>Search results</h4>
78          <div metal:use-macro="here/template/search_template/macros/results_div" />
79        </div>
80      </div>
81
82      <!-- right-side options -->
83      <div class="col buttons">
84        <!--"BEGIN TEXT DISPLAY"  -->
85        <div class="options">
86          <h4>Text display</h4>
87          <form tal:attributes="action viewerUrl" class="autosubmit">
88            <input type="hidden"
89              tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
90              tal:repeat="param params"
91              tal:attributes="name param; value python:params[param]" />
92            <ul>
93              <li>
94                <input class="autosubmit" type="radio" name="viewMode" value="text"
95                  tal:attributes="checked python:viewMode=='text'" /> Text
96                <ul>
97                  <!-- text layers -->
98                  <li>
99                    <input type="checkbox" class="autosubmit" name="viewLayer"
100                      value="dict" tal:attributes="checked python:'dict' in viewLayers" />
101                    Dictionary
102                  </li>
103                  <li tal:condition="python:query">
104                    <input type="checkbox" class="autosubmit" name="viewLayer"
105                      value="search"
106                      tal:attributes="checked python:'search' in viewLayers" /> Search
107                    hits
108                  </li>
109                  <!-- auto-layer select buttons -->
110                  <tal:block tal:repeat="layer availableLayers">
111                    <tal:block
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>
117                </ul>
118              </li>
119              <li>
120                <input type="radio" class="autosubmit" name="viewMode" value="xml"
121                  tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
122                  type="submit" value="Go!" />
123              </li>
124            </ul>
125          </form>
126        </div>
127        <!--"END TEXT DISPLAY"-->
128
129        <!--"BEGIN SEARCH"-->
130        <div class="options">
131          <h4>Search</h4>
132          <form tal:attributes="action viewerUrl">
133            <input type="hidden"
134              tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
135              tal:repeat="param params"
136              tal:attributes="name param; value python:params[param]" />
137            <!-- make sure we have one viewLayer=search -->
138            <tal:block tal:repeat="vl viewLayers">
139              <input type="hidden" name="viewLayer" tal:attributes="value vl"
140                tal:condition="python:vl != 'search'" />
141            </tal:block>
142            <input type="hidden" name="viewLayer" value="search" />
143            <!-- query text -->
144            <input type="text" name="query" tal:attributes="value query" /> <input
145              type="submit" value="Search" /> <a
146              tal:attributes="href python:here.getLink('query',None)">Clear</a>
147            <ul>
148              <li>
149                <input type="radio" name="queryType" value="fulltext"
150                  tal:attributes="checked python:queryType=='fulltext'" /> Exact
151              </li>
152              <li>
153                <input type="radio" name="queryType" value="fulltextMorph"
154                  tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
155              </li>
156              <li>
157                <input type="radio" name="queryType" value="ftIndex"
158                  tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
159              </li>
160              <li>
161                <input type="radio" name="queryType" value="ftIndexMorph"
162                  tal:attributes="checked python:queryType=='ftIndexMorph'" />
163                Morphological index
164              </li>
165            </ul>
166          </form>
167        </div>
168        <!--"END SEARCH"-->
169
170        <!--"BEGIN TEXT SIZE"-->
171        <div class="options">
172          <h4>Text size</h4>
173          <ul class="fsizer">
174            <li>
175              <a href="javascript:fontSize(12);" class="fs_sml">S</a>
176            </li>
177            <li>
178              <a href="javascript:fontSize(14);" class="fs_med">M</a>
179            </li>
180            <li>
181              <a href="javascript:fontSize(16);" class="fs_lrg">L</a>
182            </li>
183          </ul>
184        </div>
185        <!--"END TEXT SIZE"-->
186
187        <!--"BEGIN DICTIONARY OVERVIEW"-->
188        <div class="options" tal:condition="python:'dict' in viewLayers">
189          <h4>Dictionary view</h4>
190          <form name="f3" action="">
191            <ul>
192              <li>
193                <input type="radio" name="r3" /> Tab
194              </li>
195              <li>
196                <input type="radio" name="r3" /> Window
197              </li>
198            </ul>
199          </form>
200        </div>
201        <!--"END DICTIONARY OVERVIEW"-->
202
203        <!--"BEGIN TEXT NORMALIZATION"-->
204        <div class="options">
205          <h4>Text normalization</h4>
206          <form tal:attributes="action viewerUrl" class="autosubmit"
207            tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');">
208            <input type="hidden"
209              tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
210              tal:repeat="param params"
211              tal:attributes="name param; value python:params[param]" />
212            <ul>
213              <li>
214                <input type="radio" class="autosubmit" name="characterNormalization"
215                  value="orig" tal:attributes="checked python:norm=='orig'" /> Original
216              </li>
217              <li>
218                <input type="radio" class="autosubmit" name="characterNormalization"
219                  value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized
220              </li>
221              <li>
222                <input type="radio" class="autosubmit" name="characterNormalization"
223                  value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" />
224                Normalized
225              </li>
226            </ul>
227            <input type="submit" value="Go!" />
228          </form>
229        </div>
230        <!--"END TEXT NORMALIZATION"-->
231
232        <!--  auto-layer option boxes -->
233        <tal:block tal:repeat="layer viewLayers">
234          <tal:block
235            tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
236            tal:condition="python:exists(mpath)">
237            <metal:block metal:use-macro="python:path(mpath)" />
238          </tal:block>
239        </tal:block>
240      </div>
241      <!-- /col-right -->
242
243    </div>
244    <!-- /page-body -->
245
246    <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
247      <div class="errortext">Sorry, access to this document is restricted.</div>
248    </div>
249
250  </tal:block>
251</body>
252<body tal:condition="not:numPages">
253  <div class="errortext">Sorry, document doesn't exist.</div>
254</body>
255</html>
Note: See TracBrowser for help on using the repository browser.