Add category rename and drag-and-drop reordering in edit mode

- Edit toggle behind the "Kategorien" title enables an edit mode.
- In edit mode all category tiles become inline rename fields (no outline,
  distinct background, small margins); articles and "new article" are hidden.
- Rename via PATCH /api/category/:id; reorder via PUT /api/category/order
  (parentId + categoryIds) with SortableJS.
- Only call backend when order actually changed; revert DOM order on error
  so further dragging keeps working.
- Redux: renameCategory + reorderCategories thunks, renameMode state.
This commit is contained in:
seb
2026-08-02 19:43:38 +02:00
parent 5309b1174b
commit 2dd14bac91
7 changed files with 180 additions and 3 deletions

View File

@@ -10,3 +10,15 @@ body {
overscroll-behavior-y: none;
touch-action: manipulation;
}
/* SortableJS: Kategorie-Reorder im Edit-Modus */
.sortable-ghost {
outline: 2px dashed #2e7d32;
outline-offset: 2px;
background-color: rgba(46, 125, 50, 0.12) !important;
}
.sortable-drag {
opacity: 1 !important;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}