merge : adding more sets for a member.
This commit is contained in:
commit
db885f8277
@ -9,27 +9,30 @@
|
|||||||
</title>
|
</title>
|
||||||
|
|
||||||
<%- include('partials/links.ejs') %>
|
<%- include('partials/links.ejs') %>
|
||||||
<style>
|
<style>
|
||||||
#box-register-form {
|
#box-register-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
max-width: max(30vw, 60ch);
|
max-width: max(30vw, 60ch);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
|
||||||
|
|
||||||
#box-register-form select, #box-register-form input {
|
|
||||||
padding: .5rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
i { color: var(--bg); }
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function removeBox(id) {
|
|
||||||
fetch(window.location.origin + '/boxes/' + id + '/' + <%= member.id_member%>, { method: 'DELETE' }).then(r => window.location.reload());
|
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
#box-register-form select,
|
||||||
|
#box-register-form input {
|
||||||
|
padding: .5rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: var(--bg);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function removeBox(id) {
|
||||||
|
fetch(window.location.origin + '/boxes/' + id + '/' + <%= member.id_member %>, {method: 'DELETE'}).then(r => window.location.reload());
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -49,25 +52,28 @@
|
|||||||
name: <%= member.name%>
|
name: <%= member.name%>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h2>Liste des boites enregistrées</h2>
|
|
||||||
|
|
||||||
|
<h2>Enregistrer une boite</h2>
|
||||||
<form name="title" action="/boxes/register" id="box-register-form" method="POST">
|
<form name="title" action="/boxes/register" id="box-register-form" method="POST">
|
||||||
<input type="hidden" name="id_member" id="id_member" value="<%= member.id_member %>">
|
<input type="hidden" name="id_member" id="id_member" value="<%= member.id_member %>">
|
||||||
|
|
||||||
<label for="id_box">id de la boite</label>
|
<label for="id_box">Nom de la boite</label>
|
||||||
<select name="id_box" id="id_box">
|
<select name="id_box" id="id_box">
|
||||||
|
|
||||||
<% allboxes.forEach(function(box) { %>
|
<% allboxes.forEach(function(box) { %>
|
||||||
<option value="<%=box.id%>"><%=box.id%></option>
|
<option value="<%=box.id%>">
|
||||||
|
<%=box.title%>
|
||||||
|
</option>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<label for="quantity">Quantité</label>
|
<label for="quantity">Quantité</label>
|
||||||
<input type="number" name="quantity" min="0" step="1" id="quantity">
|
<input type="number" name="quantity" min="1" step="1" id="quantity" value="1">
|
||||||
|
|
||||||
<input type="submit" value="Ajouter">
|
<input type="submit" value="Ajouter">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<h2>Liste des boites enregistrées</h2>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
@ -168,19 +174,26 @@
|
|||||||
<td>
|
<td>
|
||||||
<%=model.name%>
|
<%=model.name%>
|
||||||
</td>
|
</td>
|
||||||
<td><a href="/membres/byid/<%=model.creator%>"><i class="fa-solid fa-user"></i>
|
<% if (model.creator===undefined) {%>
|
||||||
<%=model.creator%>
|
|
||||||
|
<td></td>
|
||||||
|
<% } else {%>
|
||||||
|
<td><a href="/membres/byid/<%=model.creator.id_member%>"><i class="fa-solid fa-user"></i>
|
||||||
|
<%=model.creator.name%>
|
||||||
</a></td>
|
</a></td>
|
||||||
|
<% } %>
|
||||||
<td><a href="/models/byname/<%=model.name%>"><i class="fa-solid fa-eye"></i></a></td>
|
<td><a href="/models/byname/<%=model.name%>"><i class="fa-solid fa-eye"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="box"></div>
|
<div class="box"></div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
id : <%= model.id %>
|
id : <%= model.id %>
|
||||||
url : <%= model.url %>
|
url : <%= model.url %>
|
||||||
creator : <%= model.creator.name %>
|
creator : <%- model.creator !== undefined ? model.creator.name : 'system' %>
|
||||||
inheritFrom : <%= model.inheritFrom %>
|
inheritFrom : <%= model.inheritFrom %>
|
||||||
<h2>Liste des pièces nécessaires</h2>
|
<h2>Liste des pièces nécessaires</h2>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user