fix: conflict

This commit is contained in:
Martin Eyben 2024-12-03 17:21:21 +00:00
parent e96ff1621c
commit 5c2132c6f0
3 changed files with 87 additions and 40 deletions

View File

@ -0,0 +1,41 @@
@import url("/static/css/colors.css");
main {
width: 80%;
margin: 0px auto;
}
table {
margin: 5px 0 10px 0;
border-collapse: collapse;
border-radius: 8px;
overflow: hidden;
width: 100%;
}
table a {
text-align: center;
text-decoration: none;
color: white;
}
tr {
background-color: #343c4b;
color: white;
}
table tr:nth-child(2n+1) {
background-color: #1f242d;
}
td,
th {
padding: 6px;
font-size: .9rem;
font-weight: normal;
text-align: center;
}
th {
background-color: #C1292E;
}

View File

@ -9,12 +9,12 @@
</title>
<%- include('partials/links.ejs') %>
<script>
function deletePiece(id) {
function deletePiece(id) {
fetch(window.location + "?id_piece=" + id, {
method: 'DELETE'
}).then(r => window.location.reload());
}
</script>
}
</script>
</head>
<body>
@ -23,32 +23,36 @@ function deletePiece(id) {
<%= box.title %>
</h1>
<pre>
<main>
id : <%= box.id %>
date : <%= box.date %>
modèles :
<% box.models.forEach(function(m) { %>
<li>
<a href="/models/byid/<%=m.id_id_model%>">
<%=m.id_name%>
</a>
</li>
<% }); %>
pièces :
<table>
<thead>
<tr>
<th>Id pièce</th>
<th>Quantité pieces</th>
<th></th>
</tr>
</thead>
<tbody>
<% box.pieces.forEach(function(pair) { %>
<li>
<a href="/pieces/<%=pair.first.id_piece%>">
n°<%=pair.first.id_piece%> en <%=pair.second%> exemplaires
</a>
<p><a href="javascript: deletePiece('<%=pair.first.id_piece%>')">Suppr</a></p>
</li>
<tr>
<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><a href="javascript: deletePiece('<%= pair.first.id_piece %>')"><i class="fa-solid fa-trash"></i></a></td>
</tr>
<% }); %>
</tbody>
</table>
<form>
<label for="numero_piece">Numero Piece</label>
<input type="number" id="numero_piece" name="numero_piece" />
<label for="quantite">Quantité</label>
<input type="number" id="quantite" name="quantite" />
<input type="submit" formmethod="post" value="Ajouter"/>
<input type="submit" formmethod="post" value="Ajouter" />
</form>
</main>
</pre>
</body>

View File

@ -1,3 +1,5 @@
<script src="https://kit.fontawesome.com/62d2ff68ea.js" crossorigin="anonymous"></script>
<link href="/static/css/colors.css" rel="stylesheet" />
<link href="/static/css/header.css" rel="stylesheet" />
<link href="/static/css/table.css" rel="stylesheet" />
<link href="/static/css/reset.css" rel="stylesheet" />