Module: check_mk
Branch: master
Commit: 979ec47a0260432733a0379b230e2ef47f6e4eee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=979ec47a026043…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 16 16:19:38 2012 +0100
Forms: switch to hoverable help
---
web/htdocs/forms.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index c39dc64..8775414 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -27,7 +27,7 @@
from lib import *
-def edit_dictionary(entries, value, focus=None):
+def edit_dictionary(entries, value, focus=None, hover_help=True):
new_value = value.copy()
if html.check_transaction():
messages = []
@@ -48,8 +48,12 @@ def edit_dictionary(entries, value, focus=None):
html.write("<table class=form>\n")
first = True
for name, vs in entries:
- html.write("<tr><td class=legend>%s" % vs.title())
- if vs.help():
+
+ html.write("<tr><td ")
+ if vs.help() and hover_help:
+ html.write('title="%s" ' %
vs.help().replace('"', """))
+ html.write("class=legend>%s" % vs.title())
+ if vs.help() and not hover_help:
html.write("<br><i>%s</i>" % vs.help())
html.write("</td><td class=content>")
if name in value: