Module: check_mk
Branch: master
Commit: 528090806148e901ff6d4705b42578b66471963d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=528090806148e9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 24 11:37:39 2012 +0200
FIX: disable checkbox button in non-checkboxable layouts
---
ChangeLog | 1 +
web/htdocs/views.py | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 88ee342..efa0f20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* FIX: Logwatch: Changed font color back to black
* FIX: show toggle button for checkboxes in deactivated state
* FIX: fix repeated stacked refresh when toggling columns
+ * FIX: disable checkbox button in non-checkboxable layouts
Mobile:
* FIX: Fixed logtime filter settings in all mobile views
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 0f42cbf..13fc8c0 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1301,7 +1301,8 @@ def render_view(view, rows, datasource, group_painters, painters,
len(rows) > 0 and \
should_show_command_form(display_options, datasource)
- show_context_links(view, hide_filters, show_filters, display_options,
painter_options, command_form)
+ show_context_links(view, hide_filters, show_filters, display_options,
+ painter_options, command_form, show_checkboxes)
# User errors in filters
html.show_user_errors()
@@ -1580,7 +1581,8 @@ def togglebutton(id, isopen, icon, help):
html.write('<div class="togglebutton %s %s" title="%s"
'
'onclick="view_toggle_form(this,
\'%s\');"></div>' % (icon, cssclass, help, id))
-def show_context_links(thisview, active_filters, show_filters, display_options,
painter_options, command_form):
+def show_context_links(thisview, active_filters, show_filters, display_options,
+ painter_options, command_form, show_checkboxes):
# html.begin_context_buttons() called automatically by html.context_button()
# That way if no button is painted we avoid the empty container
execute_hooks('buttons-begin')
@@ -1607,7 +1609,10 @@ def show_context_links(thisview, active_filters, show_filters,
display_options,
if 'C' in display_options:
if command_form:
togglebutton("commands", False, "commands",
_("Execute commands on hosts, services and other objects"))
- view_option_toggler(thisview, "show_checkboxes",
"checkbox", _("Enable/Disable checkboxes for selecting rows for
commands"))
+ if show_checkboxes:
+ view_option_toggler(thisview, "show_checkboxes",
"checkbox", _("Enable/Disable checkboxes for selecting rows for
commands"))
+ else:
+ togglebutton_off("checkbox")
else:
togglebutton_off("commands")
togglebutton_off("checkbox")