Module: check_mk
Branch: master
Commit: 6e23fcba7e5f7efd8b92b36e5bcaf14a258fe82e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e23fcba7e5f7e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 6 17:07:05 2012 +0200
Sidebar: Sorting aggregation groups in BI snapin now
---
ChangeLog | 2 ++
web/plugins/sidebar/bi.py | 9 +++++----
web/plugins/sidebar/shipped.py | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a074bc6..913c60d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,6 +79,8 @@
Multisite:
* Added css class="dashboard_<name>" to the dashboard div for easier
customization of the dashboard style of a special dashboard
+ * Sidebar: Sorting aggregation groups in BI snapin now
+ * Sidebar: Sorting sites in master control snapin case insensitive
* FIX: fixed localization of general permissions
* FIX: show multisite warning messages even after page reload
* FIX: fix bug in Age ValueSpec: days had been ignored
diff --git a/web/plugins/sidebar/bi.py b/web/plugins/sidebar/bi.py
index f044c5f..fe34c6b 100644
--- a/web/plugins/sidebar/bi.py
+++ b/web/plugins/sidebar/bi.py
@@ -36,10 +36,11 @@ except NameError:
def render_bi_groups():
bi.compile_forest(config.user_id)
html.write("<ul>")
- for group, trees in bi.g_user_cache["forest"].items():
- if len(trees) > 0:
- bulletlink(group, "view.py?view_name=aggr_group&aggr_group=%s"
%
- htmllib.urlencode(group))
+ group_names = [ group for group, trees in bi.g_user_cache["forest"].items()
if trees ]
+ group_names = sorted(group_names, cmp = lambda a,b: cmp(a.lower(), b.lower()))
+ for group in group_names:
+ bulletlink(group, "view.py?view_name=aggr_group&aggr_group=%s" %
+ htmllib.urlencode(group))
html.write("</ul>")
sidebar_snapins["biaggr_groups"] = {
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index de9d1a4..339aab2 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -381,7 +381,7 @@ def render_sitestatus():
sitenames = []
for sitename, site in config.allsites().iteritems():
sitenames.append((sitename, site['alias']))
- sitenames = sorted(sitenames, key=lambda k: k[1])
+ sitenames = sorted(sitenames, key=lambda k: k[1], cmp = lambda a,b:
cmp(a.lower(), b.lower()))
for sitename, sitealias in sitenames:
site = config.site(sitename)