test/templates/frontend/index.html.twig

42 lines
877 B
Twig
Raw Normal View History

2024-01-18 12:39:10 +00:00
{% extends 'base.html.twig' %}
2024-01-19 07:38:32 +00:00
{% block javascripts %}
<script>
function addPrinterToTable(printer) {
2024-01-18 15:35:37 +00:00
}
2024-01-19 07:38:32 +00:00
function reloadTable() {
fetch('/printer', {method: 'GET'}).then(response => {
response.json().then(json => {
for (printer of json) {
addPrinterToTable(printer);
}
});
});
2024-01-18 15:35:37 +00:00
}
2024-01-19 07:38:32 +00:00
reloadTable();
</script>
{% endblock %}
2024-01-18 15:35:37 +00:00
2024-01-19 07:38:32 +00:00
{% block body %}
2024-01-18 12:39:10 +00:00
<h1>Printers</h1>
<table id="table">
2024-01-18 15:35:37 +00:00
<thead>
2024-01-18 12:39:10 +00:00
<tr>
<th>Name</th>
<th>Price</th>
<th>Build Volume</th>
<th>Max Speed</th>
2024-01-18 15:35:37 +00:00
<th>Actions</th>
2024-01-18 12:39:10 +00:00
</tr>
2024-01-18 15:35:37 +00:00
</thead>
<tbody id="table-body">
</tbody>
2024-01-18 12:39:10 +00:00
</table>
2024-01-18 15:35:37 +00:00
<script>
</script>
2024-01-18 12:39:10 +00:00
{% endblock %}