Changeset 7245


Ignore:
Timestamp:
Dec 11, 2009, 3:47:44 PM (14 years ago)
Author:
Michael Renzmann
Message:

Allow "normal" tags to be passed to the ListHacks macro, too. This allows to
replace ListTagged on non-type tag pages, such as example?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trachacksplugin/0.11/trachacks/web_ui.py

    r7244 r7245  
    426426    supported Trac releases.
    427427
     428    Other tags may be passed as well. They will be used as additional filter
     429    for displayed hacks, but - other than types and releases - have no
     430    side-effects otherwise.
     431
    428432    For example, the following shows hacks of type `integration` and
    429433    `plugin` for Trac `0.12`:
     
    448452        hide_fieldset_description = False
    449453        if args:
    450             hide_fieldset_description = True
    451454            categories = []
    452455            releases = []
     456            other = []
    453457            for arg in args.split():
    454458                if arg in all_releases:
     
    457461                elif arg in all_categories:
    458462                    categories.append(arg)
     463                else:
     464                    other.append(arg)
     465
     466            if len(categories) or len(releases):
     467                hide_fieldset_description = True
    459468
    460469            if not len(categories):
     
    524533
    525534            ul = builder.ul('\n', class_="listtagged")
    526             query = 'realm:wiki (%s) %s' % \
    527                 (' or '.join(show_releases), category)
     535            query = 'realm:wiki (%s) %s %s' % \
     536                (' or '.join(show_releases), category, ' '.join(other))
    528537
    529538            lines = 0
     
    548557                    if hide_fieldset_legend == False and category in tags:
    549558                        tags.remove(category)
     559                        self.log.debug("hide %s: no legend" % category)
     560                    for o in other:
     561                        if o in tags: tags.remove(o)
    550562                    rendered_tags = [ link(resource('tag', tag))
    551563                                      for tag in natural_sort(tags) ]
Note: See TracChangeset for help on using the changeset viewer.