annotate zpt/viewer_thumbs.zpt @ 540:4b43a57ad9b3

more nicer
author casties
date Thu, 16 Aug 2012 19:09:49 +0200
parents abd36d4d97b8
children 6cdc31e9ed8e
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;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
29 thumbRows python:int(request.get('thumbRows', 10));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
30 thumbCols python:int(request.get('thumbCols', 12));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
31 thumbSize python:int(request.get('thumbSize', 100));
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
32 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
33 pageBatch python:here.getPageBatch(start=start, rows=thumbRows, cols=thumbCols, pageFlowLtr=flowLtr, maxIdx=numPages);
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
34 pageNumbers docinfo/pageNumbers | nothing;
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
35 left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']);
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
36 right python:test(flowLtr,pageBatch['nextStart'],pageBatch['prevStart']);">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
37 <div class="page-head">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
38 <metal:block metal:use-macro="here/template/common_template/macros/head" />
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
39 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
40 <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
41 <!-- col-main: text page -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
42 <div class="col main">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
43 <div class="ruler">
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
44 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
45 </div>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
46 <div class="content-thumbs">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
47 <table class="thumbs">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
48 <tr tal:repeat="row pageBatch/pages">
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
49 <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
50 tal:define="idx thumb/idx" tal:condition="idx"
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
51 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
52 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
53 alt idx" /><br />
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
54 <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
55 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
56 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
57 </a></td>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
58 </tr>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
59 </table>
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
60 </div>
540
4b43a57ad9b3 more nicer
casties
parents: 536
diff changeset
61 <div class="ruler bottom">
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
62 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
63 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
64 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
65 <!-- /col-main -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
66
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
67 <!-- right-side options -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
68 <div class="col buttons">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
69 <!--"BEGIN TEXT DISPLAY" -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
70 <div class="options">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
71 <h4>Thumbnail display</h4>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
72 <form tal:attributes="action viewerUrl" class="autosubmit">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
73 <input type="hidden"
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
74 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
75 tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
76 <ul>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
77 <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
78 <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
79 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
80 </li>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
81 <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
82 <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
83 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
84 </li>
536
abd36d4d97b8 new version of index page. improvements for digilib page and thumbnail overview.
casties
parents: 528
diff changeset
85 <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
86 <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
87 </select>
528
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
88 </li>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
89 </ul>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
90 </form>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
91 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
92 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
93 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
94 <!-- page-body -->
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
95 <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
96 <div class="errortext">Sorry, access to this document is restricted.</div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
97 </div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
98 </tal:block>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
99 </body>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
100 <body tal:condition="not:numPages">
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
101 <div class="errortext">Sorry, document doesn't exist.</div>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
102 </body>
f8a5f63eafc0 new viewMode=thumbs.
casties
parents:
diff changeset
103 </html>