refactor: spaces page header with greeting and handler-computed total
Why: Move per-page balance summation out of the template (business logic belongs in the handler) and dedupe the pluralised summary copy while preserving the styled dollar span. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4d5a3276de
commit
0e3b8159ff
2 changed files with 35 additions and 7 deletions
|
|
@ -50,7 +50,13 @@ func (h *spaceHandler) SpacesPage(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
cards := h.buildSpaceCards(spaces)
|
||||
ui.Render(w, r, pages.Spaces(cards))
|
||||
|
||||
total := decimal.Zero
|
||||
for _, c := range cards {
|
||||
total = total.Add(c.TotalBalance)
|
||||
}
|
||||
|
||||
ui.Render(w, r, pages.Spaces(cards, total))
|
||||
}
|
||||
|
||||
func (h *spaceHandler) SharedSpacesPage(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue