Changeset 536:abd36d4d97b8 in documentViewer for zpt
- Timestamp:
- Jul 26, 2012, 7:22:56 PM (12 years ago)
- Branch:
- default
- Location:
- zpt
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
zpt/common_template.zpt
r535 r536 13 13 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);"> 14 14 <div class="logo" tal:condition="exists:here/template/logo.png"> 15 <img tal:attributes="src here/template/logo.png/absolute_url" />15 <img tal:attributes="src here/template/logo.png/absolute_url" /> 16 16 </div> 17 17 <div class="title-block"> 18 <div class="title" tal:condition="not:formattedLabel">19 <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">20 <i tal:content="docinfo/creator" />,18 <div class="title" tal:condition="not:formattedLabel"> 19 <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']"> 20 <i tal:content="docinfo/creator" />, 21 21 <span tal:content="docinfo/title" />, <span tal:content="docinfo/date" /> 22 </tal:block> 23 <span tal:condition="not:python:docinfo['creator'] or docinfo['title']" 24 tal:content="string:[no bibliographical information for this document (type ${bibType})]" /> 25 </div> 26 <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" /> 27 <ul class="view-switcher"> 28 <li tal:attributes="class python:here.getStyle(viewMode, 'text')"><a tal:omit-tag="python:viewMode=='text'" 29 tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li> 30 <li tal:attributes="class python:here.getStyle(viewMode, 'images')"><a tal:omit-tag="python:viewMode=='images'" 31 tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li> 32 <li tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a tal:omit-tag="python:viewMode=='xml'" 33 tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li> 34 <li tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a tal:omit-tag="python:viewMode=='thumbs'" 35 tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a></li> 36 <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'" 37 tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li> 38 </ul> 22 </tal:block> 23 <span tal:condition="not:python:docinfo['creator'] or docinfo['title']" 24 tal:content="string:[no bibliographical information for this document (type ${bibType})]" /> 25 </div> 26 <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" /> 27 <ul class="view-switcher"> 28 <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'text')"><a 29 tal:omit-tag="python:viewMode=='text'" tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li> 30 <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'images')"><a 31 tal:omit-tag="python:viewMode=='images'" tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li> 32 <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a 33 tal:omit-tag="python:viewMode=='xml'" tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li> 34 <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a 35 tal:omit-tag="python:viewMode=='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail 36 overview</a></li> 37 <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'" 38 tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li> 39 </ul> 39 40 </div> 40 41 </metal:block> … … 51 52 <form class="autosubmit" tal:attributes="action viewerUrl"> 52 53 <input type="hidden" tal:define="params python:here.getParams('pn', None)" tal:repeat="param params" 53 tal:attributes="name param; value python:params[param]" /> 54 <span class="ruler-main">page <a tal:condition="leftest" 54 tal:attributes="name param; value python:params[param]" /> <span class="ruler-main">page <a tal:condition="leftest" 55 55 tal:attributes="href python:here.getLink('pn',leftest)">|<</a> <span tal:condition="not:leftest">|<</span> <a 56 56 tal:condition="left" tal:attributes="href python:here.getLink('pn',left)"><</a> <span tal:condition="not:left"><</span> … … 59 59 tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span 60 60 tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None"> 61 [<span tal:replace="originalPageNorm" />]</span>) 62 </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right" 61 [<span tal:replace="originalPageNorm" />] 62 </span>) 63 </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right" 63 64 tal:attributes="href python:here.getLink('pn',right)">></a> <span tal:condition="not:right">></span> <a 64 65 tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">>|</a> <span 65 66 tal:condition="not:rightest">>|</span> 66 </span> <!-- ruler-main --> 67 </span> 68 <!-- ruler-main --> 67 69 </form> 68 70 </metal:block> … … 87 89 <form class="autosubmit" tal:attributes="action viewerUrl"> 88 90 <input type="hidden" tal:define="params python:here.getParams('start',None)" tal:repeat="param params" 89 tal:attributes="name param; value python:params[param]" /> 91 tal:attributes="name param; value python:params[param]" /><span class="ruler-main"><a tal:condition="left" 90 92 tal:attributes="href python:here.getLink('start',left)"><</a> <span tal:condition="not:left"><</span> <select 91 93 class="autosubmit" name="start" tal:define="ofs python:test(pageinfo['pageZero'],0,1)"> 92 <tal:block>93 <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:start==grp['start']; value grp/start;"94 tal:content="string:${grp/start} - ${grp/end}" />95 </tal:block>94 <tal:block> 95 <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:start==grp['start']; value grp/start;" 96 tal:content="string:${grp/start} - ${grp/end}" /> 97 </tal:block> 96 98 </select> <input type="submit" value="Go" /> <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">></a> 97 <span tal:condition="not:right">></span>99 <span tal:condition="not:right">></span></span> 98 100 </form> 99 101 </metal:block> … … 101 103 <!-- toc type switcher --> 102 104 <metal:block metal:define-macro="toc_switcher"> 103 <div class="toc-switcher-col">104 <div class="toc-switcher">105 <ul>106 <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a tal:omit-tag="python:tocMode=='none'"107 tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li>108 <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')"109 tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a110 tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>111 <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"112 tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a113 tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li>114 <li tal:attributes="class python:here.getStyle(tocMode, 'text')"115 tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a116 tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li>117 <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a118 tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li>119 </ul>120 </div>105 <div class="toc-switcher-col"> 106 <div class="toc-switcher"> 107 <ul> 108 <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a 109 tal:omit-tag="python:tocMode=='none'" tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li> 110 <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')" 111 tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a 112 tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li> 113 <li tal:attributes="class python:here.getStyle(tocMode, 'figures')" 114 tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a 115 tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li> 116 <li tal:attributes="class python:here.getStyle(tocMode, 'text')" 117 tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a 118 tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li> 119 <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a 120 tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li> 121 </ul> 122 </div> 121 123 </div> 122 124 </metal:block> -
zpt/viewer_images.zpt
r532 r536 6 6 numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;"> 7 7 <head> 8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 9 <title 10 tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" /> 11 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" /> 12 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script> 13 <script type="text/javascript" 14 tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script> 15 <script type="text/javascript" 16 tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script> 17 <script type="text/javascript" 18 tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script> 19 <script type="text/javascript" 20 tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script> 21 <script type="text/javascript" 22 tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script> 23 <link rel="stylesheet" type="text/css" 24 tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" /> 8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 9 <title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" /> 10 <link rel="stylesheet" href="template/docuviewer_css" type="text/css" /> 11 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.js"></script> 12 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.cookie.js"></script> 13 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.js"></script> 14 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.geometry.js"></script> 15 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.arrows.js"></script> 16 <script type="text/javascript" tal:attributes="src string:$dlBaseUrl/jquery/jquery.digilib.marks.js"></script> 17 <link rel="stylesheet" type="text/css" tal:attributes="href string:$dlBaseUrl/jquery/jquery.digilib.css" /> 25 18 26 27 tal:content="python:'''28 var dlOpts = { 29 'interactionMode' : 'fullscreen', 30 'digilibBaseUrl' : '%s', 31 'fn' : '%s', 32 'pn' : '%s', 33 'suppressParamNames' : ['fn'], 34 'scalerInsets' : {'x' : 140, 'y' : 100}35 }; '''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>19 <script type="text/javascript" 20 tal:content="python:'''\n 21 var dlOpts = {\n 22 'interactionMode' : 'fullscreen',\n 23 'digilibBaseUrl' : '%s',\n 24 'fn' : '%s',\n 25 'pn' : '%s',\n 26 'suppressParamNames' : ['fn'],\n 27 'scalerInsets' : {'x':300, 'y':100}\n 28 };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script> 36 29 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 30 <script type="text/javascript"> 31 // <!-- 32 $(document).ready(function() { 33 // autosubmit forms 34 $('form.autosubmit').find('.autosubmit').change(function() { 35 this.form.submit(); 36 }); 37 $('form.autosubmit input[type="submit"]').hide(); 38 // get digilib div 39 $digilib = $('div#scaler'); 40 // configure digilib 41 $digilib.digilib(dlOpts); 42 }); 43 // --> 44 </script> 52 45 </head> 53 46 <body tal:condition="numPages"> … … 62 55 <!-- table of contents --> 63 56 <div class="col toc"> 64 <metal:block 65 metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> 57 <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" /> 66 58 </div> 67 59 <!-- col-main: text page --> … … 70 62 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" /> 71 63 </div> 72 <div class="content ">64 <div class="content-images"> 73 65 <div id="scaler"> 74 <img 75 tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" /> 66 <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" /> 76 67 </div> 77 68 </div> -
zpt/viewer_index.zpt
r535 r536 13 13 </head> 14 14 <body tal:condition="numPages"> 15 <h1>Document information</h1> 15 <!-- header --> 16 <div class="page-head"> 17 <metal:block metal:use-macro="here/template/common_template/macros/head" /> 18 </div> 19 20 <!-- main --> 21 <div class="page-body"> 16 22 17 <div class=" index-image">23 <div class="col index-image"> 18 24 <!-- image --> 19 <a tal:define="tp docinfo/titlePage | nothing" 20 tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img 21 tal:condition="tp" border="0" 22 tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img 25 <a tal:define="tp docinfo/titlePage | nothing" tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img 26 tal:condition="tp" border="0" tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img 23 27 tal:condition="python:not tp and exists('here/template/book.png')" border="0" src="template/book.png" /></a> 24 28 </div> 25 29 30 <div class="col"> 26 31 <div class="index-info"> 27 32 <table border="0" … … 70 75 </div> 71 76 72 <div> 73 <div> 74 <a class="openbutton" 75 tal:attributes="href python:context.getLink('viewMode','auto')">Access Book</a> 77 <div class="index-actions"> 78 <div class="action"> 79 <a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">→Access Book</a> 76 80 </div> 77 <div tal:condition="docpath">81 <div class="action" tal:condition="docpath"> 78 82 Download as <a 79 83 tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath.replace('.xml','.html'))" 80 target="_blank">html</a> / <a 81 tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" 82 target="_blank">xml</a> 84 target="_blank">→HTML</a> or <a 85 tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">→XML</a> 83 86 </div> 84 <div >87 <div class="action"> 85 88 <!--BEGIN search --> 86 89 <form tal:condition="docpath" tal:attributes="action python:here.getLink()"> 87 <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" 88 tal:repeat="param params" 89 tal:attributes="name param; value python:params[param]" /> <input 90 class="textMain" name="query" onfocus="this.select();" type="text" 91 tal:attributes="value query" /> <input type="submit" class="buttonMain" 92 value="Search in Book" /> 90 <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" tal:repeat="param params" 91 tal:attributes="name param; value python:params[param]" /> <input class="textMain" name="query" onfocus="this.select();" 92 type="text" tal:attributes="value query" /> <input type="submit" class="buttonMain" value="Search in Book" /> 93 93 </form> 94 94 <!-- END search--> 95 95 </div> 96 96 </div> 97 < !-- DEBUG -->98 < !-- <p tal:content="python:repr(docinfo)" /> -->97 </div> 98 </div> 99 99 </body> 100 100 <body tal:condition="not:numPages"> -
zpt/viewer_text.zpt
r535 r536 32 32 </tal:block> 33 33 </head> 34 <!-- body --> 34 35 <body tal:condition="numPages"> 35 36 <tal:block -
zpt/viewer_thumbs.zpt
r528 r536 12 12 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script> 13 13 <script type="text/javascript"> 14 15 16 17 18 19 20 21 14 // <!-- 15 $(document).ready(function() { 16 // autosubmit forms 17 $('form.autosubmit').find('.autosubmit').change(function() { 18 this.form.submit(); 19 }); 20 $('form.autosubmit input[type="submit"]').hide(); 21 }); 22 22 // --> 23 23 </script> … … 42 42 <div class="col main"> 43 43 <div class="ruler"> 44 <metal:block 45 metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> 44 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> 46 45 </div> 47 48 <table class="thumbs"> 49 <tr tal:repeat="row pageBatch/pages"> 50 <td tal:repeat="thumb row" 51 tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"> 52 <a tal:define="idx thumb/idx" tal:condition="idx" 46 <div class="content-thumbs"> 47 <table class="thumbs"> 48 <tr tal:repeat="row pageBatch/pages"> 49 <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a 50 tal:define="idx thumb/idx" tal:condition="idx" 53 51 tal:attributes="href python:here.getLink(params={'pn':idx, 'viewMode':'images'})"> <img 54 tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=thumbSize,dh=thumbSize,docinfo=docinfo),'images/pic');52 tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=thumbSize,dh=thumbSize,docinfo=docinfo),'images/pic'); 55 53 alt idx" /><br /> 56 <span title="Scan number" tal:content="idx" /> <span 57 tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']" 58 title="Original page number" 59 tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" /> 60 </a> 61 </td> 62 </tr> 63 </table> 64 65 <div class="ruler"> 66 <metal:block 67 metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> 54 <span title="Scan number" tal:content="idx" /> <span 55 tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']" 56 title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" /> 57 </a></td> 58 </tr> 59 </table> 60 </div> 61 <div class="ruler down"> 62 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> 68 63 </div> 69 64 … … 79 74 <input type="hidden" 80 75 tal:define="params python:here.getParams(params={'thumbRows':None,'thumbCols':None,'thumbSize':None})" 81 tal:repeat="param params" 82 tal:attributes="name param; value python:params[param]" /> 76 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> 83 77 <ul> 84 <li> 85 Rows 86 <select class="autosubmit" name="thumbRows" tal:define="rows python:[2,3,5,10,12,15,20,50,100]"> 87 <option tal:repeat="row rows" tal:attributes="selected python:thumbRows==row; value row" tal:content="row"/> 88 </select> 78 <li>Rows <select class="autosubmit" name="thumbRows" tal:define="rows python:[2,3,5,10,12,15,20,50,100]"> 79 <option tal:repeat="row rows" tal:attributes="selected python:thumbRows==row; value row" tal:content="row" /> 80 </select> 89 81 </li> 90 <li> 91 Columns 92 <select class="autosubmit" name="thumbCols" tal:define="cols python:[2,3,5,10,12,15,20,50,100]"> 93 <option tal:repeat="col cols" tal:attributes="selected python:thumbCols==col; value col" tal:content="col"/> 94 </select> 82 <li>Columns <select class="autosubmit" name="thumbCols" tal:define="cols python:[2,3,5,10,12,15,20,50,100]"> 83 <option tal:repeat="col cols" tal:attributes="selected python:thumbCols==col; value col" tal:content="col" /> 84 </select> 95 85 </li> 96 <li> 97 Thumbnail size 98 <select class="autosubmit" name="thumbSize" tal:define="sizes python:[100,150,200,300,500]"> 99 <option tal:repeat="size sizes" tal:attributes="selected python:thumbSize==size; value size" tal:content="size"/> 100 </select> 86 <li>Thumbnail size <select class="autosubmit" name="thumbSize" tal:define="sizes python:[100,150,200,300,500]"> 87 <option tal:repeat="size sizes" tal:attributes="selected python:thumbSize==size; value size" tal:content="size" /> 88 </select> 101 89 </li> 102 90 </ul>
Note: See TracChangeset
for help on using the changeset viewer.