oficina / slides Public

Clone
git clone https://amadan.net/oficina/slides

Plain git — no account needed to clone.

Download

Download this file

1package slides
2
3import (
4 "html/template"
5
6 "amadan.net/oficina/estilo.git/savestatus"
7)
8
9// withSaveStatus adds estilo's "estilo-save-status" define to a page's
10// template set.
11func withSaveStatus(t *template.Template) *template.Template {
12 return template.Must(t.Parse(savestatus.Template()))
13}
14
15// SaveStatus is the editor's save line: resting on "saved", every
16// state's words from this app's catalog. "retrying" is the queue
17// retrying (the network, or a 5xx); "failed" is a batch the server
18// refused and dropped, which the bundle keeps on screen for the rest
19// of the session (fixtures/status.mjs).
20func (p editorPage) SaveStatus() savestatus.Data {
21 return savestatus.Data{
22 State: "saved",
23 Placement: "inline",
24 Saved: p.TextSaved,
25 Saving: p.TextSaving,
26 Retrying: p.TextOffline,
27 Failed: p.TextFailed,
28 Label: p.StatusLabel,
29 }
30}
31