Changeset 3088


Ignore:
Timestamp:
Mar 29, 2006 4:46:40 PM (11 years ago)
Author:
moschny
Message:
  • Introduce the nocollapse argument. It prevents the toc from being sorted and party collapsed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trac/plugins/tracnav/tracnav/tracnav.py

    r3085 r3088  
    5656"""
    5757__id__        = '$Id$'
    58 __version__   = '3.91'
     58__version__   = '3.92pre1'
    5959__revision__  = '$LastChangedRevision$'
    6060
     
    197197        Main routine of the wiki macro.
    198198        """
     199
     200        #init
    199201        out = StringIO()
     202        names = []
     203        collapse = True
     204        curpage = req.args.get('page','')
     205
     206        # parse arguments
     207        if args:
     208            for arg in args.split('|'):
     209                if arg == 'nocollapse':
     210                    collapse = False
     211                else:
     212                    names.append(arg)
    200213       
    201214        # header
     
    207220
    208221        # add TOCs
    209         curpage = req.args.get('page','')
    210         names = (args or "TOC").split('|')
    211 
    212         for name in names:
     222        for name in (names or ["TOC"]):
    213223            toc_text = self.get_toc(req, name)
    214224            toc = self.parse_toc(toc_text, req)
    215225            if not toc:
    216226                toc = self.parse_toc(' * TOC "%s" is empty!' % name)
    217             (found, filtered) = self.filter_toc(curpage, toc)
    218             if found:
    219                 self.display_all(out, req, name, filtered, col)
     227            if collapse:
     228                (found, filtered) = self.filter_toc(curpage, toc)
     229                if found:
     230                    self.display_all(out, req, name, filtered, col)
    220231            else:
    221232                self.display_all(out, req, name, toc, col)
Note: See TracChangeset for help on using the changeset viewer.