feat: add possible models by box

This commit is contained in:
Martin Eyben 2024-12-03 20:53:14 +00:00
parent 93604300cb
commit 039f7fbce6

View File

@ -25,26 +25,47 @@
<pre> <pre>
<main> <main>
id : <%= box.id %> id : <%= box.id %>
date : <%= box.date %> date : <%= box.date %>
pièces : <h2>Liste des pièces</h2>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Id pièce</th> <th>Id pièce</th>
<th>Quantité pieces</th> <th>Quantité pieces</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% box.pieces.forEach(function(pair) { %> <% box.pieces.forEach(function(pair) { %>
<tr> <tr>
<td><a href="/pieces/<%=pair.first.id_piece%>"><i class="fa-solid fa-puzzle-piece"></i> <%= pair.first.id_piece%></a></td> <td><a href="/pieces/<%=pair.first.id_piece%>"><i class="fa-solid fa-puzzle-piece"></i> <%= pair.first.id_piece%></a></td>
<td><%= pair.second%></td> <td><%= pair.second%></td>
<td><a href="javascript: deletePiece('<%= pair.first.id_piece %>')"><i class="fa-solid fa-trash"></i></a></td> <td><a href="javascript: deletePiece('<%= pair.first.id_piece %>')"><i class="fa-solid fa-trash"></i></a></td>
</tr> </tr>
<% }); %> <% }); %>
</tbody> </tbody>
</table> </table>
<h2>Liste des modèles constructibles</h2>
<table>
<thead>
<tr>
<th>Id modèle</th>
<th>Nom</th>
<th></th>
</tr>
</thead>
<tbody>
<% box.models.forEach(function(model) { %>
<tr>
<td><%=model.id%></td>
<td><%=model.name%></td>
<td><a href="/models/byname/<%=model.name%>"><i class="fa-solid fa-eye"></i></a></td>
</tr>
<% }); %>
</tbody>
</table>
<h2>Ajouter une pièce</h2>
<form> <form>
<label for="numero_piece">Numero Piece</label> <label for="numero_piece">Numero Piece</label>
<input type="number" id="numero_piece" name="numero_piece" /> <input type="number" id="numero_piece" name="numero_piece" />