fix(admin): wire up default timezone setting in admin settings page
The admin settings timezone dropdown was incomplete: it had no pre-selection of the current value, was missing consistent styling, and the form submission did not persist timezone changes. Changes: - frontend.go: load default_timezone from system_settings into the systemConfig map passed to the template - admin_settings.templ: match card styling used by the Base URL section; pre-select current timezone with selected?= attribute - sidecar.go: handle default_timezone in UpdateSystemConfiguration by writing to system_settings table instead of system_config; update HTMX response to include timezone section with current value - Add selectedAttr() helper for HTMX HTML string response
This commit is contained in:
@@ -932,7 +932,13 @@ func registerFrontendRoutes(cfg *Config) {
|
||||
}
|
||||
|
||||
systemConfig := map[string]string{
|
||||
"base_url": baseURL,
|
||||
"base_url": baseURL,
|
||||
"default_timezone": "UTC",
|
||||
}
|
||||
|
||||
defaultTimezone, err := cfg.Queries.GetSystemTimezone(c.Request().Context())
|
||||
if err == nil && defaultTimezone != "" {
|
||||
systemConfig["default_timezone"] = defaultTimezone
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
|
||||
Reference in New Issue
Block a user