blob: e2ee39ea144d46937e49b1aa8450769a6219d6ac (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
{{/* settings.html — lectio-web /settings page: a form for every config
setting plus a raw books.ini editor. A plain POST form (no htmx) --
saving redirects (PRG) back here with ?saved=1. On a validation error
the form re-renders with the submitted values and an inline message
instead of redirecting. Self-contained and theme-aware, like index.html. */}}
<!doctype html>
<html lang="{{.Lang}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>lectio — settings</title>
<link rel="stylesheet" href="/static/base.css">
<link id="theme" rel="stylesheet" href="/theme.css?name={{.Cfg.WebTheme}}">
<script src="/static/htmx.min.js"></script>
</head>
<body{{if .Cfg.WebMono}} class="mono"{{end}}>
<div class="page">
<p><a class="nav-link" href="/">← {{.L.BannerReadings}}</a></p>
{{if .Saved}}<p class="saved">{{.L.WebSaved}}</p>{{end}}
{{if .Error}}<p class="error">{{.Error}}</p>{{end}}
<form class="settings" method="post" action="/settings">
<label>{{.L.Lectionary}}
<select name="lectionary">
<option value="new" {{if eq .Cfg.Lectionary "new"}}selected{{end}}>{{.L.OptModern}}</option>
<option value="traditional" {{if eq .Cfg.Lectionary "traditional"}}selected{{end}}>{{.L.OptTraditional}}</option>
</select>
</label>
<label>{{.L.WebTradLang}}
<select name="traditional_lang">
<option value="pl" {{if eq .Cfg.TraditionalLang "pl"}}selected{{end}}>pl</option>
<option value="en" {{if eq .Cfg.TraditionalLang "en"}}selected{{end}}>en</option>
</select>
</label>
<label>{{.L.WebUILang}}
<select name="ui_language">
<option value="en" {{if eq .Cfg.UILanguage "en"}}selected{{end}}>en</option>
<option value="pl" {{if eq .Cfg.UILanguage "pl"}}selected{{end}}>pl</option>
</select>
</label>
<label>{{.L.WebSiglaStyle}}
<select name="sigla_style">
<option value="auto" {{if eq .Cfg.SiglaStyle "auto"}}selected{{end}}>auto</option>
<option value="polish" {{if eq .Cfg.SiglaStyle "polish"}}selected{{end}}>polish</option>
<option value="english" {{if eq .Cfg.SiglaStyle "english"}}selected{{end}}>english</option>
</select>
</label>
<label>{{.L.Layout}}
<select name="web_display">
<option value="horizontal" {{if eq .Cfg.WebDisplay "horizontal"}}selected{{end}}>{{.L.OptHorizontal}}</option>
<option value="vertical" {{if eq .Cfg.WebDisplay "vertical"}}selected{{end}}>{{.L.OptColumns}}</option>
<option value="interlinear" {{if eq .Cfg.WebDisplay "interlinear"}}selected{{end}}>{{.L.OptInterlinear}}</option>
</select>
</label>
<label>{{.L.Theme}}
<select name="web_theme">
{{range .ThemeOpts}}<option value="{{.Name}}" {{if .Selected}}selected{{end}}>{{.Name}}</option>{{end}}
</select>
</label>
<label>{{.L.WebDefaultVersion}}
<select name="default_version">
{{range .VersionOpts}}<option value="{{.Code}}" {{if eq .Code $.Cfg.DefaultVersion}}selected{{end}}>{{.Code}}</option>{{end}}
</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>
<div class="row">
{{.L.WebWebVersions}}
{{range .WebVersionOpts}}<label><input type="checkbox" name="web_versions" value="{{.Code}}" {{if .Checked}}checked{{end}}> {{.Code}}</label>{{end}}
</div>
<div class="row">
<label><input type="checkbox" name="all" {{if .Cfg.All}}checked{{end}}> {{.L.OptAll}}</label>
<label><input type="checkbox" name="offline" {{if .Cfg.Offline}}checked{{end}}> {{.L.WebOffline}}</label>
<label><input type="checkbox" name="web_mono" {{if .Cfg.WebMono}}checked{{end}}> {{.L.Mono}}</label>
</div>
<label>{{.L.WebWidth}}
<input type="number" name="width" value="{{.Cfg.Width}}">
</label>
<label>{{.L.WebPort}}
<input type="number" name="web_port" value="{{.Cfg.WebPort}}">
</label>
<label>{{.L.WebPager}}
<input type="text" name="pager" value="{{.Cfg.Pager}}">
</label>
<label>books.ini
<textarea name="books" rows="20">{{.Books}}</textarea>
</label>
<div class="row">
<button type="submit">{{.L.WebSave}}</button>
</div>
</form>
</div>
</body>
</html>
|