Files
sqlpage--sqlpage/sqlpage/templates/table.handlebars
T
2023-08-23 02:19:09 +02:00

52 lines
2.3 KiB
Handlebars

<div class="card my-2">
<div class="card-body">
<div class="table-responsive {{#if (or sort search)}}data-list{{/if}}">
{{#if search}}
<div class="p-2">
<input type="search" class="form-control form-control-rounded fs-6 search" placeholder="Search…">
</div>
{{/if}}
<table class="table">
{{#each_row}}
{{#if (eq @row_index 0)}}
<thead>
<tr>
{{#each this}}
{{#if (not (starts_with @key '_sqlpage_'))}}
<th>
{{~#if ../../sort~}}
<button class="table-sort sort" data-sort="{{@key}}">{{@key}}</button>
{{~else~}}
{{~@key~}}
{{~/if~}}
</th>
{{/if}}
{{/each}}
</tr>
</thead>
<tbody class="table-tbody list">{{#delay}}</tbody>{{/delay}}
{{/if}}
<tr class="{{_sqlpage_css_class}} {{#if _sqlpage_color}}bg-{{_sqlpage_color}}-lt{{/if}}">
{{~#each this~}}
{{~#if (not (starts_with @key '_sqlpage_'))~}}
<td class="{{@key}} align-middle">
{{~#if (array_contains ../../markdown @key)~}}
{{{markdown this}}}
{{~else~}}
{{~#if (array_contains ../../icon @key)~}}
{{~icon_img this~}}
{{~else~}}
{{this}}
{{~/if~}}
{{~/if~}}
</td>
{{~/if~}}
{{~/each~}}
</tr>
{{/each_row}}
{{flush_delayed}}
</table>
</div>
</div>
</div>