Module: check_mk
Branch: master
Commit: 2925a1f533cc178f90780d0002fcaebd33c462a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2925a1f533cc17…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 16 16:03:02 2011 +0200
Multisite: improve layout of filters
---
web/plugins/views/filters.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 6bb8060..ab0c318 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -380,7 +380,8 @@ class FilterTime(Filter):
html.write("<nobr>")
html.number_input(htmlvar, 0, 2)
html.write(" %s</nobr> " % n)
- html.write("<br>\n")
+ if config.filter_columns > 1:
+ html.write("<br>\n")
current = html.var(self.name, "since")
for t in [ "before", "since" ]:
html.radiobutton(self.name, t, current == t, t + " ")
@@ -457,6 +458,10 @@ class FilterLogClass(Filter):
else:
defval = "on"
html.write("<table cellspacing=0 cellpadding=0>")
+ if config.filter_columns == 1:
+ num_cols = 4
+ else:
+ num_cols = 2
col = 1
for l, c in self.log_classes:
if col == 1:
@@ -465,12 +470,12 @@ class FilterLogClass(Filter):
html.checkbox("logclass%d" % l, defval)
html.write(c)
html.write("</td>")
- if col == 2:
+ if col == num_cols:
html.write("</tr>\n")
col = 1
else:
col += 1
- if col == 1:
+ if col < num_cols:
html.write("<td></td></tr>")
html.write("</table>\n")