annotate zpt/viewer_text.zpt @ 562:60f5a636bc57

bugfixes for stability.
author casties
date Tue, 02 Oct 2012 15:22:11 +0200
parents eabfbad6aeb4
children 61d53ccbdd70
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
479
fe5b0e4ac5f2 starting new templates in product
casties
parents:
diff changeset
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
fe5b0e4ac5f2 starting new templates in product
casties
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml"
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
4 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
5 tocMode pageinfo/tocMode; viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
6 availableLayers python:here.getAvailableLayers().get('text', None);
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
7 viewerUrl docinfo/viewerUrl;
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
8 rootUrl here/getDocumentViewerURL;
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
9 numPages docinfo/numPages | nothing;">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
10 <head>
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
11 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
12 <title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
13 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
535
510bae2b593b more fixes, e.g. IE support. first version of index page.
casties
parents: 532
diff changeset
14 <!--[if IE]><link rel="stylesheet" href="template/docuviewer_ie_css" type="text/css" /><![endif]-->
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
15 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script>
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
16 <script type="text/javascript">
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
17 // <!--
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
18 $(document).ready(function() {
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
19 // autosubmit forms
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
20 $('form.autosubmit').find('.autosubmit').change(function() {
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
21 this.form.submit();
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
22 });
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
23 $('form.autosubmit input[type="submit"]').hide();
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
24 });
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
25 // -->
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
26 </script>
526
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
27 <!-- layer headers (rendered always) -->
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
28 <tal:block tal:repeat="layer availableLayers">
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
29 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
30 <metal:block metal:use-macro="python:path(mpath)" />
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
31 </tal:block>
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
32 </tal:block>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
33 </head>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 535
diff changeset
34 <!-- body -->
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
35 <body tal:condition="numPages">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
36 <tal:block
530
5c7433c2515c fix problems with texttool/text
casties
parents: 526
diff changeset
37 tal:define="docpath docinfo/textURLPath | nothing;
506
67014399894d cleaned out all 4suite code and weird methods.
casties
parents: 503
diff changeset
38 pn pageinfo/pn;
512
92a6443a6f16 fix pageFlow.
casties
parents: 511
diff changeset
39 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
40 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo);">
502
daf36d0fcfee more cleanup.
casties
parents: 501
diff changeset
41 <!-- header -->
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
42 <div class="page-head">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
43 <metal:block metal:use-macro="here/template/common_template/macros/head" />
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
44 </div>
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
45
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
46 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
47 <!--table of contents-->
510
4fb35343d2e7 more search. nicer css.
casties
parents: 509
diff changeset
48 <div class="col toc">
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
49 <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
50 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
51
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
52 <!-- text page -->
510
4fb35343d2e7 more search. nicer css.
casties
parents: 509
diff changeset
53 <div class="col main">
540
4b43a57ad9b3 more nicer
casties
parents: 536
diff changeset
54 <div class="ruler top">
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
55 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
56 </div>
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
57 <div class="content text" tal:condition="textPage">
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
58 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
59 tal:content="structure pageinfo/pageHeaderTitle" />
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
60 <tal:block tal:condition="textPage" tal:replace="structure textPage"/>
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
61 <div class="emptyPage" tal:condition="not:textPage">[Empty page]</div>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
62 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
63 </div>
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
64 <!-- end of col-main -->
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
65
526
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
66 <!-- layer columns (rendered always) -->
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
67 <tal:block tal:repeat="layer availableLayers">
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
68 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/extra_column"
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
69 tal:condition="python:exists(mpath)">
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
70 <metal:block metal:use-macro="python:path(mpath)" />
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
71 </tal:block>
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
72 </tal:block>
510
4fb35343d2e7 more search. nicer css.
casties
parents: 509
diff changeset
73
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
74 <!-- right-side options -->
510
4fb35343d2e7 more search. nicer css.
casties
parents: 509
diff changeset
75 <div class="col buttons">
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
76 <!--"BEGIN TEXT DISPLAY" -->
559
eabfbad6aeb4 "extended" layer for index view and some bugfixes.
casties
parents: 545
diff changeset
77 <div class="options" tal:condition="availableLayers">
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
78 <h4>Text layer</h4>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
79 <form tal:attributes="action viewerUrl" class="autosubmit">
559
eabfbad6aeb4 "extended" layer for index view and some bugfixes.
casties
parents: 545
diff changeset
80 <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
81 tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
82 <ul>
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
83 <!-- text layer select buttons (rendered always) -->
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
84 <tal:block tal:repeat="layer availableLayers">
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
85 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
86 tal:condition="python:exists(mpath)">
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
87 <li metal:use-macro="python:path(mpath)" />
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
88 </tal:block>
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
89 </tal:block>
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
90 </ul>
545
fc34eff7b52d fixed missing button for text layers.
casties
parents: 543
diff changeset
91 <input type="submit" value="Go!" />
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
92 </form>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
93 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
94 <!--"END TEXT DISPLAY"-->
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
95
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
96 <!--"BEGIN TEXT SIZE"-->
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
97 <!-- <div class="options">
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
98 <h4>Text size</h4>
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
99 <ul class="fsizer">
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
100 <li><a href="javascript:fontSize(12);" class="fs_sml">S</a></li>
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
101 <li><a href="javascript:fontSize(14);" class="fs_med">M</a></li>
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
102 <li><a href="javascript:fontSize(16);" class="fs_lrg">L</a></li>
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
103 </ul>
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
104 </div> -->
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
105 <!--"END TEXT SIZE"-->
485
1e51d440f08b more new templates
casties
parents: 483
diff changeset
106
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
107 <!--"BEGIN TEXT NORMALIZATION"-->
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
108 <div class="options">
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
109 <h4>Text normalization</h4>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
110 <form tal:attributes="action viewerUrl" class="autosubmit"
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
111 tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
112 <input type="hidden"
509
9d05befdd462 try to get characterNormalization in search result working.
casties
parents: 508
diff changeset
113 tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
114 tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
115 <ul>
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
116 <li><input type="radio" class="autosubmit" name="characterNormalization" value="orig"
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
117 tal:attributes="checked python:norm=='orig'" /> Original</li>
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
118 <li><input type="radio" class="autosubmit" name="characterNormalization" value="reg"
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
119 tal:attributes="checked python:norm=='reg'" /> Regularized</li>
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
120 <li><input type="radio" class="autosubmit" name="characterNormalization" value="regPlusNorm"
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
121 tal:attributes="checked python:norm=='regPlusNorm'" /> Normalized</li>
508
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
122 </ul>
d5a47f82e755 more cleanup.
casties
parents: 506
diff changeset
123 <input type="submit" value="Go!" />
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
124 </form>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
125 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
126 <!--"END TEXT NORMALIZATION"-->
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
127
526
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
128 <!-- layer option boxes (rendered if active) -->
3f375a048402 moved search and dict into separate layers.
casties
parents: 525
diff changeset
129 <tal:block tal:repeat="layer availableLayers">
532
0b8bed1223ad new layout and styles.
casties
parents: 530
diff changeset
130 <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
131 tal:condition="python:exists(mpath)">
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
132 <metal:block metal:use-macro="python:path(mpath)" />
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
133 </tal:block>
525
70c3ae5eac7c layers can have their own templates.
casties
parents: 514
diff changeset
134 </tal:block>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
135 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
136 <!-- /col-right -->
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
137
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
138 </div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
139 <!-- /page-body -->
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
140
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
141 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
142 <div class="errortext">Sorry, access to this document is restricted.</div>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
143 </div>
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
144
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
145 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
146 <!-- footer -->
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
147 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
148 </tal:block>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
149 </tal:block>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
150 </body>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
151 <body tal:condition="not:numPages">
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
152 <div class="errortext">Sorry, document doesn't exist.</div>
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
153 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
154 <!-- footer -->
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
155 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
156 </tal:block>
501
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
157 </body>
29c6d09a506c more cleanup.
casties
parents: 490
diff changeset
158 </html>