Module: check_mk
Branch: master
Commit: 5833c83cd4bb7fa0c18ef5bb8822d7374c8ae430
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5833c83cd4bb7f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 10 15:21:28 2011 +0200
New config variable filter_columns (default is 2)
---
ChangeLog | 1 +
web/htdocs/config.py | 3 +++
web/htdocs/views.py | 7 ++++---
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 194d0db..abecf8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* Added snmp_uptime, uptime and printer_supply perfometers
* Allow for displaying service data in host tables
* View editor foldable states are now permament per user
+ * New config variable filter_columns (default is 2)
BI:
* Added new component BI to Multisite.
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 1fdce0c..226b642 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -438,6 +438,9 @@ start_url = "main.py"
# Timeout for rescheduling of host- and servicechecks
reschedule_timeout = 10.0
+# Number of columsn in "Filter" form
+filter_columns = 2
+
# __ ___ _____ ___
# \ \ / / \|_ _/ _ \
# \ \ /\ / / _ \ | || | | |
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 45dc34b..11bb7f8 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -101,6 +101,7 @@ def show_filter_form(is_open, filters):
html.write("<div class=whiteborder>\n")
html.write("<table class=\"form\">\n")
+
# sort filters according to title
s = [(f.sort_index, f.title, f) for f in filters]
s.sort()
@@ -112,12 +113,12 @@ def show_filter_form(is_open, filters):
html.write("<td class=content>")
f.display()
html.write("</td>")
- if col == 1:
+ if col == config.filter_columns - 1:
html.write("</tr>\n")
- col = (col + 1) % 2
+ col = (col + 1) % config.filter_columns
if col == 1:
html.write("<td class=legend></td>\n<td
class=content></td></tr>\n")
- html.write('<tr><td class="legend button" colspan=4>')
+ html.write('<tr><td class="legend button" colspan=%d>'
% (config.filter_columns * 2))
html.button("search", "Search", "submit")
html.write("</td></tr>\n")
html.write("</table>\n")