feat(go): M6.6.1 — QR payment popup modal on /adults and /juniors #33

Merged
kacerr merged 1 commits from feat/go-m6-6-1-payment-qr-modal into main 2026-05-08 14:54:24 +02:00
Owner

Summary

  • Replace bare <a href=/qr> Pay/Pay-All links with <button type="button" class="pay-btn" data-*> elements on /adults and /juniors
  • Add #qrModal markup to both templates; toggled via .active class (same convention as #memberModal from M6.5)
  • New payment-qr.js IIFE module: event-delegated click on .pay-btn, builds SPD message (Name: MM/YYYY), sets #qrImg.src to /qr?…, opens modal; Esc closes it; coexists with member-detail.js
  • Add #qrModal { display:none; } + .active { display:flex; } CSS rules (content rules were already present from M6.1)
  • Remove dead qrHref/qrHrefAll template helpers from render.go
  • Markup tests in html_handler_test.go: assert modal IDs, script tag, data-bank-account, no bare href=/qr

Test plan

  • make go-build go-test go-lint — all green
  • Browser on :8080/adults: click Pay → #qrModal opens with title, account, amount, message, QR image; tab stays on /adults
  • Click Pay All → modal shows +-joined MM/YYYY+MM/YYYY message
  • Outside-click and [close] and Esc close the modal
  • /juniors same checks; member-detail [i] modal still works alongside
  • Scan QR with Czech banking app — SPD*1.0*ACC:… payload correct

🤖 Generated with Claude Code

## Summary - Replace bare `<a href=/qr>` Pay/Pay-All links with `<button type="button" class="pay-btn" data-*>` elements on `/adults` and `/juniors` - Add `#qrModal` markup to both templates; toggled via `.active` class (same convention as `#memberModal` from M6.5) - New `payment-qr.js` IIFE module: event-delegated click on `.pay-btn`, builds SPD message (`Name: MM/YYYY`), sets `#qrImg.src` to `/qr?…`, opens modal; Esc closes it; coexists with `member-detail.js` - Add `#qrModal { display:none; }` + `.active { display:flex; }` CSS rules (content rules were already present from M6.1) - Remove dead `qrHref`/`qrHrefAll` template helpers from `render.go` - Markup tests in `html_handler_test.go`: assert modal IDs, script tag, `data-bank-account`, no bare `href=/qr` ## Test plan - [ ] `make go-build go-test go-lint` — all green ✅ - [ ] Browser on `:8080/adults`: click Pay → `#qrModal` opens with title, account, amount, message, QR image; tab stays on `/adults` - [ ] Click `Pay All` → modal shows `+`-joined `MM/YYYY+MM/YYYY` message - [ ] Outside-click and `[close]` and Esc close the modal - [ ] `/juniors` same checks; member-detail `[i]` modal still works alongside - [ ] Scan QR with Czech banking app — `SPD*1.0*ACC:…` payload correct 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr added 2 commits 2026-05-08 14:49:53 +02:00
feat(go): M6.6 — /qr, /sync-bank, /flush-cache, /version pages
All checks were successful
Deploy to K8s / deploy (push) Successful in 8s
fe935235e8
- GET /qr: Czech QR Platba PNG; ports Python qr_code() exactly
  (account validation, amount clamping, * stripping, SPD format)
- GET /sync-bank: Fio sync → infer → cache flush with captured log
- GET+POST /flush-cache: form + action, shows deleted count
- GET /version: JSON alias of /api/version (Python parity)
- FlushCache() added to membership.Sources; wired through api.Handler
- web.ActionHandlers{BankSync} closure-based dep injection for sync
- New dep: github.com/skip2/go-qrcode
- TestQRBuildSPD (9 cases), TestServeQR, TestServeFlushCache{GET,POST},
  TestServeSync, TestServeVersion added

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
feat(go): M6.6.1 — QR payment popup modal on /adults and /juniors
All checks were successful
Deploy to K8s / deploy (push) Successful in 9s
919845518c
Replace bare <a href=/qr> Pay buttons with <button data-*> elements that
open an in-page #qrModal (matching Python's showPayQR UX), driven by a
new payment-qr.js vanilla-JS IIFE module.  Remove the now-dead qrHref /
qrHrefAll template helpers from render.go.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
kacerr merged commit 4276d7b915 into main 2026-05-08 14:54:24 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kacerr/fuj-management#33