fix(admin): delete feedback alerts + informative block errors (issue #127)
- locations/categories GET pass req.query.error/success to views
- locations/categories EJS render dismissible error/success alerts (modeled on catalog.ejs)
- Delete errors include blocking counts + 'Remove X first' hints
- 🔒 lock hint on rows with linked categories/products/subcategories
- 18 new tests (adminDeleteFeedback.test.js); 48 total pass
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
<% if (error) { %>
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<%= error %>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (success) { %>
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<%= success %>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
<% } %>
|
||||
<a href="/catalog" class="btn btn-sm btn-outline-secondary mb-2">« Back to Catalog</a>
|
||||
<div class="panel panel-icon mb-3">
|
||||
<div class="panel-hdr">
|
||||
@@ -71,6 +83,9 @@
|
||||
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
||||
<button class="btn btn-sm btn-danger">Delete</button>
|
||||
</form>
|
||||
<% if (l.category_count > 0 || l.product_count > 0) { %>
|
||||
<span class="text-warning" title="Blocks deletion">🔒</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% }); %>
|
||||
|
||||
Reference in New Issue
Block a user