Module: check_mk
Branch: master
Commit: f26d9330aa9fa368d6bbafcd948a5485d62b5907
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f26d9330aa9fa3…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Tue Jan 10 16:01:48 2017 +0100
Refactoring table.py: Moved out _write_table.
Change-Id: I47775cbf21c6cd81fd8a23904f65619b31837f23
---
web/htdocs/table.py | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/web/htdocs/table.py b/web/htdocs/table.py
index b70c25f..d558a15 100644
--- a/web/htdocs/table.py
+++ b/web/htdocs/table.py
@@ -225,6 +225,23 @@ def end():
if limit is not None:
rows = rows[:limit]
+ # Render header
+ _write_table(table, rows, actions_enabled, actions_visible, search_term)
+
+ if limit is not None and num_rows_unlimited > limit:
+ html.message(_('This table is limited to show only %d of %d rows. '
+ 'Click <a href="%s">here</a> to disable
the limitation.') %
+ (limit, num_rows_unlimited, html.makeuri([('limit',
'none')])))
+
+ if actions_enabled:
+ config.user.save_file("tableoptions", user_opts)
+ table = None
+
+
+def _write_table(table, rows, actions_enabled, actions_visible, search_term):
+
+ table_id = table["id"]
+
html.write('<table class="data oddeven')
if "css" in table:
html.write(" %s" % table["css"])
@@ -288,15 +305,6 @@ def end():
html.write("</table>\n")
- if limit is not None and num_rows_unlimited > limit:
- html.message(_('This table is limited to show only %d of %d rows. '
- 'Click <a href="%s">here</a> to disable
the limitation.') %
- (limit, num_rows_unlimited, html.makeuri([('limit',
'none')])))
-
- if actions_enabled:
- config.user.save_file("tableoptions", user_opts)
- table = None
-
def _write_csv(table, csv_separator):
@@ -322,6 +330,7 @@ def _write_csv(table, csv_separator):
html.write("\n")
+
def _render_headers(table, actions_enabled, actions_visible):
if table["omit_headers"]:
return