From aa1adfa5242c1d41fb7367ee42763918ae0bb9ee Mon Sep 17 00:00:00 2001 From: bloodearnest Date: Mon, 4 Mar 2024 17:19:30 +0000 Subject: [PATCH 1/2] Render csv using plain html templates The slippers table component is very slow, not designed for large data. It invokes a template for every td! This just renders it in html, using similar styles, but is more compact. --- airlock/templates/file_browser/csv.html | 39 ++++++++++++------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/airlock/templates/file_browser/csv.html b/airlock/templates/file_browser/csv.html index f2593558..020a92a0 100644 --- a/airlock/templates/file_browser/csv.html +++ b/airlock/templates/file_browser/csv.html @@ -1,25 +1,22 @@ {% load airlocktags %} {% as_csv_data contents as csv_data %}
- {% #table %} - {% #table_head class="bg-slate-200" id="csvTable" %} - {% #table_row %} - {% for header in csv_data.headers %} - {% #table_header %}{{ header }}{% /table_header %} - {% endfor %} - {% /table_row %} - {% /table_head %} - - {% #table_body %} - {% for row in csv_data.rows %} - {% #table_row class="even:bg-slate-50" %} - {% for cell in row %} - {% #table_cell %} - {{ cell }} - {% /table_cell %} - {% endfor %} - {% /table_row %} + + + + {% for header in csv_data.headers %} + {% endfor %} - {% /table_body %} - {% /table %} - + + + + {% for row in csv_data.rows %} + + {% for cell in row %} + + {% endfor %} + + {% endfor %} + +
{{ header }}
{{ cell }}
+
From ee91ffeff63ab819ce1dd845e24b1c20af15c46c Mon Sep 17 00:00:00 2001 From: bloodearnest Date: Mon, 4 Mar 2024 17:20:38 +0000 Subject: [PATCH 2/2] Make csv table headers sticky --- airlock/templates/file_browser/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airlock/templates/file_browser/index.html b/airlock/templates/file_browser/index.html index ec12387f..a76efb64 100644 --- a/airlock/templates/file_browser/index.html +++ b/airlock/templates/file_browser/index.html @@ -58,6 +58,12 @@ overflow: scroll; } +.datatable thead { + position: sticky; + top: 0; +} + + {% endblock extra_styles %}