swipe, zoeken op producten, beter toevoegen in lijsten
This commit is contained in:
@@ -4,12 +4,30 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row g-3 mb-4" data-product-filter>
|
||||
<div class="col-md-8">
|
||||
<label class="form-label" for="favorite-search">Zoek op naam</label>
|
||||
<input id="favorite-search" class="form-control" type="search" placeholder="Bijv. melk" data-product-search>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label" for="favorite-category-filter">Filter op categorie</label>
|
||||
<select id="favorite-category-filter" class="form-select" data-product-category>
|
||||
<option value="">Alle categorieën</option>
|
||||
<% (categories || []).forEach(category => { %>
|
||||
<option value="<%= category.id %>"><%= category.icon || "" %> <%= category.name %></option>
|
||||
<% }); %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% if (favorites.length === 0) { %>
|
||||
<p class="text-secondary">Je hebt nog geen favoriete producten.</p>
|
||||
<% } else { %>
|
||||
<div class="list-group">
|
||||
<div class="list-group" data-product-list>
|
||||
<% favorites.forEach(product => { %>
|
||||
<div class="list-group-item d-flex justify-content-between align-items-center gap-3">
|
||||
<div class="list-group-item d-flex justify-content-between align-items-center gap-3"
|
||||
data-product-row
|
||||
data-product-name="<%= product.name.toLowerCase() %>"
|
||||
data-product-category="<%= product.category_id || '' %>">
|
||||
<div>
|
||||
<strong><%= product.category_icon || "" %> <%= product.name %></strong>
|
||||
<div class="text-secondary"><%= product.category_name || "Geen categorie" %></div>
|
||||
@@ -21,6 +39,7 @@
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
<p class="text-secondary mt-3 d-none" data-product-empty>Geen favorieten gevonden.</p>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user