Files
sqlpage--sqlpage/sqlpage/templates/csv.handlebars
T
lovasoa 03b0885ca5 inline svg icons in the SQLPage binary
icons are now loaded directly from the sqlpage binary instead of loading them from a CDN

This makes it possible to host a SQLPage website on an intranet without access to the internet.

Fixes https://github.com/lovasoa/SQLpage/issues/37
2023-08-02 16:20:11 +02:00

24 lines
690 B
Handlebars

<div class="my-2">
<a href="data:text/csv;charset=UTF-8,
{{~#each_row~}}
{{~#if (eq @row_index 0)~}}{{! header }}
{{~#each this~}}
%22{{! %22 = double-quote}}
{{~@key~}}
%22
{{~default ../separator ","~}}
{{~/each~}}
%0A{{! %0A = newline}}
{{~/if~}}
{{~#each this~}}
%22{{this}}%22{{default ../separator ","}}
{{~/each~}}
%0A
{{~/each_row~}}
"
download="{{default filename title}}.csv"
class="btn btn-{{default color "primary"}}">
{{~icon_img (default icon "download")~}}
{{default title "Download"}}
</a>
</div>