- Timestamp:
- 02/16/05 17:31:12 (8 years ago)
- File:
-
- 1 edited
-
trac/trunk/wiki-macros/JPNav.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trac/trunk/wiki-macros/JPNav.py
r2704 r2705 85 85 if (hdf.getValue('trac.acl.WIKI_MODIFY', '')): 86 86 html += '<div class="wiki-tocedit"><a href="%s?edit=yes">edit</a></div>' % env.href.wiki(name) 87 (_, subhtml) = generate(env, curpage, toc )87 (_, subhtml) = generate(env, curpage, toc, 0) 88 88 html += subhtml 89 89 html += '</div>' … … 91 91 92 92 93 def generate(env, curpage, toc ):94 html = ' <ul>'93 def generate(env, curpage, toc, level): 94 html = '' 95 95 found = 0 96 96 for name, title, sub in toc: … … 105 105 html += '</li>' 106 106 else: 107 html += '<li>' 108 (subfound, subhtml) = generate(env, curpage, sub) 107 (subfound, subhtml) = generate(env, curpage, sub, level + 1) 109 108 if subfound: 110 html += '<h4>%s</h4>' % title 111 html += subhtml 109 menu = '' 110 menu += '<li>' 111 menu += '<h4>%s</h4>' % title 112 menu += subhtml 113 menu += '</li>' 112 114 found = 1 115 if level == 0: 116 html = menu + html 117 else: 118 html += menu 113 119 else: 120 html += '<li>' 114 121 html += '<h4><a href="%s">%s...</a></h4>' % (env.href.wiki(name), title) 115 html += '</li>'116 html += '</ul>'122 html += '</li>' 123 html = '<ul>%s</ul>' % html 117 124 return (found, html); 118 125
Note: See TracChangeset
for help on using the changeset viewer.
