coreui-form
Version:
35 lines (33 loc) • 1.27 kB
HTML
<% if (readonly) { %>
<table class="coreui-form__field-dataset-container" <% if (rows.length == 0) { %> style="display:none"<% } %>>
<thead>
<tr>
<% $.each(headers, function(key, item) { %>
<td class="text-muted pe-2"><small><%= item.title %></small></td>
<% }); %>
</tr>
</thead>
<tbody class="coreui-form__field-dataset-list">
<% $.each(rows, function(key, row) { %>
<%- row %>
<% }); %>
</tbody>
</table>
<% } else { %>
<table class="coreui-form__field-dataset-container" <% if (rows.length == 0) { %> style="display:none"<% } %>>
<thead>
<tr>
<% $.each(headers, function(key, item) { %>
<td class="text-muted"><small><%= item.title %></small></td>
<% }); %>
<td></td>
</tr>
</thead>
<tbody class="coreui-form__field-dataset-list">
<% $.each(rows, function(key, row) { %>
<%- row %>
<% }); %>
</tbody>
</table>
<button type="button" class="btn btn-link btn-dataset-add"><%= lang.dataset_add %></button>
<% } %>