Changeset 2934 for trac/trunk/wiki-macros/TracNav.py
- Timestamp:
- 03/24/05 18:12:29 (8 years ago)
- File:
-
- 1 edited
-
trac/trunk/wiki-macros/TracNav.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trac/trunk/wiki-macros/TracNav.py
r2933 r2934 24 24 /* Styles for TracNav */ 25 25 .wiki-toc.trac-nav h4 { margin: 0; padding: 0; } 26 .wiki-toc.trac-nav li { margin: 0; padding: 0 1em; }27 .wiki-toc.trac-nav li li { padding-right: 0em;}28 26 .wiki-toc.trac-nav .edit { border:0; position:absolute; top:0; right:5px; } 29 27 .wiki-toc.trac-nav .edit a { color:blue; border-color:blue; } … … 193 191 if hdf.getValue('trac.acl.WIKI_MODIFY', ''): 194 192 html += '%s<div class="edit"><a href="%s?edit=yes">edit</a></div>\n' % (indentation(col), env.href.wiki(name)) 195 html += display(env, curpage, toc, col) 193 html += '%s<ul>\n' % indentation(col) 194 col += 1 195 html += display(env, curpage, toc, 0, col) 196 col -= 1 197 html += '%s</ul>\n' % indentation(col) 196 198 col -= 1 197 199 html += '%s</div>\n' % indentation(col) 198 200 return html 199 201 200 def display(env, curpage, toc, col):202 def display(env, curpage, toc, depth, col): 201 203 html = '' 202 html += '%s<ul>\n' % indentation(col)203 col += 1204 204 for name, title, sub in toc: 205 liStyle = ' style="padding-left: %dem;"' % (depth + 1) 205 206 if sub == None: 206 207 if name == curpage: … … 208 209 else: 209 210 cls = '' 210 html += '%s<li%s >' % (indentation(col), cls)211 html += '%s<li%s%s>' % (indentation(col), liStyle, cls) 211 212 if name == None: 212 213 html += title … … 215 216 html += '</li>\n' 216 217 else: 217 html += '%s<li >\n' % indentation(col)218 html += '%s<li%s>\n' % (indentation(col), liStyle) 218 219 col += 1 219 220 if name == None or len(sub) > 0: … … 221 222 else: 222 223 html += '%s<h4><a href="%s">%s...</a></h4>\n' % (indentation(col), env.href.wiki(name), title) 223 if len(sub) > 0:224 html += display(env, curpage, sub, col)225 224 col -= 1 226 225 html += '%s</li>\n' % indentation(col) 227 col -= 1228 html += '%s</ul>\n' % indentation(col)226 if len(sub) > 0: 227 html += display(env, curpage, sub, depth + 1, col) 229 228 return html 230 229
Note: See TracChangeset
for help on using the changeset viewer.
