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

View File

@ -13,6 +13,8 @@
<body> <body>
<%- include('partials/header.ejs') %> <%- include('partials/header.ejs') %>
<main>
<h1> <h1>
<%= member.name %> <%= member.name %>
</h1> </h1>
@ -23,21 +25,34 @@
<pre> <pre>
id: <%= member.id_member%> id: <%= member.id_member%>
name: <%= member.name%> name: <%= member.name%>
</pre> </pre>
<h2>Liste des modèles faisable</h2> <h2>Liste des modèles faisables</h2>
<ul> <table>
<% models.forEach(function(model) { %> <thead>
<li> <tr>
<a href="/models/byid/<%=model.id%>"> <th>Id modèle</th>
<%=model.name%> <th>Nom modèle</th>
</a> <th>Proposé par</th>
</li> <th></th>
<% }); %> </tr>
</ul> </thead>
<tbody>
<% models.forEach(function(model) { %>
<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> </html>