Add support for item categories in registries
Introduced `RegistryItemCategory` entity for grouping and ordering items within registries. Updated `RegistryItem` and `Registry` entities to support categorization. Added database migrations for `RegistryItemCategories` and updated `RegistryItems` with `CategoryId` and `SortOrder`. Implemented drag-and-drop functionality for reordering categories and items using JavaScript and Blazor. Enhanced `RegistryAdmin` and `RegistryPublic` components to manage and display categories with collapsible sections. Updated `RegistryService` to handle category operations, including adding, renaming, removing, and reordering. Added new view models and updated CSS for category styling. Refactored logic to ensure proper ordering and fallback for unassigned items.
This commit is contained in:
@@ -158,3 +158,61 @@ h3 {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Category grouping and drag-drop */
|
||||
.category-groups {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.category-group {
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.category-group .card-header {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.category-group [draggable="true"] {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.category-group tbody tr[draggable="true"]:active {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* Drop indicators */
|
||||
.category-group.drop-target-category {
|
||||
border-color: #0d6efd;
|
||||
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
|
||||
}
|
||||
|
||||
.drop-target-category-before {
|
||||
box-shadow: inset 0 3px 0 #0d6efd;
|
||||
}
|
||||
|
||||
.drop-target-category-after {
|
||||
box-shadow: inset 0 -3px 0 #0d6efd;
|
||||
}
|
||||
|
||||
.drop-target-item-end {
|
||||
border-bottom: 3px solid #0d6efd;
|
||||
}
|
||||
|
||||
.table tbody tr.drop-target-item-before {
|
||||
box-shadow: inset 0 3px 0 #0d6efd;
|
||||
}
|
||||
|
||||
.table tbody tr.drop-target-item-after {
|
||||
box-shadow: inset 0 -3px 0 #0d6efd;
|
||||
}
|
||||
|
||||
.category-list-end-drop-zone {
|
||||
min-height: 18px;
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.category-list-end-drop-zone.drop-target-category-list-end {
|
||||
box-shadow: inset 0 -3px 0 #0d6efd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user