aboutsummaryrefslogtreecommitdiff
path: root/internal/web/templates
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-29 15:06:57 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-29 15:06:57 +0200
commitae8af86660243b75db1d54bb0c8d26431bd17f52 (patch)
treee3b8c469017ab25b83fa3f67807804b955b67e4f /internal/web/templates
parentcd8b2f25f390d9d6d5a4d5cb27c4cd2ed8ab4073 (diff)
downloadlectio-ae8af86660243b75db1d54bb0c8d26431bd17f52.tar.gz
lectio-ae8af86660243b75db1d54bb0c8d26431bd17f52.zip
web: reader link to the left, downloads into a "pobierz" disclosure
Finish the top-bar rework. The reader entry point now leads the controls bar on the far left (it was in the right-hand cluster); settings stays in the top-right cluster. The flat "download: txt md pdf · kalendarz" strip becomes a single "pobierz" summary that opens a small floating panel with two rows: - a month calendar with its own month + year <select> pickers (localised month names, both pre-selected from the shown date) and a PDF button that hits /calendar?month=YYYY-MM; - the shown day's readings as txt/md/pdf, labelled with the date. The panel is absolutely positioned under the link so opening it doesn't reflow the bar. indexData gains MonthOpts/YearOpts (a calOpt list); the year picker is a small window around the shown year.
Diffstat (limited to 'internal/web/templates')
-rw-r--r--internal/web/templates/index.html38
1 files changed, 29 insertions, 9 deletions
diff --git a/internal/web/templates/index.html b/internal/web/templates/index.html
index 3379dc1..b20131d 100644
--- a/internal/web/templates/index.html
+++ b/internal/web/templates/index.html
@@ -32,6 +32,8 @@ function stepDate(n){
<form id="controls" class="controls" hx-get="/readings" hx-target="#pane" hx-trigger="change">
<div class="controls-main">
+ {{/* The reader entry point is the primary action, so it leads the bar. */}}
+ <a class="nav-link nav-reader" href="/reader">{{.L.NavReader}} &rarr;</a>
{{/* Always-present marker so the server can tell a form submit with every
version unchecked (show nothing) from a fresh visit (config default). */}}
<input type="hidden" name="vset" value="1">
@@ -65,17 +67,35 @@ function stepDate(n){
</label>
</div>
- {{/* Utility links, pinned to the top-right (see #controls / .controls-side).
- The export URLs are built from the live control values at click time. */}}
+ {{/* Utility cluster, pinned to the top-right (see #controls / .controls-side):
+ settings, then a "pobierz" disclosure that opens two download options --
+ a month calendar (its own month/year pickers) and the shown day's
+ readings as txt/md/pdf. Both URLs are built from live values at click
+ time (the readings export from the whole control form, the calendar from
+ its own pickers plus the hidden lectionary field). */}}
<span class="controls-side">
- <a class="nav-link nav-reader" href="/reader">{{.L.NavReader}} &rarr;</a>
<a class="nav-link" href="/settings">{{.L.NavSettings}}</a>
- <span class="export">{{.L.Export}}:
- <a href="#" onclick="location='/export?fmt=txt&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">txt</a>
- <a href="#" onclick="location='/export?fmt=md&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">md</a>
- <a href="#" onclick="location='/export?fmt=pdf&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">pdf</a>
- · <a href="#" onclick="var d=(document.querySelector('#controls [name=date]').value||'').slice(0,7);location='/calendar?month='+d+'&lectionary='+document.querySelector('#controls [name=lectionary]').value;return false;">{{.L.Calendar}}</a>
- </span>
+ <details class="export">
+ <summary class="nav-link">{{.L.Export}}</summary>
+ <div class="export-panel">
+ <div class="export-row">
+ <span class="export-label">{{.L.Calendar}}</span>
+ <select id="cal-month" aria-label="{{.L.Calendar}}">
+ {{range .MonthOpts}}<option value="{{.Val}}"{{if .Sel}} selected{{end}}>{{.Label}}</option>{{end}}
+ </select>
+ <select id="cal-year">
+ {{range .YearOpts}}<option value="{{.Val}}"{{if .Sel}} selected{{end}}>{{.Label}}</option>{{end}}
+ </select>
+ <a href="#" onclick="var m=document.getElementById('cal-month').value,y=document.getElementById('cal-year').value;location='/calendar?month='+y+'-'+('0'+m).slice(-2)+'&lectionary='+document.querySelector('#controls [name=lectionary]').value;return false;">PDF</a>
+ </div>
+ <div class="export-row">
+ <span class="export-label">{{.Date}}</span>
+ <a href="#" onclick="location='/export?fmt=txt&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">txt</a>
+ <a href="#" onclick="location='/export?fmt=md&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">md</a>
+ <a href="#" onclick="location='/export?fmt=pdf&'+new URLSearchParams(new FormData(document.getElementById('controls'))).toString();return false;">pdf</a>
+ </div>
+ </div>
+ </details>
</span>
</form>