Changeset 608:0c6056271654 in documentViewer
- Timestamp:
- Dec 18, 2012, 6:26:22 PM (12 years ago)
- Branch:
- default
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
css/docuviewer.css
r607 r608 41 41 border: 1px solid silver; 42 42 padding: 0.5em; 43 } 44 div.page-head div.title.part-of { 45 border-top: none; 43 46 } 44 47 -
documentViewer.py
r607 r608 554 554 if metaDom is not None and metaDom.tag == 'resource': 555 555 # document directory name and path 556 resource = self.metadataService.getResourceData(dom=metaDom )556 resource = self.metadataService.getResourceData(dom=metaDom, recursive=1) 557 557 if resource: 558 558 docinfo = self.getDocinfoFromResource(docinfo, resource) … … 643 643 docinfo['maxPageNo'] = docinfo.get('maxPageNo', docinfo['numPages']) 644 644 645 # part-of information 646 partOfPath = docinfo.get('partOfPath', None) 647 if partOfPath is not None: 648 partOfDom = self.metadataService.getDomFromPathOrUrl(partOfPath) 649 if partOfDom is not None: 650 docinfo['partOfLabel'] = self.metadataService.getBibFormattedLabel(dom=partOfDom) 651 docinfo['partOfUrl'] = "%s?url=%s"%(self.getDocumentViewerURL(), partOfPath) 652 logging.debug("partOfLabel=%s partOfUrl=%s"%(docinfo['partOfLabel'],docinfo['partOfUrl'])) 653 645 654 # normalize path 646 655 if 'imagePath' in docinfo and not docinfo['imagePath'].startswith('/'): … … 655 664 def getDocinfoFromResource(self, docinfo, resource): 656 665 """reads contents of resource element into docinfo""" 657 docName = resource.get('name', None) 666 logging.debug("getDocinfoFromResource: resource=%s"%(repr(resource))) 667 docName = getMDText(resource.get('name', None)) 658 668 docinfo['documentName'] = docName 659 docPath = resource.get('archive-path', None)669 docPath = getMDText(resource.get('archive-path', None)) 660 670 if docPath: 661 671 # clean up document path … … 671 681 if not docUrl.startswith('http:'): 672 682 docPath = docUrl 683 673 684 if docPath: 674 685 # fix URLs starting with /mpiwg/online … … 676 687 677 688 docinfo['documentPath'] = docPath 689 690 # is this part-of? 691 partOf = resource.get('is-part-of', None) 692 if partOf is not None: 693 partOf = getMDText(partOf.get('archive-path', None)) 694 if partOf is not None: 695 docinfo['partOfPath'] = partOf.strip() 696 678 697 return docinfo 679 698 -
zpt/viewer/common_template.zpt
r607 r608 25 25 </div> 26 26 <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" /> 27 <div class="title part-of" tal:condition="exists:docinfo/partOfPath"> 28 part of: <a tal:attributes="href docinfo/partOfUrl" target="_blank" tal:content="structure docinfo/partOfLabel"/> 29 </div> 27 30 <ul class="view-switcher" metal:define-slot="view-switcher"> 28 31 <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'text')"><a
Note: See TracChangeset
for help on using the changeset viewer.