Module: check_mk
Branch: master
Commit: 62ab5bce2144232cb7415e12292916121efc6853
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62ab5bce214423…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 12 10:21:06 2013 +0200
wato rulesets: showing help texts of rulesets in ruleset list dialog
---
web/htdocs/js/checkmk.js | 11 +++++++++++
web/htdocs/wato.css | 10 ++++++++++
web/htdocs/wato.py | 1 +
3 files changed, 22 insertions(+)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index ba73263..2fcd72a 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1760,6 +1760,17 @@ function help_switch(how) {
for (var i=0; i<helpdivs.length; i++) {
helpdivs[i].style.display = how ? "block" : "none";
}
+
+ // small hack for wato ruleset lists, toggle the "nofloat" class
+ // on those objects to make the layout possible
+ var rulesetdivs = document.getElementsByClassName('ruleset');
+ for (var i = 0; i < rulesetdivs.length; i++) {
+ if (how)
+ add_class(rulesetdivs[i], 'nofloat');
+ else
+ remove_class(rulesetdivs[i], 'nofloat');
+ }
+
get_url("ajax_switch_help.py?enabled=" + (how ? "yes" :
""));
}
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 134a24a..90d82bc 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -781,6 +781,16 @@ div.rulesets table.nform tr.bottom td {
/* color: #444; */
}
+.wato .rulesets div.ruleset.nofloat {
+ float: none;
+ clear: left;
+}
+
+.wato .rulesets div.ruleset div.help {
+ height: auto;
+ clear: left;
+}
+
/* Page edit_ruleset */
div.varname {
color: white;
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 14ee24e..f71fe1a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10290,6 +10290,7 @@ def mode_rulesets(phase):
html.write('<span class=dots>%s</span></div>' %
("." * 100))
html.write('<div class="rulecount %s"
title="%s">%d</div>' %
(num_rules and "nonzero" or "zero", title,
num_rules))
+ html.help(rulespec["help"])
html.write('</div>')
if something_shown: