Module: check_mk
Branch: master
Commit: 0e621960b3aeed5837a60ea7af857ee63e11b9c4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e621960b3aeed…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Dec 10 10:48:51 2013 +0100
FIX Improved sorting of WATO folders in dropdown menu
WATO folders now always sorted by their title (case-insensitive)
---
.werks/241 | 8 ++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 3 ++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/241 b/.werks/241
new file mode 100644
index 0000000..19439f8
--- /dev/null
+++ b/.werks/241
@@ -0,0 +1,8 @@
+Title: Improved sorting of WATO folders in dropdown menu
+Level: 1
+Component: wato
+Version: 1.2.3i8
+Date: 1386668799
+Class: fix
+
+WATO folders now always sorted by their title (case-insensitive)
diff --git a/ChangeLog b/ChangeLog
index 7940374..c21ec33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
+ * 0241 FIX: Improved sorting of WATO folders in dropdown menu...
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b6bdaf8..b859558 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11240,7 +11240,8 @@ def folder_selection(folder, depth=0):
title_prefix = ""
sel = [ (folder[".path"], title_prefix + folder["title"]) ]
- for subfolder in folder[".folders"].values():
+ subfolders = sorted(folder[".folders"].values(), cmp = lambda x,y :
cmp(x.get("title").lower(), y.get("title").lower()))
+ for subfolder in subfolders:
sel += folder_selection(subfolder, depth + 1)
return sel