aboutsummaryrefslogtreecommitdiff
path: root/internal/web/templates/index.html
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 15:00:17 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 15:00:17 +0200
commitaa6c9dad764089a3f0e287b5f90937e97dde3921 (patch)
tree213f7f56bf3c5ca1db82f0eee7c482886fa9ce43 /internal/web/templates/index.html
parent66a17fda33e44e9022d6724f850323f754715259 (diff)
downloadlectio-aa6c9dad764089a3f0e287b5f90937e97dde3921.tar.gz
lectio-aa6c9dad764089a3f0e287b5f90937e97dde3921.zip
web: horizontal/vertical/interlinear display modes + web_display config
Adds a display-layout option to lectio-web alongside the existing colour themes: - config: WebDisplay field (toml web_display), default "horizontal", normalized on load via the new exported config.NormalizeDisplay (unknown -> "horizontal", same lenient style as the other web_* fields). - render: extracts the citation/ToEnglishRef resolution shared by GatherVersion into an unexported resolveRef helper (GatherVersion's signature/behavior unchanged) and adds GatherVerses(version, sec, lectionary) returning raw bible.Verse structs plus a versified flag, for column/interlinear alignment. - web/render: RenderReadings gains a display parameter. "horizontal" is the original stacked layout, byte-for-byte the same code path as before. "vertical" reuses the same per-version column data in a .display-vertical/.vcol grid (the CLI compare view, browser-side). "interlinear" maps versions through render.OfflineVersions' pl->wuj substitution (pl has no verse numbers), gathers GatherVerses per version, and interleaves them by chapter:verse into .ilverse/.illine blocks (ordered union of keys, first versified version's order first). - server: adds a display <select> to the top bar wired into the existing #controls HTMX form; a resolveQuery(cfg, r) helper replaces the duplicated date/lectionary/all/versions(+now display) resolution in indexHandler and readingsHandler. - fold-in from the B2 review: indexHandler now populates indexData.Lookup via a shared renderLookup(ref, versions) helper (also used by lookupHandler), so a bookmarked "/?ref=...&v=..." link shows its lookup result instead of an empty pane. - base.css: layout-only rules for the two new modes (no colours; themes stay colour-only). go test ./..., go vet ./..., gofmt clean; go build ./cmd/lectio-web ok.
Diffstat (limited to 'internal/web/templates/index.html')
-rw-r--r--internal/web/templates/index.html16
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/web/templates/index.html b/internal/web/templates/index.html
index 4dd580f..03c0078 100644
--- a/internal/web/templates/index.html
+++ b/internal/web/templates/index.html
@@ -1,11 +1,13 @@
{{/* index.html renders the full lectio-web page: top-bar controls (date,
- lectionary, version checkboxes, all/gospel toggle, theme select), a
- passage-lookup form, and the pre-rendered reading pane (#pane).
+ lectionary, version checkboxes, all/gospel toggle, display select,
+ theme select), a passage-lookup form, and the pre-rendered reading pane
+ (#pane).
The controls form (#controls) carries hx-get="/readings" and fires on
any "change" bubbling up from its fields (htmx auto-includes an
hx-get element's enclosing form fields as the request's query
- params -- no hx-include needed). The date +/- buttons are separate
+ params -- no hx-include needed), so "display" needs no extra wiring
+ beyond living inside #controls. The date +/- buttons are separate
hx-get elements nested in the same form so their own field values are
included too; they override "date" via hx-vals. The theme <select>
has no server round trip: it swaps the #theme <link>'s href directly. */}}
@@ -48,6 +50,14 @@
<option value="1" {{if .All}}selected{{end}}>wszystkie części</option>
</select>
</label>
+
+ <label>układ
+ <select name="display">
+ <option value="horizontal" {{if eq .Display "horizontal"}}selected{{end}}>poziomo</option>
+ <option value="vertical" {{if eq .Display "vertical"}}selected{{end}}>kolumny</option>
+ <option value="interlinear" {{if eq .Display "interlinear"}}selected{{end}}>interlinearnie</option>
+ </select>
+ </label>
</form>
<label class="theme-picker">motyw