Changeset 2934


Ignore:
Timestamp:
03/24/05 18:12:29 (8 years ago)
Author:
hauma
Message:
  • Adjusted the look and feel of the active line in the TracNav navigation bar. Now, the whole line is highlighted no matter of the level of indentation. Unfortunately, this requires to generate a flat unordered list in HTML with direct style directives for indentation.
Location:
trac/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trac/trunk/htdocs/css/wiki.css

    r2933 r2934  
    4040/* Styles for TracNav */ 
    4141.wiki-toc.trac-nav h4 { margin: 0; padding: 0; } 
    42 .wiki-toc.trac-nav li { margin: 0; padding: 0 1em; } 
    43 .wiki-toc.trac-nav li li { padding-right: 0em;} 
    4442.wiki-toc.trac-nav .edit { border:0; position:absolute; top:0; right:5px; } 
    4543.wiki-toc.trac-nav .edit a { color:blue; border-color:blue; } 
  • trac/trunk/wiki-macros/TracNav.py

    r2933 r2934  
    2424/* Styles for TracNav */ 
    2525.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;} 
    2826.wiki-toc.trac-nav .edit { border:0; position:absolute; top:0; right:5px; } 
    2927.wiki-toc.trac-nav .edit a { color:blue; border-color:blue; } 
     
    193191    if hdf.getValue('trac.acl.WIKI_MODIFY', ''): 
    194192        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) 
    196198    col -= 1 
    197199    html += '%s</div>\n' % indentation(col) 
    198200    return html 
    199201 
    200 def display(env, curpage, toc, col): 
     202def display(env, curpage, toc, depth, col): 
    201203    html = '' 
    202     html += '%s<ul>\n' % indentation(col) 
    203     col += 1 
    204204    for name, title, sub in toc: 
     205        liStyle = ' style="padding-left: %dem;"' % (depth + 1) 
    205206        if sub == None: 
    206207            if name == curpage: 
     
    208209            else: 
    209210                cls = '' 
    210             html += '%s<li%s>' % (indentation(col), cls) 
     211            html += '%s<li%s%s>' % (indentation(col), liStyle, cls) 
    211212            if name == None: 
    212213                html += title 
     
    215216            html += '</li>\n' 
    216217        else: 
    217             html += '%s<li>\n' % indentation(col) 
     218            html += '%s<li%s>\n' % (indentation(col), liStyle) 
    218219            col += 1 
    219220            if name == None or len(sub) > 0: 
     
    221222            else: 
    222223                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) 
    225224            col -= 1 
    226225            html += '%s</li>\n' % indentation(col) 
    227     col -= 1 
    228     html += '%s</ul>\n' % indentation(col) 
     226            if len(sub) > 0: 
     227                html += display(env, curpage, sub, depth + 1, col) 
    229228    return html 
    230229 
Note: See TracChangeset for help on using the changeset viewer.