test/templates/frontend/index.html.twig
2024-01-19 08:38:32 +01:00

42 lines
877 B
Twig

{% extends 'base.html.twig' %}
{% block javascripts %}
<script>
function addPrinterToTable(printer) {
}
function reloadTable() {
fetch('/printer', {method: 'GET'}).then(response => {
response.json().then(json => {
for (printer of json) {
addPrinterToTable(printer);
}
});
});
}
reloadTable();
</script>
{% endblock %}
{% block body %}
<h1>Printers</h1>
<table id="table">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Build Volume</th>
<th>Max Speed</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
<script>
</script>
{% endblock %}