Changeset 528:f8a5f63eafc0 in documentViewer for zpt
- Timestamp:
- Apr 13, 2012, 2:55:16 PM (13 years ago)
- Branch:
- default
- Location:
- zpt
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
zpt/common_template.zpt
r527 r528 8 8 <!-- block used for page header content area --> 9 9 <metal:block metal:define-macro="head" 10 tal:define="docpath docinfo/textURLPath | nothing; 11 query here/REQUEST/query | nothing; 12 queryType here/REQUEST/queryType | nothing; 13 bib docinfo/bib | nothing; bibType docinfo/bibType | nothing; 14 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);"> 10 tal:define="viewMode pageinfo/viewMode; 11 docpath docinfo/textURLPath | nothing; 12 bib docinfo/bib | nothing; bibType docinfo/bibType | nothing; 13 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);"> 15 14 <div tal:condition="not:formattedLabel"> 16 <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']"><i tal:content="docinfo/creator"/>, 17 <span tal:content="docinfo/title"/>, <span tal:content="docinfo/date"/> 15 <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']"> 16 <i tal:content="docinfo/creator" />, 17 <span tal:content="docinfo/title" />, <span tal:content="docinfo/date" /> 18 18 </tal:block> 19 19 <span tal:condition="not:python:docinfo['creator'] or docinfo['title']" 20 tal:content="string:[no bibliographical information for this document (type ${bibType})]" />20 tal:content="string:[no bibliographical information for this document (type ${bibType})]" /> 21 21 </div> 22 22 <div tal:condition="formattedLabel" tal:content="structure formattedLabel" /> 23 23 <div class="doclinks"> 24 <a tal:attributes="href python:here.getLink('viewMode','index')">Bibliographical information</a> 24 <a tal:condition="python:viewMode!='index'" tal:attributes="href python:here.getLink('viewMode','index')">Bibliographical 25 information</a> 26 <a tal:condition="python:viewMode!='text'" tal:attributes="href python:here.getLink('viewMode','text')">Page view</a> 27 <a tal:condition="python:viewMode!='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a> 25 28 </div> 26 29 </metal:block> … … 35 38 leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);"> 36 39 <form class="autosubmit" tal:attributes="action viewerUrl"> 37 <input type="hidden" tal:define="params python:here.getParams('pn', None)" tal:repeat="param params" 38 tal:attributes="name param; value python:params[param]" /> page <a tal:condition="leftest" 39 tal:attributes="href python:here.getLink('pn',leftest)">|<</a> <span tal:condition="not:leftest">|<</span> <a 40 tal:condition="left" tal:attributes="href python:here.getLink('pn',left)"><</a> <span tal:condition="not:left"><</span> 41 <input class="autosubmit" size="3" type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage" 42 title="Original page number" tal:define="originalPage pageinfo/pageNumberOrig | nothing" 43 tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span 44 tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None"> [<span 45 tal:replace="originalPageNorm" />]</span>) 46 </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right" 47 tal:attributes="href python:here.getLink('pn',right)">></a> <span tal:condition="not:right">></span> <a 48 tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">>|</a> <span 40 <input type="hidden" tal:define="params python:here.getParams('pn', None)" 41 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> 42 page <a tal:condition="leftest" 43 tal:attributes="href python:here.getLink('pn',leftest)">|<</a> <span 44 tal:condition="not:leftest">|<</span> <a tal:condition="left" 45 tal:attributes="href python:here.getLink('pn',left)"><</a> <span 46 tal:condition="not:left"><</span> <input class="autosubmit" size="3" 47 type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage" 48 title="Original page number" 49 tal:define="originalPage pageinfo/pageNumberOrig | nothing" 50 tal:condition="python:originalPage!=None"> (<span 51 tal:replace="originalPage" /><span 52 tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" 53 tal:condition="python:originalPageNorm!=None"> [<span 54 tal:replace="originalPageNorm" />] 55 </span>) 56 </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a 57 tal:condition="right" tal:attributes="href python:here.getLink('pn',right)">></a> 58 <span tal:condition="not:right">></span> <a tal:condition="rightest" 59 tal:attributes="href python:here.getLink('pn',rightest)">>|</a> <span 49 60 tal:condition="not:rightest">>|</span> 50 61 </form> … … 52 63 <!-- /ruler --> 53 64 54 <!-- toc ruler with previous/next toc page buttons -->65 <!-- toc ruler (using getBatch) with previous/next toc page buttons --> 55 66 <metal:block metal:define-macro="toc_ruler"> 56 <form class="autosubmit" tal:attributes="action viewerUrl" tal:define="startParam startParam | string:start"> 57 <input type="hidden" tal:define="params python:here.getParams(startParam, None)" tal:repeat="param params" 58 tal:attributes="name param; value python:params[param]" /> <a tal:condition="batch/prevStart" 59 tal:attributes="href python:here.getLink(startParam,batch['prevStart'])"><</a> <span tal:condition="not:batch/prevStart"><</span> 67 <form class="autosubmit" tal:attributes="action viewerUrl" 68 tal:define="startParam startParam | string:start"> 69 <input type="hidden" tal:define="params python:here.getParams(startParam, None)" 70 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> 71 <a tal:condition="batch/prevStart" 72 tal:attributes="href python:here.getLink(startParam,batch['prevStart'])"><</a> 73 <span tal:condition="not:batch/prevStart"><</span> 60 74 <select class="autosubmit" tal:attributes="name startParam"> 61 <option tal:repeat="grp batch/batches" tal:attributes="selected python:(start==grp['start']); value grp/start" 75 <option tal:repeat="grp batch/batches" 76 tal:attributes="selected python:(start==grp['start']); value grp/start" 62 77 tal:content="string:${grp/start} - ${grp/end}" /> 63 </select> <input type="submit" value="Go" /> <a tal:condition="batch/nextStart" 64 tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">></a> <span tal:condition="not:batch/nextStart">></span> 78 </select> 79 <input type="submit" value="Go" /> <a tal:condition="batch/nextStart" 80 tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">></a> 81 <span tal:condition="not:batch/nextStart">></span> 82 </form> 83 </metal:block> 84 85 <!-- toc ruler for thumbs (using getPageBatch) with previous/next toc page buttons --> 86 <metal:block metal:define-macro="toc_ruler_thumbs"> 87 <form class="autosubmit" tal:attributes="action viewerUrl"> 88 <input type="hidden" tal:define="params python:here.getParams('start',None)" 89 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> 90 <a tal:condition="left" tal:attributes="href python:here.getLink('start',left)"><</a> 91 <span tal:condition="not:left"><</span> 92 <select class="autosubmit" name="start" 93 tal:define="ofs python:test(pageinfo['pageZero'],0,1)"> 94 <tal:block> 95 <option tal:repeat="grp pageBatch/batches" 96 tal:attributes="selected python:start==grp['start']; value grp/start;" 97 tal:content="string:${grp/start} - ${grp/end}" /> 98 </tal:block> 99 </select> 100 <input type="submit" value="Go" /> <a tal:condition="right" 101 tal:attributes="href python:here.getLink('start',right)">></a> <span 102 tal:condition="not:right">></span> 65 103 </form> 66 104 </metal:block> … … 69 107 <metal:block metal:define-macro="toc_switcher"> 70 108 <ul class="switcher"> 71 <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)"> <a72 tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a>109 <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)"> 110 <a tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a> 73 111 </li> 74 112 <li tal:attributes="class python:test(tocMode=='text', 'sel', None)" … … 78 116 <li tal:attributes="class python:test(tocMode=='figures', 'sel', None)" 79 117 tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"> 80 <a 81 tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a> 118 <a tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a> 82 119 </li> 83 120 <li tal:attributes="class python:test(tocMode=='concordance', 'sel', None)" 84 121 tal:condition="python:docpath and docinfo.get('pageNumbers', None)"> 85 <a 86 tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a> 122 <a tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a> 87 123 </li> 88 <li tal:attributes="class python:test(tocMode=='none', 'sel', None)"> <a89 tal:attributes="href python:here.getLink('tocMode','none')">None</a>124 <li tal:attributes="class python:test(tocMode=='none', 'sel', None)"> 125 <a tal:attributes="href python:here.getLink('tocMode','none')">None</a> 90 126 </li> 91 127 </ul> -
zpt/layer_text_annotator.zpt
r527 r528 24 24 <script 25 25 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/permissions.js"></script> 26 < script27 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/annotateitpermissions.js"></script> 26 <!-- <script 27 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/annotateitpermissions.js"></script> --> 28 28 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/auth.js"></script> 29 < script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script>29 <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script> --> 30 30 <script 31 31 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/unsupported.js"></script> 32 <script 33 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> 32 <!-- <script 33 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> --> 34 35 <script type="text/javascript" 36 tal:define="annUrl python:'%s?url=%s&pn=%s'%(rootUrl,docinfo['url'],pageinfo['pn']); annUser python:here.getAuthenticatedUser(anon='anonymous');" 37 tal:content="structure string:var annotatorPageUrl='$annUrl'; var annotatorUser='$annUser';"></script> 34 38 35 39 <script type="text/javascript"> … … 38 42 // annotator 39 43 var elem = $('div.pageContent').get(0); 40 var uri = window.location.href.split(/#|\?/).shift();44 var uri = annotatorPageUrl; 41 45 var devAnnotator = new Annotator(elem).addPlugin('Auth', { 42 //tokenUrl: 'http://annotateit.org/api/token' 43 tokenUrl : 'template/token?user=anonymous' 44 //autoFetch: false 46 tokenUrl : 'template/token?user='+annotatorUser 45 47 }).addPlugin('Permissions', { 46 user : 'anonymous',48 user : annotatorUser, 47 49 userString : function(user) { 48 50 if (user && user.name) { … … 58 60 } 59 61 }).addPlugin('Store', { 60 //prefix : 'http://localhost:18080/AnnotationManager/annotator',61 62 prefix: 'http://virtuoso.mpiwg-berlin.mpg.de:8080/AnnotationManager/annotator', 62 //prefix: 'http://annotateit.org/api',63 63 annotationData : { 64 64 'uri' : uri … … 67 67 'limit' : 20, 68 68 'uri' : uri 69 //'uri': 'http://127.0.0.1:18080/ECHOdocuViewfullTest?pn=21&url=/mpiwg/online/permanent/library/163127KK'70 69 } 71 70 }); … … 90 89 <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> 91 90 <!-- BEGIN ANNOTATIONS --> 92 <div class="options" >91 <div class="options" tal:define="annUser python:here.getAuthenticatedUser(anon='anonymous')"> 93 92 <h4>Annotations</h4> 94 <div> nothing to be seen here...</div>93 <div>You are user "<span tal:replace="annUser"/>"</div> 95 94 </div> 96 95 <!-- END ANNOTATIONS --> -
zpt/toc_thumbs.zpt
r526 r528 19 19 <div class="content"> 20 20 <div class="ruler"> 21 <form class="autosubmit" tal:attributes="action viewerUrl"> 22 <input type="hidden" tal:define="params python:here.getParams('start',None)" 23 tal:repeat="param params" 24 tal:attributes="name param; value python:params[param]" /> 25 <a tal:condition="left" tal:attributes="href python:here.getLink('start',left)"><</a> 26 <span tal:condition="not:left"><</span> 27 <select class="autosubmit" name="start" 28 tal:define="ofs python:test(pageinfo['pageZero'],0,1)"> 29 <tal:block > 30 <option tal:repeat="grp pageBatch/batches" 31 tal:attributes="selected python:start==grp['start']; value grp/start;" 32 tal:content="string:${grp/start} - ${grp/end}" /> 33 </tal:block> 34 </select> 35 <input type="submit" value="Go" /> 36 <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">></a> 37 <span tal:condition="not:right">></span> 38 </form> 21 <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs"/> 39 22 </div> 40 23
Note: See TracChangeset
for help on using the changeset viewer.