Module: check_mk
Branch: master
Commit: b3d984ae9573ff720d2c93caeb2099efff0387fd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3d984ae9573ff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 14:29:22 2011 +0200
Sort titles in views can be enabled by clicking on the whole cells now
---
ChangeLog | 1 +
web/htdocs/check_mk.css | 18 +++++++++++-------
web/htdocs/views.py | 12 +++++++-----
3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a66e5de..fd71f13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,7 @@
* Added missing sorters for "service nth service perfdata" painters
* Implemented row selection in views to select only a subset of shown data
for actions
+ * Sort titles in views can be enabled by clicking on the whole cells now
WATO:
* Changed row selection in WATO to new row selection mechanism
diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css
index 96bf4ed..3c71f04 100644
--- a/web/htdocs/check_mk.css
+++ b/web/htdocs/check_mk.css
@@ -619,21 +619,25 @@ table.data th {
}
/* Table header links (For sorting) */
-table.data th a {
- color: #fff;
+
+table.data th.sort {
text-decoration: underline;
}
-table.data th a:hover {
- color: #fff;
- text-decoration: none;
+table.data th.sort:hover {
+ background-color: #A4B2B2;
+ cursor: pointer;
+}
+
+table.data th.sort:hover {
+ color: #000;
}
-table.data th a.asc {
+table.data th.asc {
color: #CBDCF2;
}
-table.data th a.desc {
+table.data th.desc {
color: #CBDCF2;
}
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index ad522ba..9fdfb07 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2390,6 +2390,9 @@ def paint_header(view, p):
# - Add the display options (Keeping the same display options as current)
# - Link to _self (Always link to the current frame)
# - Keep the _body_class variable (e.g. for dashlets)
+ thclass = ''
+ onclick = ''
+ title = ''
if 'L' in html.display_options \
and view.get('user_sortable', True) \
and get_sorter_name_of_painter(painter) is not None:
@@ -2401,12 +2404,11 @@ def paint_header(view, p):
if hasattr(html, 'title_display_options'):
params.append(('display_options', html.title_display_options))
- t = "<a class=\"%s\" href=\"%s\"
title=\"%s\" target=\"_self\">%s</a>" % \
- (get_primary_sorter_order(view, painter),
- html.makeuri(params, 'sort'),
- _('Sort by %s') % t, t)
+ thclass = ' class="sort %s"' % get_primary_sorter_order(view,
painter)
+ onclick = ' onclick="location.href=\'%s\'"' %
html.makeuri(params, 'sort')
+ title = ' title="%s"' % (_('Sort by %s') % t)
- html.write("<th>%s</th>" % t)
+ html.write("<th%s%s%s>%s</th>" % (thclass, onclick, title, t))
def register_events(row):
if config.sounds != []: