Module: check_mk
Branch: master
Commit: 2d59e9fa5d255a8c9176bdafaaed955bec81091f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2d59e9fa5d255a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 5 08:37:39 2013 +0200
Made table search case insensitive
---
web/htdocs/table.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/table.py b/web/htdocs/table.py
index 2fc9cea..07793ef 100644
--- a/web/htdocs/table.py
+++ b/web/htdocs/table.py
@@ -139,14 +139,15 @@ def end():
if 'search' in table_opts:
del table_opts['search'] # persist
- search_term = html.var('_%s_search' % table_id,
table_opts.get('search'))
+ # Search is always lower case -> case insensitive
+ search_term = html.var('_%s_search' % table_id,
table_opts.get('search')).lower()
if search_term:
html.set_var('_%s_search' % table_id, search_term)
table_opts['search'] = search_term # persist
filtered_rows = []
for row, css in rows:
for cell_content, css_classes in row:
- if search_term in cell_content:
+ if search_term in cell_content.lower():
filtered_rows.append((row, css))
break # skip other cells when matched
rows = filtered_rows