Module: check_mk
Branch: master
Commit: dfa1cdaa550fe90fbf5ba7cb18e4bde70452edf2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dfa1cdaa550fe9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 24 12:27:48 2011 +0200
Fixed problems detecting the group sorters
---
web/htdocs/views.py | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index a6ac0d8..8d27ef4 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2215,8 +2215,9 @@ def sort_url(view_sorters, group_painters, painter):
sort = html.var('sort', None)
sorter = []
- group_sort = [ (multisite_painters[p[0]]['sorter'], False) for p in
group_painters
- if p[0] in multisite_painters and 'sorter' in
multisite_painters[p[0]] ]
+ group_sort = [ (get_sorter_name_of_painter(multisite_painters[p[0]]), False)
+ for p in group_painters
+ if p[0] in multisite_painters ]
view_sort = [ s for s in view_sorters if not s[0] in group_sort ]
# Get current url individual sorters. Parse the "sort" url parameter,
@@ -2266,13 +2267,17 @@ def paint_header(view, p):
# - Link to _self (Always link to the current frame)
# - Keep the _body_class variable (e.g. for dashlets)
if view.get('user_sortable', True) and get_sorter_name_of_painter(painter) is
not None:
+ params = [
+ ('sort', sort_url(view['sorters'],
view['group_painters'], painter)),
+ ]
+ if html.has_var('_body_class'):
+ params.append(('_body_class', html.var('_body_class')))
+ if html.has_var('display_options'):
+ params.append(('display_options',
html.var('display_options')))
+
t = "<a class=\"%s\" href=\"%s\"
title=\"%s\" target=\"_self\">%s</a>" % \
(get_primary_sorter_order(painter),
- html.makeuri([
- ('sort', sort_url(view['sorters'],
view['group_painters'], painter)),
- ('display_options', html.display_options),
- ('_body_class', html.var('_body_class')),
- ], 'sort'),
+ html.makeuri(params, 'sort'),
_('Sort by %s') % t, t)
html.write("<th>%s</th>" % t)