Changeset 528:f8a5f63eafc0 in documentViewer for zpt


Ignore:
Timestamp:
Apr 13, 2012, 2:55:16 PM (12 years ago)
Author:
casties
Branch:
default
Message:

new viewMode=thumbs.

Location:
zpt
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • zpt/common_template.zpt

    r527 r528  
    88  <!-- block used for page header content area -->
    99  <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);">
    1514    <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" />
    1818      </tal:block>
    1919      <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})]" />
    2121    </div>
    2222    <div tal:condition="formattedLabel" tal:content="structure formattedLabel" />
    2323    <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>
    2528    </div>
    2629  </metal:block>
     
    3538              leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
    3639    <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)">|&lt;</a> <span tal:condition="not:leftest">|&lt;</span> <a
    40         tal:condition="left" tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span tal:condition="not:left">&lt;</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)">&gt;</a> <span tal:condition="not:right">&gt;</span> <a
    48         tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</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)">|&lt;</a> <span
     44        tal:condition="not:leftest">|&lt;</span> <a tal:condition="left"
     45        tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span
     46        tal:condition="not:left">&lt;</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)">&gt;</a>
     58      <span tal:condition="not:right">&gt;</span> <a tal:condition="rightest"
     59        tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
    4960        tal:condition="not:rightest">&gt;|</span>
    5061    </form>
     
    5263  <!-- /ruler -->
    5364
    54   <!-- toc ruler with previous/next toc page buttons -->
     65  <!-- toc ruler (using getBatch) with previous/next toc page buttons -->
    5566  <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'])">&lt;</a> <span tal:condition="not:batch/prevStart">&lt;</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'])">&lt;</a>
     73      <span tal:condition="not:batch/prevStart">&lt;</span>
    6074      <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"
    6277          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'])">&gt;</a> <span tal:condition="not:batch/nextStart">&gt;</span>
     78      </select>
     79      <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
     80        tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a>
     81      <span tal:condition="not:batch/nextStart">&gt;</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)">&lt;</a>
     91      <span tal:condition="not:left">&lt;</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)">&gt;</a> <span
     102        tal:condition="not:right">&gt;</span>
    65103    </form>
    66104  </metal:block>
     
    69107  <metal:block metal:define-macro="toc_switcher">
    70108    <ul class="switcher">
    71       <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)"><a
    72         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>
    73111      </li>
    74112      <li tal:attributes="class python:test(tocMode=='text', 'sel', None)"
     
    78116      <li tal:attributes="class python:test(tocMode=='figures', 'sel', None)"
    79117        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>
    82119      </li>
    83120      <li tal:attributes="class python:test(tocMode=='concordance', 'sel', None)"
    84121        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>
    87123      </li>
    88       <li tal:attributes="class python:test(tocMode=='none', 'sel', None)"><a
    89         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>
    90126      </li>
    91127    </ul>
  • zpt/layer_text_annotator.zpt

    r527 r528  
    2424  <script
    2525    tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/permissions.js"></script>
    26   <script
    27     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> -->
    2828  <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> -->
    3030  <script
    3131    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>
    3438
    3539  <script type="text/javascript">
     
    3842                // annotator
    3943                var elem = $('div.pageContent').get(0);
    40                 var uri = window.location.href.split(/#|\?/).shift();
     44                var uri = annotatorPageUrl;
    4145                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
    4547                }).addPlugin('Permissions', {
    46                     user : 'anonymous',
     48                    user : annotatorUser,
    4749                    userString : function(user) {
    4850                        if (user && user.name) {
     
    5860                    }
    5961                }).addPlugin('Store', {
    60                     //prefix : 'http://localhost:18080/AnnotationManager/annotator',
    6162                    prefix: 'http://virtuoso.mpiwg-berlin.mpg.de:8080/AnnotationManager/annotator',
    62                     //prefix: 'http://annotateit.org/api',
    6363                    annotationData : {
    6464                        'uri' : uri
     
    6767                        'limit' : 20,
    6868                        'uri' : uri
    69                     //'uri': 'http://127.0.0.1:18080/ECHOdocuViewfullTest?pn=21&url=/mpiwg/online/permanent/library/163127KK'
    7069                    }
    7170                });
     
    9089  <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers">
    9190    <!-- BEGIN ANNOTATIONS -->
    92     <div class="options">
     91    <div class="options" tal:define="annUser python:here.getAuthenticatedUser(anon='anonymous')">
    9392      <h4>Annotations</h4>
    94       <div>nothing to be seen here...</div>
     93      <div>You are user "<span tal:replace="annUser"/>"</div>
    9594    </div>
    9695    <!-- END ANNOTATIONS -->
  • zpt/toc_thumbs.zpt

    r526 r528  
    1919    <div class="content">
    2020      <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)">&lt;</a>
    26           <span tal:condition="not:left">&lt;</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)">&gt;</a>
    37           <span tal:condition="not:right">&gt;</span>
    38         </form>
     21        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs"/>
    3922      </div>
    4023
Note: See TracChangeset for help on using the changeset viewer.