Changeset 562:60f5a636bc57 in documentViewer


Ignore:
Timestamp:
Oct 2, 2012, 1:22:11 PM (12 years ago)
Author:
casties
Branch:
default
Message:

bugfixes for stability.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r561 r562  
    559559            docUrl = getParentPath(url)
    560560            metaDom = self.metadataService.getDomFromPathOrUrl(docUrl)
     561            docinfo['imagePath'] = url.replace('/mpiwg/online/', '', 1)
    561562
    562563        elif mode=="filepath":
    563564            # url points to image file, index.meta optional
    564             docinfo['imagePath'] = url
    565565            docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + url
    566566            docinfo['numPages'] = 1
     
    636636            # number of images from digilib
    637637            if docinfo.get('imagePath', None):
    638                 docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + docinfo['imagePath']
    639                 docinfo = self.getDocinfoFromDigilib(docinfo, docinfo['imagePath'])
     638                imgpath = docinfo['imagePath'].replace('/mpiwg/online/', '', 1)
     639                docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + imgpath
     640                docinfo = self.getDocinfoFromDigilib(docinfo, imgpath)
    640641            else:
    641642                # imagePath still missing? try "./pageimg"
     
    696697        docPath = getMDText(docinfo.get('documentPath', None))
    697698        if imageDir and docPath:
    698             #print "image: ", imageDir, " archivepath: ", archivePath
    699699            imageDir = os.path.join(docPath, imageDir)
    700700            imageDir = imageDir.replace('/mpiwg/online', '', 1)
  • zpt/toc_thumbs.zpt

    r540 r562  
    2727            <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a
    2828              tal:define="idx thumb/idx" tal:condition="idx" tal:attributes="href python:here.getLink('pn',idx)"> <img
    29                 tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
     29                tal:attributes="src python:test(docinfo.get('imageURL',None),here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
    3030                                alt idx" /><br />
    3131                <span tal:attributes="title string:Scan number $idx" tal:content="idx" /> <span
  • zpt/viewer_index.zpt

    r560 r562  
    4646      <a tal:define="tp docinfo/titlePage | string:1"
    4747        tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img tal:condition="tp" border="0"
    48         tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img
    49         tal:condition="python:not tp and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
     48        tal:attributes="src python:'%s&pn=%s&dw=300&dh=500'%(docinfo.get('imageURL',None),tp)" /><img
     49        tal:condition="python:not docinfo.get('titlePage',None) and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
    5050    </div>
    5151
     
    119119                  History of Science</a> (unless stated otherwise)</td>
    120120            </tr>
    121             <tr>
     121            <tr tal:define="accType python:docinfo.get('accessType', None)">
    122122              <td class="type">License:</td>
    123               <td tal:condition="python:docinfo.get('accessType', None) == 'free'" class="content"><a target="_blank" href="http://creativecommons.org/licenses/by-sa/3.0/de/">CC-BY-SA</a>
     123              <td tal:condition="python:accType == 'free'" class="content"><a target="_blank" href="http://creativecommons.org/licenses/by-sa/3.0/de/">CC-BY-SA</a>
    124124                (unless stated otherwise)</td>
    125               <td tal:condition="python:docinfo.get('accessType', None) != 'free'" class="content">Internal use only, please contact <a href="mailto:library@mpiwg-berlin.mpg.de">library@mpiwg-berlin.mpg.de</a>
     125              <td tal:condition="python:accType != 'free'" class="content">Internal use only<span tal:condition="accType" tal:content="string: ($accType)"/>,
     126                please contact <a href="mailto:library@mpiwg-berlin.mpg.de">library@mpiwg-berlin.mpg.de</a>
    126127                (unless stated otherwise)</td>
    127128            </tr>
Note: See TracChangeset for help on using the changeset viewer.