feat(18-04): settings forms take method-backed dropdown options from the settings model (task 1)

- the settings schema passes the settings model as the DropdownOptionsProvider
- boot refuses a dropdown method on a settings model without DropdownOptions
- cabana README and docs/backend/settings.md describe it
This commit is contained in:
2026-10-13 14:08:14 +02:00
parent dff931c865
commit 21c5618dd1
5 changed files with 83 additions and 2 deletions

View File

@@ -512,7 +512,7 @@ func (s *service) settingsList(w http.ResponseWriter, r *http.Request) {
func (s *service) settingsSchema(w http.ResponseWriter, r *http.Request) {
s.protectSetting(w, r, func(setting *CompiledSetting) {
view, err := setting.Form.Localize(r.Context(), s.translator(), nil)
view, err := setting.Form.Localize(r.Context(), s.translator(), settingDropdownProvider(setting))
if err != nil {
WriteError(w, http.StatusInternalServerError, "error", msgServerError)
return