-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from opensafely-core/fast-csv
Faster csv rendering
- Loading branch information
Showing
2 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
{% load airlocktags %} | ||
{% as_csv_data contents as csv_data %} | ||
<div class="inline-block min-w-full align-middle max-w-full"> | ||
{% #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 %} | ||
<table class="datatable"> | ||
<thead class="bg-slate-200" id="csvTable"> | ||
<tr> | ||
{% for header in csv_data.headers %} | ||
<th>{{ header }}</th> | ||
{% endfor %} | ||
{% /table_body %} | ||
{% /table %} | ||
</div> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in csv_data.rows %} | ||
<tr class="even:bg-slate-50"> | ||
{% for cell in row %} | ||
<td>{{ cell }}</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters