Module: check_mk
Branch: master
Commit: d125c2e6ae47be1a928f05363be6d96a934d92fb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d125c2e6ae47be…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 17 22:34:35 2012 +0200
Converted layout of global settings to new forms
---
web/htdocs/forms.py | 5 +++--
web/htdocs/wato.css | 48 +++++++++++++++++++-----------------------------
web/htdocs/wato.py | 17 ++++++-----------
3 files changed, 28 insertions(+), 42 deletions(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 3674208..7dde43d 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -116,8 +116,9 @@ def header(title, isopen = True, table_id = ""):
table_id = ''
html.write('<table %s class=nform>' % table_id)
fold_id = strip_bad_chars(title)
- g_section_isopen = html.begin_foldable_container(html.form_name, fold_id, isopen,
title, indent="nform")
- html.write('<tr class=top style="display: %s"><td
colspan=2></td></tr>' % (not isopen and "none" or
""))
+ g_section_isopen = html.begin_foldable_container(
+ html.form_name and html.form_name or "nform", fold_id, isopen,
title, indent="nform")
+ html.write('<tr class=top style="display: %s"><td
colspan=2></td></tr>' % (not g_section_isopen and "none" or
""))
g_header_open = True
g_section_open = False
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index ec67656..4ce7e26 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -751,45 +751,35 @@ div.varname {
}
/* page "global settings*/
-.wato .globalvars {
- background-color: #eeeeee;
- padding: 3px 5px;
- width: 100%;
-}
-
-.wato .globalvars a {
- color: black;
+.wato div.globalvars a {
text-decoration: none;
+ color: black;
}
-.wato .globalvars a:hover {
+
+.wato div.globalvars a:hover {
text-decoration: underline;
}
-.wato .globalvars div.text {
- width: 335px;
- padding-right: 3px;
- overflow: hidden;
-}
-.wato .globalvars td.left {
- width: 339px;
- overflow: hidden;
- white-space: nowrap;
-}
-.wato .globalvars td.right {
- text-align: left;
-}
-.wato .globalvars div.text .dots {
- color: #888;
- overflow: hidden;
+.wato div.globalvars td.content img.iconbutton {
+ width: 60px;
+ height: 16px;
}
-.wato .globalvars td.right img.iconbutton {
- width: auto;
- height: auto;
- margin-left: -3px;
+
+.wato div.globalvars td.legend {
+ padding-top: 0px;
}
+.wato div.globalvars td.legend {
+ width: 350px;
+}
+.wato div.globalvars td.legend div.title {
+ max-width: 350px;
+}
+.wato div.globalvars td {
+ height: 20px;
+}
/* Table in page "Global variables" */
.wato table.data.globalvars {
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 762065d..e087343 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5161,13 +5161,11 @@ def mode_globalvars(phase):
groupnames = g_configvar_groups.keys()
groupnames.sort()
+ html.write('<div class=globalvars>')
for groupname in groupnames:
- # html.begin_foldable_container("globalvars", groupname, False,
groupname, indent=False)
- html.write("<h3>%s</h3>" % groupname)
- html.write('<table class=globalvars>')
+ forms.header(groupname, isopen=False)
for domain, varname, valuespec in g_configvar_groups[groupname]:
- html.write('<tr>')
if domain == "check_mk" and varname not in default_values:
if config.debug:
raise MKGeneralException("The configuration variable
<tt>%s</tt> is unknown to "
@@ -5178,13 +5176,11 @@ def mode_globalvars(phase):
defaultvalue = default_values.get(varname, valuespec.default_value())
edit_url = make_link([("mode", "edit_configvar"),
("varname", varname)])
+ title = '<a href="%s">%s</a>' % (edit_url,
valuespec.title())
+ forms.section(title)
- html.write('<td class=left><div class=text>'
- '<a href="%s">%s</a><span
class=dots>%s</span></div></td>' % (edit_url, valuespec.title(),
- '.' * 100))
toggle_url = make_action_link([("mode", "globalvars"),
("_action", "toggle"), ("_varname",
varname)])
- html.write('<td class=right>')
if varname in current_settings:
if isinstance(valuespec, Checkbox):
html.icon_button(toggle_url, _("Immediately toggle this
setting"),
@@ -5199,9 +5195,8 @@ def mode_globalvars(phase):
else:
html.write('<a href="%s">%s</a>' %
(edit_url, valuespec.value_to_text(defaultvalue)))
- html.write("</td>")
- html.write('</tr>')
- html.write("</table>")
+ forms.end()
+ html.write('</div>')
def mode_edit_configvar(phase):