diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 20:46:57 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 20:46:57 +0200 |
| commit | 03ead1722f4c57616adc6c709ebbce0642c03cfb (patch) | |
| tree | 5d153bb56296138a4e0f2de9925ec9af726b85cb /internal | |
| parent | 41f6b694b184a2b39fa56d0dfe3c9ffbf44edbc5 (diff) | |
| download | lectio-03ead1722f4c57616adc6c709ebbce0642c03cfb.tar.gz lectio-03ead1722f4c57616adc6c709ebbce0642c03cfb.zip | |
web(settings): drop the terminal "versions" field; it is CLI-only
The settings page showed two near-identical version checkbox rows --
"versions" (the terminal compare set) and "web_versions" (the web page's
own default ticks). The first only affects the CLI, so editing it from
the web is pointless and was actively confusing (both rows list the same
wuj/vul/grb/drb boxes).
Remove the "versions" row from the form and stop reading it in
settingsPost, so cfg.Versions is preserved from the live config (same
pattern as offline/width/pager). The web settings now expose only what
the web uses: default_version and web_versions.
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/web/server.go | 6 | ||||
| -rw-r--r-- | internal/web/templates/settings.html | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/internal/web/server.go b/internal/web/server.go index f02bc12..3d3db7e 100644 --- a/internal/web/server.go +++ b/internal/web/server.go @@ -845,13 +845,13 @@ func settingsPost(s *server) http.HandlerFunc { cfg.WebDisplay = config.NormalizeDisplay(r.PostForm.Get("web_display")) cfg.WebTheme = r.PostForm.Get("web_theme") cfg.DefaultVersion = r.PostForm.Get("default_version") - cfg.Versions = r.PostForm["versions"] cfg.WebVersions = r.PostForm["web_versions"] cfg.All = r.PostForm.Get("all") != "" cfg.WebMono = r.PostForm.Get("web_mono") != "" cfg.WebPort = atoiOr(r.PostForm.Get("web_port"), cfg.WebPort) - // offline, width and pager are not web-editable; their config values are - // preserved (the form no longer carries those fields). + // versions (the terminal compare set), offline, width and pager are not + // web-editable; their config values are preserved (the form no longer + // carries those fields). booksText := r.PostForm.Get("books") diff --git a/internal/web/templates/settings.html b/internal/web/templates/settings.html index 8e18278..cb753ae 100644 --- a/internal/web/templates/settings.html +++ b/internal/web/templates/settings.html @@ -67,11 +67,10 @@ </select> </label> - <div class="row"> - {{.L.WebVersions}} - {{range .VersionOpts}}<label><input type="checkbox" name="versions" value="{{.Code}}" {{if .Checked}}checked{{end}}> {{.Code}}</label>{{end}} - </div> - + {{/* The terminal compare set (config "versions") is intentionally NOT here: + it only affects the CLI, so editing it from the web is pointless and + confusing. settingsPost preserves it. This page keeps only the web's + own defaults: the single default_version and the web_versions ticks. */}} <div class="row"> {{.L.WebWebVersions}} {{range .WebVersionOpts}}<label><input type="checkbox" name="web_versions" value="{{.Code}}" {{if .Checked}}checked{{end}}> {{.Code}}</label>{{end}} |
