1.1 --- a/macros/CategoryMenu.py Sat Oct 25 01:17:33 2008 +0200
1.2 +++ b/macros/CategoryMenu.py Sat Oct 25 02:13:43 2008 +0200
1.3 @@ -132,6 +132,8 @@
1.4
1.5 # Visit each page in the category.
1.6
1.7 + last_parts = []
1.8 +
1.9 for page_in_category in pages_in_category:
1.10 pagename = page_in_category.page_name
1.11
1.12 @@ -140,10 +142,26 @@
1.13 else:
1.14 output.append(fmt.listitem(on=1))
1.15 output.append(fmt.pagelink(on=1, pagename=pagename))
1.16 - output.append(fmt.text(pagename))
1.17 +
1.18 + # Abbreviate long hierarchical names.
1.19 +
1.20 + parts = pagename.split("/")
1.21 + common = 0
1.22 + for last, current in map(None, last_parts, parts):
1.23 + if last == current:
1.24 + common += 1
1.25 + else:
1.26 + break
1.27 +
1.28 + prefix = u"\u2014" * common
1.29 + suffix = "/".join(parts[common:])
1.30 +
1.31 + output.append(fmt.text("%s %s" % (prefix, suffix)))
1.32 output.append(fmt.pagelink(on=0, pagename=pagename))
1.33 output.append(fmt.listitem(on=0))
1.34
1.35 + last_parts = parts
1.36 +
1.37 output.append(fmt.bullet_list(on=0))
1.38 output.append(fmt.listitem(on=0))
1.39
2.1 --- a/themes/ep2008/css/category.css Sat Oct 25 01:17:33 2008 +0200
2.2 +++ b/themes/ep2008/css/category.css Sat Oct 25 02:13:43 2008 +0200
2.3 @@ -1,7 +1,10 @@
2.4 /* category.css - some additional styles for the CategoryMenu macro
2.5 - which can be included in the screen.css using
2.6 + which can be included in screen.css using...
2.7 +
2.8 @import "category.css";
2.9
2.10 + ...before any rules.
2.11 +
2.12 Copyright (c) 2008 by Paul Boddie
2.13 Licensed under the GNU GPL (v2 or later), see COPYING.txt for details.
2.14 */
2.15 @@ -13,6 +16,14 @@
2.16 margin-left: 0;
2.17 padding-left: 0;
2.18 width: 20em;
2.19 + float: left;
2.20 + margin-right: 2em;
2.21 +}
2.22 +
2.23 +/* Prevent issues with the above float. */
2.24 +
2.25 +hr {
2.26 + clear: left;
2.27 }
2.28
2.29 ul.category-submenu {