53 lines
2.1 KiB
Plaintext
53 lines
2.1 KiB
Plaintext
<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>
|