Module: check_mk
Branch: master
Commit: f956a18d40c09c85b9fdb4a0fb76175c1330354c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f956a18d40c09c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Feb 7 11:26:04 2017 +0100
Add new helper function html::render_help()
Change-Id: I5a3416c104100f6611b238e24d6269cb5bb46d4f
---
web/htdocs/htmllib.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index e4de63e..d3678a1 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1043,14 +1043,21 @@ class HTMLCheck_MK(HTMLGenerator):
# TODO: Add to integration tests!!!
- def help(self, text):
+ def render_help(self, text):
if text and text.strip():
self.have_help = True
- self.open_div(class_="help", style="display: %s;" % (
- "block" if self.help_visible else "none"))
+ c = self.render_div(
+ text.strip(),
+ class_="help",
+ style="display: %s;" % ("block" if self.help_visible
else "none"))
# TODO: Replace with write_text???
- self.write(text.strip())
- self.close_div()
+ return c
+ else:
+ return ""
+
+
+ def help(self, text):
+ self.write(self.render_help(text))
#
# HTML form rendering