Changeset 609:7962e6891d99 in documentViewer


Ignore:
Timestamp:
Jan 15, 2013, 5:15:32 PM (11 years ago)
Author:
casties
Branch:
default
Message:

works with new notes and notesHandwritten.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • MpiwgXmlTextServer.py

    r587 r609  
    9696       
    9797        field = ''
    98         if mode in ['pages', 'toc', 'figures', 'handwritten']:
     98        if mode in ['pages', 'toc', 'figures', 'notes', 'handwritten']:
    9999            # translate mode to field param
    100             field = '&field=%s'%mode
     100            if mode == 'handwritten':
     101                field = '&field=notesHandwritten'
     102            else:
     103                field = '&field=%s'%mode
    101104        else:
    102105            mode = None
     
    132135                    docinfo['numTextPages'] = getInt(getText(sys.find('countPages')))
    133136                    docinfo['numFigureEntries'] = getInt(getText(sys.find('countFigures')))
    134                     docinfo['numHandwritten'] = getInt(getText(sys.find('countHandwritten')))
     137                    docinfo['numHandwritten'] = getInt(getText(sys.find('countNotesHandwritten')))
     138                    docinfo['numNotes'] = getInt(getText(sys.find('countNotes')))
     139                    docinfo['numPlaces'] = getInt(getText(sys.find('countPlaces')))
    135140                    docinfo['numTocEntries'] = getInt(getText(sys.find('countTocEntries')))
    136141                   
     
    162167                                   
    163168                    # toc
    164                     elif lt == 'toc' or lt == 'figures' or lt == 'handwritten':
     169                    elif lt in ['toc', 'figures', 'notes', 'notesHandwritten']:
    165170                        # contains tags with table of contents/figures
    166171                        # <item n="2.1." lv="2">CAP.I. <ref o="119">132</ref></item>
     
    661666        tocs = fulltoc[first:last]
    662667        tp = '<div>'
    663         label = {'figures': 'Figure', 'handwritten': 'Handwritten note'}.get(mode, 'Item')
     668        label = {'figures': 'Figure', 'notes': 'Note', 'handwritten': 'Handwritten note'}.get(mode, 'Item')
    664669        for toc in tocs:
    665670            pageurl = self.getLink('pn', toc['pn'])
    666671            tp += '<div class="tocline">'
    667672            content = toc['content']
     673            lvs = toc['level-string']
    668674            if content:
    669                 tp += '<div class="toc name">[%s] %s</div>'%(toc['level-string'], toc['content'])
     675                tp += '<div class="toc name">[%s] %s</div>'%(lvs, toc['content'])
     676            elif lvs:
     677                tp += '<div class="toc name">[%s %s]</div>'%(label, lvs)
    670678            else:
    671                 tp += '<div class="toc name">[%s %s]</div>'%(label, toc['level-string'])
     679                tp += '<div class="toc name">[%s]</div>'%(label)
    672680           
    673681            if toc.get('no', None):
  • css/docuviewer.css

    r608 r609  
    102102    -o-transform-origin: top left;
    103103        left: 7px;
    104     top: 34em;
    105     width: 40em;
     104    top: 42em;
     105    width: 45em;
    106106    padding: 0px;
    107107}
  • documentViewer.py

    r608 r609  
    120120    toc_figures = PageTemplateFile('zpt/viewer/toc_figures', globals())
    121121    toc_concordance = PageTemplateFile('zpt/viewer/toc_concordance', globals())
     122    toc_notes = PageTemplateFile('zpt/viewer/toc_notes', globals())
    122123    toc_handwritten = PageTemplateFile('zpt/viewer/toc_handwritten', globals())
    123124    toc_none = PageTemplateFile('zpt/viewer/toc_none', globals())
  • version.txt

    r607 r609  
    1 DocumentViewer 2.2.10
     1DocumentViewer 2.2.11
  • zpt/viewer/common_template.zpt

    r608 r609  
    116116            tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a
    117117              tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>
     118          <li tal:attributes="class python:here.getStyle(tocMode, 'notes')"
     119            tal:condition="python:docpath and docinfo.get('numNotes', None)"><span><a
     120              tal:omit-tag="python:tocMode=='notes'" tal:attributes="href python:here.getLink('tocMode','notes')">Notes</a></span></li>
    118121          <li tal:attributes="class python:here.getStyle(tocMode, 'handwritten')"
    119122            tal:condition="python:docpath and docinfo.get('numHandwritten', None)"><span><a
    120               tal:omit-tag="python:tocMode=='handwritten'" tal:attributes="href python:here.getLink('tocMode','handwritten')">Notes</a></span></li>
     123              tal:omit-tag="python:tocMode=='handwritten'" tal:attributes="href python:here.getLink('tocMode','handwritten')">Handwritten</a></span></li>
    121124          <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"
    122125            tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a
Note: See TracChangeset for help on using the changeset viewer.