03b0885ca5
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
24 lines
690 B
Handlebars
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> |