feat: more css

This commit is contained in:
Martin Eyben 2024-12-03 18:20:51 +00:00
parent ff4179c283
commit ee79781fb2
2 changed files with 74 additions and 38 deletions

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -9,8 +10,10 @@
<%- include('partials/links.ejs') %>
</head>
<body>
<%- include('partials/header.ejs') %>
<main>
<h1>
Liste des boîtes
@ -19,10 +22,9 @@
<div class="fromDate">
<label for="fromDate">À partir de : </label>
<input type="date" name="fromDate" id="fromDate">
<input type="submit" value="Filtrer" onclick="window.location.pathname = '/boxes/from/' + document.getElementById('fromDate').value;">
<span>Nombre moyen de pièces : <%-
boxes.map(
(b) => b.pieces.reduce(
<input type="submit" value="Filtrer"
onclick="window.location.pathname = '/boxes/from/' + document.getElementById('fromDate').value;">
<span>Nombre moyen de pièces : <%- boxes.map( (b)=> b.pieces.reduce(
(p, q) => p + q.second, 0
)
).reduce((i, j) => i + j, 0) / boxes.length%></span>
@ -30,16 +32,35 @@
<hr>
<ul>
<table>
<thead>
<tr>
<th>Id</th>
<th>Nom</th>
<th>Nombre de pièces</th>
<th>Date création</th>
<th></th>
</tr>
</thead>
<tbody>
<% boxes.forEach(function(box) { %>
<li>
<a href="/boxes/<%=box.title%>">
<%=box.title%>
</a>
</li>
<% }); %>
</ul>
<tr>
<td><%=box.id%></td>
<td><%=box.title%></td>
<td><%- box.pieces.reduce(
(p,q) => p + q.second, 0
)
-%></td>
<td><%=box.date.toLocaleDateString()%></td>
<td><a href="/boxes/byid/<%=box.id%>"><i class="fa-solid fa-eye"></i></a></td>
</tr>
<% }); %>
</tbody>
</table>
</main>
</body>
</html>

View File

@ -13,6 +13,8 @@
<body>
<%- include('partials/header.ejs') %>
<main>
<h1>
<%= member.name %>
</h1>
@ -26,18 +28,31 @@
name: <%= member.name%>
</pre>
<h2>Liste des modèles faisable</h2>
<h2>Liste des modèles faisables</h2>
<ul>
<table>
<thead>
<tr>
<th>Id modèle</th>
<th>Nom modèle</th>
<th>Proposé par</th>
<th></th>
</tr>
</thead>
<tbody>
<% models.forEach(function(model) { %>
<li>
<a href="/models/byid/<%=model.id%>">
<%=model.name%>
</a>
</li>
<% }); %>
</ul>
<tr>
<td><%=model.id%></td>
<td><%=model.name%></td>
<td><a href="/membres/byid/<%=model.creator%>"><i class="fa-solid fa-user"></i> <%=model.creator%></a></td>
<td><a href="/models/byname/<%=model.name%>"><i class="fa-solid fa-eye"></i></a></td>
</tr>
</body>
<% }); %>
</tbody>
</table>
</body>
</main>
</html>