Follow-up of avatharbe/bbAccounts-dev#83. Adds the second render mode envisioned in avatharbe/bbAccounts-dev#79 surface 4 (leaderboard) on top of the own-balance variant that shipped with avatharbe/bbAccounts-dev#83.
Scope
Per portal block instance, an admin chooses:
- the account_id whose balances to surface
- N (top-N members)
Block renders the top-N subledger balances on that account, descending by closing balance. Visible to all viewers; the data is whatever the admin chose to make public.
Per-instance config
bbGuild already has `bb_portal_config` for per-module-id key/value config. The leaderboard mode persists `account_id` and `top_n` there, edited via the bbGuild ACP portal screen's module-config form.
The own-balance mode (shipped) needs no config — keep it as the default. Adding leaderboard means the module's `get_template_acp()` returns a mode picker (own-balance / leaderboard) plus, when leaderboard is selected, an account_id dropdown and a top_n integer.
Files
- `portal/module/bbaccounts_balance.php` — extend `prepare_template()` to branch on the configured mode; add `get_template_acp()`
- New service method on `balance_summary` (or a sibling service) for top-N-on-account aggregation — keeps the SQL out of the portal module.
- `styles/prosilver/template/portal/bbaccounts_balance.html` — add a leaderboard-result branch
- `language/en/portal_bbaccounts.php` — heading, table headers, "configure account" prompt
Acceptance
Notes
This was originally part of avatharbe/bbAccounts-dev#83's scope but the own-balance variant ships first because it's the higher-value path and adds zero ACP plumbing. Leaderboard adds the per-instance config story that bbGuild's portal supports but that avatharbe/bbAccounts-dev#83 didn't need.
Follow-up of avatharbe/bbAccounts-dev#83. Adds the second render mode envisioned in avatharbe/bbAccounts-dev#79 surface 4 (leaderboard) on top of the own-balance variant that shipped with avatharbe/bbAccounts-dev#83.
Scope
Per portal block instance, an admin chooses:
Block renders the top-N subledger balances on that account, descending by closing balance. Visible to all viewers; the data is whatever the admin chose to make public.
Per-instance config
bbGuild already has `bb_portal_config` for per-module-id key/value config. The leaderboard mode persists `account_id` and `top_n` there, edited via the bbGuild ACP portal screen's module-config form.
The own-balance mode (shipped) needs no config — keep it as the default. Adding leaderboard means the module's `get_template_acp()` returns a mode picker (own-balance / leaderboard) plus, when leaderboard is selected, an account_id dropdown and a top_n integer.
Files
Acceptance
Notes
This was originally part of avatharbe/bbAccounts-dev#83's scope but the own-balance variant ships first because it's the higher-value path and adds zero ACP plumbing. Leaderboard adds the per-instance config story that bbGuild's portal supports but that avatharbe/bbAccounts-dev#83 didn't need.