Module: check_mk
Branch: master
Commit: dd25d713a39fec3939da79eabc9f4a6ca1b2133b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd25d713a39fec…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 17 23:29:45 2012 +0200
Finalized layout of global settings and rulesets
---
web/htdocs/forms.py | 9 +++++++++
web/htdocs/htmllib.py | 1 +
web/htdocs/pages.css | 4 ++--
web/htdocs/wato.css | 35 ++++++++++++++++++++++++++---------
web/htdocs/wato.py | 23 ++++++++++-------------
5 files changed, 48 insertions(+), 24 deletions(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 7dde43d..484c975 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -122,6 +122,15 @@ def header(title, isopen = True, table_id = ""):
g_header_open = True
g_section_open = False
+# container without legend and content
+def container():
+ global g_section_open
+ if g_section_open:
+ html.write('</td></tr>')
+ html.write('<tr style="display: %s"><td colspan=2
class=container>' %
+ (not g_section_isopen and "none" or ""))
+ g_section_open = True
+
def section(title = None, checkbox = None, id = ""):
global g_section_open
if g_section_open:
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 5bd1612..bfc73eb 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -282,6 +282,7 @@ class html:
def end_form(self):
self.write("</form>\n")
+ self.form_name = None
def form_submitted(self):
return self.has_var("filled_in")
diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css
index f16bbda..1634f97 100644
--- a/web/htdocs/pages.css
+++ b/web/htdocs/pages.css
@@ -544,8 +544,8 @@ table.nform td.legend div.title.withcheckbox {
max-width: 210px;
margin-right: 6px;
}
-table.nform td.legend .dots {
- color: #367;
+table.nform .dots {
+ color: #444;
margin-left: 5px;
}
table.nform td.legend div.checkbox {
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 4ce7e26..21f5b44 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -242,10 +242,11 @@ table.validationerror img {
/* Path to current folder at top of screen */
.wato div.folderpath {
+ margin-top: -5px;
margin-bottom: 8px;
height: 30px;
position: relative;
- left: 3px;
+ left: 4px;
}
.wato div.folderpath ul {
@@ -700,16 +701,20 @@ form#form_timeperiod td.vlof_content {
}
/* page "Rulesets" */
-.wato .rulesets {
- background-color: #eeeeee;
- padding: 3px 5px;
- width: 100%;
- /* box-shadow: 0px 0px 2.5px #888; */
+.wato td.rulesets {
+ padding-left: 0px;
+}
+.wato .rulesets table.nform > tbody > tr > td.container {
+ height: auto;
+}
+div.rulesets table.nform tr.bottom td {
+ height: 5px;
}
.wato .rulesets div.ruleset {
float: left;
- margin-right: 20px;
+ margin-left: 10px;
+ margin-right: 10px;
}
.wato .rulesets div.ruleset div.text {
@@ -728,13 +733,11 @@ form#form_timeperiod td.vlof_content {
white-space: nowrap;
margin-right: 3px;
}
-
.wato .rulesets div.ruleset a:hover {
text-decoration: underline;
}
.wato .rulesets div.ruleset .dots {
- color: #888;
overflow: hidden;
}
@@ -744,6 +747,20 @@ form#form_timeperiod td.vlof_content {
text-align: right;
}
+.wato .rulesets div.ruleset a.nonzero {
+ /* font-weight: bold; */
+}
+.wato .rulesets div.ruleset a.zero {
+}
+
+.wato .rulesets div.ruleset div.rulecount.nonzero {
+ /* font-weight: bold; */
+}
+
+.wato .rulesets div.ruleset div.rulecount.zero {
+ /* color: #444; */
+}
+
/* Page edit_ruleset */
div.varname {
color: white;
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index aeea1db..fab34dc 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9097,6 +9097,7 @@ def mode_rulesets(phase):
do_folding = len(groupnames) > 1
something_shown = False
+ html.write('<div class=rulesets>')
# Loop over all ruleset groups
for groupname in groupnames:
# Show information about a ruleset
@@ -9129,18 +9130,12 @@ def mode_rulesets(phase):
continue
if not title_shown:
- if something_shown:
- html.write("</td></tr></table>")
- # if do_folding:
- # html.end_foldable_container()
if '/' in groupname:
subgroupname = groupname.split("/", 1)[1]
else:
subgroupname = title
- # if do_folding:
- # html.begin_foldable_container("rulesets", groupname,
False, subgroupname, indent=False)
- html.write("<h3>%s</h3>" % subgroupname)
- html.write('<table
class="rulesets"><tr><td>')
+ forms.header(subgroupname)
+ forms.container()
title_shown = True
something_shown = True
@@ -9151,20 +9146,20 @@ def mode_rulesets(phase):
view_url = make_link(url_vars)
html.write('<div class=ruleset><div class=text>')
- html.write('<a class=title><a
href="%s">%s</a>' % (view_url, rulespec["title"]))
+ html.write('<a class="%s"
href="%s">%s</a>' %
+ (num_rules and "nonzero" or "zero", view_url,
rulespec["title"]))
html.write('<span class=dots>%s</span></div>' %
("." * 100))
if num_local_rules:
if only_host:
title = _("There are %d rules explicitely listing this
host." % num_local_rules)
else:
title = _("There are %d rules defined in the current
folder." % num_local_rules)
- html.write('<div class=rulecount
title="%s">%d</div>' % (title, num_rules))
+ html.write('<div class="rulecount %s"
title="%s">%d</div>' %
+ (num_rules and "nonzero" or "zero", title,
num_rules))
html.write('</div>')
if something_shown:
- html.write("</td></tr></table>")
- # if do_folding:
- # html.end_foldable_container()
+ forms.end()
else:
if only_host:
@@ -9172,6 +9167,8 @@ def mode_rulesets(phase):
else:
html.write("<div class=info>" + _("There are no rules
defined in this folder.") + "</div>")
+ html.write('</div>')
+
def create_new_rule_form(rulespec, hostname = None, item = None):
html.begin_form("new_rule")
html.write(_("Create a new rule: "))