annotate zpt/viewer/viewer_thumbs.zpt @ 607:cb5a9c4f5e3a

CLOSED - # 268: display of subdocuments https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/ticket/268
author casties
date Fri, 14 Dec 2012 17:28:31 -0500
parents da7daa783df4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
3 <html xmlns="http://www.w3.org/1999/xhtml"
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
4 tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
5 viewerUrl docinfo/viewerUrl;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
6 rootUrl here/getDocumentViewerURL;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
7 numPages docinfo/numPages | nothing;">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
8 <head>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
10 <title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
11 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
12 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
13 <script type="text/javascript">
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
14 // <!--
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
15 $(document).ready(function() {
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
16 // autosubmit forms
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
17 $('form.autosubmit').find('.autosubmit').change(function() {
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
18 this.form.submit();
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
19 });
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
20 $('form.autosubmit input[type="submit"]').hide();
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
21 });
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
22 // -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
23 </script>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
24 </head>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
25 <body tal:condition="numPages">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
26 <tal:block
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
27 tal:define="pn pageinfo/pn;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
28 start pageinfo/start;
607
cb5a9c4f5e3a CLOSED - # 268: display of subdocuments
casties
parents: 594
diff changeset
29 minPageNo docinfo/minPageNo;
cb5a9c4f5e3a CLOSED - # 268: display of subdocuments
casties
parents: 594
diff changeset
30 maxPageNo docinfo/maxPageNo;
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
31 thumbRows python:int(request.get('thumbRows', 10));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
32 thumbCols python:int(request.get('thumbCols', 12));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
33 thumbSize python:int(request.get('thumbSize', 100));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
34 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
607
cb5a9c4f5e3a CLOSED - # 268: display of subdocuments
casties
parents: 594
diff changeset
35 pageBatch python:here.getPageBatch(start=start, rows=thumbRows, cols=thumbCols, pageFlowLtr=flowLtr, minIdx=minPageNo, maxIdx=maxPageNo);
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
36 pageNumbers docinfo/pageNumbers | nothing;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
37 left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']);
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
38 right python:test(flowLtr,pageBatch['nextStart'],pageBatch['prevStart']);">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
39 <div class="page-head">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
40 <metal:block metal:use-macro="here/template/common_template/macros/head" />
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
41 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
42 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
43 <!-- col-main: text page -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
44 <div class="col main">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
45 <div class="ruler">
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
46 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
47 </div>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
48 <div class="content-thumbs">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
49 <table class="thumbs">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
50 <tr tal:repeat="row pageBatch/pages">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
51 <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
52 tal:define="idx thumb/idx" tal:condition="idx"
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
53 tal:attributes="href python:here.getLink(params={'pn':idx, 'viewMode':'images'})"> <img
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
54 tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=thumbSize,dh=thumbSize,docinfo=docinfo),'images/pic');
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
55 alt idx" /><br />
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
56 <span title="Scan number" tal:content="idx" /> <span
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
57 tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']"
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
58 title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" />
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
59 </a></td>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
60 </tr>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
61 </table>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
62 </div>
540
4b43a57ad9b3 more nicer
casties
parents: 536
diff changeset
63 <div class="ruler bottom">
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
64 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
65 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
66 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
67 <!-- /col-main -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
68
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
69 <!-- right-side options -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
70 <div class="col buttons">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
71 <!--"BEGIN TEXT DISPLAY" -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
72 <div class="options">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
73 <h4>Thumbnail display</h4>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
74 <form tal:attributes="action viewerUrl" class="autosubmit">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
75 <input type="hidden"
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
76 tal:define="params python:here.getParams(params={'thumbRows':None,'thumbCols':None,'thumbSize':None})"
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
77 tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
78 <ul>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
79 <li>Rows <select class="autosubmit" name="thumbRows" tal:define="rows python:[2,3,5,10,12,15,20,50,100]">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
80 <option tal:repeat="row rows" tal:attributes="selected python:thumbRows==row; value row" tal:content="row" />
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
81 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
82 </li>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
83 <li>Columns <select class="autosubmit" name="thumbCols" tal:define="cols python:[2,3,5,10,12,15,20,50,100]">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
84 <option tal:repeat="col cols" tal:attributes="selected python:thumbCols==col; value col" tal:content="col" />
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
85 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
86 </li>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
87 <li>Thumbnail size <select class="autosubmit" name="thumbSize" tal:define="sizes python:[100,150,200,300,500]">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
88 <option tal:repeat="size sizes" tal:attributes="selected python:thumbSize==size; value size" tal:content="size" />
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
89 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
90 </li>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
91 </ul>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
92 </form>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
93 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
94 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
95 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
96 <!-- page-body -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
97 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
98 <div class="errortext">Sorry, access to this document is restricted.</div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
99 </div>
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
100 <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
101 <!-- footer -->
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
102 <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
103 </tal:block>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
104 </tal:block>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
105 </body>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
106 <body tal:condition="not:numPages">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
107 <div class="errortext">Sorry, document doesn't exist.</div>
543
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
108 <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
109 <!-- footer -->
6cdc31e9ed8e fixed problem with dict-mode in default view.
casties
parents: 540
diff changeset
110 <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
111 </tal:block>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
112 </body>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
113 </html>