feat(cards): Refactor card styling and implement JS multiselect
Refactors card styling by moving color data to the `CardSet` model, removing the `Card.style` and `Pack.hex_color` fields. - Adds `hex_color` to `CardSet` and a `CardSetColorMapping` model to populate it during import. - Card importer now uses correct filename regexes to identify sets and apply color mappings. - Card badge styling is now derived from the `CardSet`'s color, simplifying the data model. Replaces the old clunky card multiselect with a dynamic Alpine.js component for an improved user experience. - Introduces an API endpoint (`cards/api/search/`) for asynchronous searching. - Provides a modern search-as-you-type interface with a `<noscript>` fallback.
This commit is contained in:
parent
af2f48a491
commit
ecb060af6d
15 changed files with 668 additions and 533 deletions
79
seed/0003_CardSetColorMappings.json
Normal file
79
seed/0003_CardSetColorMappings.json
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
[
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"cardset_id": "A3a",
|
||||
"hex_color": "#FA1A1A",
|
||||
"created_at": "2025-06-20T05:48:33.579Z",
|
||||
"updated_at": "2025-06-20T06:07:05.636Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"cardset_id": "A3",
|
||||
"hex_color": "#0B47C6",
|
||||
"created_at": "2025-06-20T05:49:48.100Z",
|
||||
"updated_at": "2025-06-20T06:06:37.342Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 3,
|
||||
"fields": {
|
||||
"cardset_id": "A2b",
|
||||
"hex_color": "#B3D6EE",
|
||||
"created_at": "2025-06-20T05:57:08.639Z",
|
||||
"updated_at": "2025-06-20T06:06:19.207Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 4,
|
||||
"fields": {
|
||||
"cardset_id": "A2a",
|
||||
"hex_color": "#EA9706",
|
||||
"created_at": "2025-06-20T05:58:45.284Z",
|
||||
"updated_at": "2025-06-20T06:05:40.057Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 5,
|
||||
"fields": {
|
||||
"cardset_id": "A2",
|
||||
"hex_color": "#7A8696",
|
||||
"created_at": "2025-06-20T05:59:26.177Z",
|
||||
"updated_at": "2025-06-20T06:05:23.890Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 6,
|
||||
"fields": {
|
||||
"cardset_id": "A1a",
|
||||
"hex_color": "#31DDAA",
|
||||
"created_at": "2025-06-20T06:01:35.316Z",
|
||||
"updated_at": "2025-06-20T06:05:06.221Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "cards.cardsetcolormapping",
|
||||
"pk": 7,
|
||||
"fields": {
|
||||
"cardset_id": "A1",
|
||||
"hex_color": "#7911F0",
|
||||
"created_at": "2025-06-20T06:03:51.759Z",
|
||||
"updated_at": "2025-06-20T06:04:48.969Z",
|
||||
"deleted_at": null
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue