27 Commits

Author SHA1 Message Date
lukas 913c7d3a98 Scope URLs to the games namespace 2026-05-12 12:43:08 +02:00
lukas 1a4e51c95a Update NameWithIcon
The `NameWithIcon()` function had a `platform` parameter that was immediately overwritten by `platform = None` and never used (dead code). The function mixed data lookup (database queries via IDs) with rendering, making it untestable.

**Fix**: Refactored `NameWithIcon()` to follow the `LinkedPurchase` pattern — accepts model objects (`Game`, `Session`) instead of IDs. Extracted `_resolve_name_with_icon()` helper for testable computation logic (name resolution, platform extraction, link creation). Fixed bug where `platform` was not extracted when `session` parameter was passed. Removed dead `platform` parameter from the public API. Updated all 3 production call sites (already using model objects). Added 10 unit tests for `_resolve_name_with_icon()` covering session override, custom names, linkify behavior, platform resolution, and edge cases. Updated 6 integration tests to use model-based parameters.
2026-05-12 10:05:15 +02:00
lukas 656a96f55c Fix A() component
Replaced single `url` parameter with explicit `url_name` (URL pattern name resolved via `reverse()`) and `href` (literal path). Fixes:
- Silent fallback (typos like `"ad_puchase"` silently became broken links) → now raises `NoReverseMatch` at render time
- `type(url) is str` gate → removed (implicit dual-mode eliminated entirely)
- Callable parameter (`url: Callable`) dead code → removed
- Implicit dual-mode (`url="name"` vs `url=reverse("name")`) → `url_name` vs `href` are now mutually exclusive params
- Inconsistent type annotation mixing `Callable` with string default → cleaned up
- Added `ValueError` when both `url_name` and `href` are provided
- Updated all 10 call sites across 6 view files and internal callers (`LinkedPurchase()`, `NameWithIcon()`)
2026-05-12 09:01:05 +02:00
lukas 4e3b0ddb08 Allow directly updating device in session list
Django CI/CD / test (push) Successful in 30s
Django CI/CD / build-and-push (push) Successful in 1m12s
2026-05-11 12:54:42 +02:00
lukas a549050860 Make edit_session use the same template as add_session
Django CI/CD / test (push) Successful in 34s
Django CI/CD / build-and-push (push) Successful in 1m36s
2026-05-06 10:43:57 +02:00
lukas 996c0107c9 Housekeeping
* Updated flowbite to 4.x
* Start revamping styles
* Remove unused GraphQL code
* Make some templates more robuts
2026-02-17 22:14:16 +01:00
lukas abdcfdfe64 Redirect to previous page after editing a session
Django CI/CD / test (push) Successful in 1m9s
Django CI/CD / build-and-push (push) Successful in 2m17s
2025-04-01 15:36:40 +02:00
lukas 99f3540825 Improve duration handling for sessions and games 2025-03-25 22:46:01 +01:00
lukas 2d7342c0d5 Fix add/edit session screen
Django CI/CD / test (push) Successful in 1m5s
Django CI/CD / build-and-push (push) Successful in 2m14s
2025-02-08 17:54:03 +01:00
lukas 34148466c7 Improve forms
Django CI/CD / test (push) Successful in 1m17s
Django CI/CD / build-and-push (push) Successful in 2m10s
2025-02-04 20:09:25 +01:00
lukas 6bd8271291 Remove Edition
Django CI/CD / test (push) Failing after 54s
Django CI/CD / build-and-push (push) Has been skipped
2025-01-29 22:05:06 +01:00
lukas ba6028e43d Add emulated property to sessions
Django CI/CD / test (push) Successful in 1m16s
Django CI/CD / build-and-push (push) Has been cancelled
2025-01-29 13:43:35 +01:00
lukas c2853a3ecc purchases can now refer to multiple editions
Django CI/CD / test (push) Successful in 1m3s
Django CI/CD / build-and-push (push) Successful in 2m36s
allows purchases to be for more than one game
2025-01-08 21:00:19 +01:00
lukas 13e607f9a7 Add error handling if no Sessions exist
Django CI/CD / test (push) Successful in 1m12s
Django CI/CD / build-and-push (push) Successful in 2m30s
2024-11-27 18:35:44 +01:00
lukas f61cde180f Pass search_string to search_field.html
Django CI/CD / test (push) Successful in 1m10s
Django CI/CD / build-and-push (push) Successful in 2m1s
2024-11-10 00:05:33 +01:00
lukas 2d3ea714c4 Extend session search 2024-11-09 23:52:09 +01:00
lukas c6b1badf39 add session search
Django CI/CD / test (push) Successful in 1m10s
Django CI/CD / build-and-push (push) Successful in 2m16s
2024-11-09 21:34:01 +00:00
lukas 2ae81bb00f update django-cotton to 1.2.1 2024-10-16 17:49:55 +02:00
lukas b74ccb6eaa Remove extraneous statement 2024-10-16 17:45:23 +02:00
lukas b0b1bb2d42 add icon field to platform, use everywhere 2024-10-16 17:45:23 +02:00
lukas 58cfaca1a9 add table header actions
Django CI/CD / test (push) Successful in 1m3s
Django CI/CD / build-and-push (push) Successful in 2m23s
2024-09-08 21:03:37 +02:00
lukas c1b3493c80 Merge calculated and manual duration
Django CI/CD / test (push) Successful in 1m2s
Django CI/CD / build-and-push (push) Successful in 1m55s
2024-09-07 23:35:59 +02:00
lukas 98c9c1faee move time-related functionality out of views.general
Django CI/CD / test (push) Successful in 58s
Django CI/CD / build-and-push (push) Successful in 1m52s
2024-09-04 21:55:22 +02:00
lukas 4358708262 add links to add a new X to: game, edition, purchase, session, device, platform
Django CI/CD / test (push) Successful in 55s
Django CI/CD / build-and-push (push) Successful in 1m57s
2024-09-03 15:48:58 +02:00
lukas e067e65bce linkify game, edition, purchase, session references
Django CI/CD / test (push) Successful in 1m0s
Django CI/CD / build-and-push (push) Has been cancelled
also add link styles for links in a table row
2024-09-02 20:04:21 +02:00
lukas b8258e2937 replace slippers with django-cotton
Django CI/CD / test (push) Successful in 59s
Django CI/CD / build-and-push (push) Successful in 2m4s
main reason: slippers cannot pass request via context inside its
components, making it annoying to use template takes that take request.
more reasons: not actively worked on, no named slots, having to define
components in components.yaml + new components do not get registered
without restarting server
2024-09-02 17:43:41 +02:00
lukas 2fd44c1f53 separate views out 2/2
Django CI/CD / test (push) Successful in 57s
Django CI/CD / build-and-push (push) Has been skipped
2024-08-12 21:52:26 +02:00