mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-08-10 22:11:13 +00:00
Moving templates in subfolder (#40)
This commit is contained in:
51
src/main/resources/templates/snapadmin/fragments/table.html
Normal file
51
src/main/resources/templates/snapadmin/fragments/table.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
|
||||
<head></head>
|
||||
<body>
|
||||
<div th:fragment="table(results, schema)">
|
||||
<div th:if="${results == null || results.isEmpty()}">
|
||||
<p class="alert alert-warning">This table contains no data.</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 class="row-icons"></th>
|
||||
<th th:each="field : ${schema.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>
|
||||
<th class="table-data-row" th:each="colName : ${schema.getComputedColumnNames()}">
|
||||
<div class="m-0 p-0 d-flex justify-content-between">
|
||||
<div class="column-title">
|
||||
<i title="Primary Key" class="bi bi-cpu"></i>
|
||||
<span class="m-0 p-0" th:text="${colName}"></span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="m-0 p-0 dbfieldtype"><small>COMPUTED</small></p>
|
||||
</th>
|
||||
</tr>
|
||||
<th:block th:each="r : ${results}">
|
||||
<tr th:replace="~{fragments/data_row :: data_row(row=${r}, selectable=${false})}">
|
||||
</tr>
|
||||
</th:block>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user