Files
snap-admin/src/main/resources/templates/snapadmin/fragments/generic_table.html
2023-11-24 16:54:18 +01:00

42 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
<head></head>
<body>
<div th:fragment="table(results)">
<div th:if="${results == null || results.isEmpty()}">
<p class="alert alert-warning">No results.</p>
</div>
<div th:if="${results != null && results.size() > 0}">
<table class="table table-striped align-middle mt-3">
<tr class="table-data-row">
<th th:each="field : ${results.getSortedFields()}">
<div class="m-0 p-0 d-flex justify-content-between">
<div class="column-title">
<span th:if="${field.isPrimaryKey()}">
<i title="Primary Key" class="bi bi-key"></i>
</span>
<span th:if="${field.isForeignKey()}">
<i title="Foreign Key" class="bi bi-link"></i>
</span>
<span class="m-0 p-0" th:text="${field.getName()}"></span>
</div>
</div>
<p class="m-0 p-0 dbfieldtype"><small th:text="${field.getType()}"></small></p>
</th>
</tr>
<th:block th:each="r : ${results.getRows()}">
<tr th:replace="~{snapadmin/fragments/generic_data_row :: data_row(row=${r})}">
</tr>
</th:block>
</table>
</div>
</div>
</body>
</html>