Versie 1.0
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<div class="page-header mb-4">
|
||||
|
||||
<h1>Categorie wijzigen</h1>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Categoriegegevens</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="category-edit-form" method="post" action="/categories/<%= category.id %>">
|
||||
<label class="form-label" for="category-name">Naam</label>
|
||||
<input id="category-name" class="form-control mb-3" type="text" name="name"
|
||||
value="<%= category.name %>" maxlength="80" required>
|
||||
|
||||
<label class="form-label" for="category-icon">Icoon</label>
|
||||
<input id="category-icon" class="form-control mb-4" type="text" name="icon"
|
||||
value="<%= category.icon || "" %>" maxlength="8">
|
||||
</form>
|
||||
|
||||
<div class="product-actions">
|
||||
<button class="btn btn-primary" type="submit" form="category-edit-form">Wijzigingen opslaan</button>
|
||||
<form method="post" action="/categories/<%= category.id %>/delete"
|
||||
onsubmit="return confirm('Weet je zeker dat je deze categorie wilt verwijderen?');">
|
||||
<button class="btn btn-outline-danger" type="submit">Categorie verwijderen</button>
|
||||
</form>
|
||||
<a class="btn btn-link" href="/categories">Annuleren</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<div class="page-header mb-4">
|
||||
|
||||
<h1>🏷️ Categorieën</h1>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title">Categorieën beheren</h2>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<% if (categories.length === 0) { %>
|
||||
<div class="list-group-item text-secondary">Nog geen categorieën.</div>
|
||||
<% } %>
|
||||
<% categories.forEach(category => { %>
|
||||
<div class="list-group-item">
|
||||
<div class="d-flex align-items-start justify-content-between gap-3">
|
||||
<div>
|
||||
<strong><%= category.icon || "" %> <%= category.name %></strong>
|
||||
<div class="text-secondary"><%= category.product_count %> product(en)</div>
|
||||
</div>
|
||||
<a class="btn btn-sm btn-outline-primary" href="/categories/<%= category.id %>/edit">
|
||||
Wijzigen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h2 class="card-title">Nieuwe categorie</h2></div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="/categories">
|
||||
<label class="form-label" for="category-name">Naam</label>
|
||||
<input id="category-name" class="form-control mb-3" type="text" name="name"
|
||||
placeholder="bijv. Zuivel" maxlength="80" required>
|
||||
|
||||
<label class="form-label" for="category-icon">Icoon</label>
|
||||
<input id="category-icon" class="form-control mb-3" type="text" name="icon"
|
||||
placeholder="bijv. 🥛" maxlength="8">
|
||||
|
||||
<button class="btn btn-primary w-100" type="submit">Categorie toevoegen</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user