2689715c2d
/tools, /routines and /chat were the only pages whose markup still lived in a Go string constant. They are tools.html, routines.html and chat.html now, embedded exactly like the eight that already were, so no page markup is left in Go and the "HTML in Go" complaint is answered with no framework, no build step and no second artifact. routineRow/routineRows are routineView/toRoutineViews. The pattern is right — it maps wire structs to display structs so a template never formats an interval or a timestamp — but "rows" read like database rows when these are view models. Checked the other half of that review thread while renaming: handleRoutines calls the mapper once and formats nothing itself, so there is no duplicated work between the handler and it. Content is verbatim. htmx is deliberately not added here; per the task it comes later and only where a page wants partial updates.
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
{{template "shellTop" "routines"}}
|
|
<h1>Routines</h1>
|
|
{{if .Msg}}<div class="msg msg-ok">{{.Msg}}</div>{{end}}
|
|
<section class=card>
|
|
<h2 class=card-title>noticed <span class=badge>{{len .Proposed}}</span></h2>
|
|
{{if .Proposed}}<div class=scroll><table><tr><th>maven noticed</th><th>when</th><th></th><th></th></tr>
|
|
{{range .Proposed}}<tr>
|
|
<td>{{.Phrase}}</td><td class=muted>{{.Noticed}}</td>
|
|
<td><form method=post action=/routines class=inline-form>
|
|
<input type=hidden name=id value="{{.ID}}">
|
|
<input type=hidden name=action value=accept>
|
|
<button class=btn>accept</button></form></td>
|
|
<td><form method=post action=/routines class=inline-form>
|
|
<input type=hidden name=id value="{{.ID}}">
|
|
<input type=hidden name=action value=dismiss>
|
|
<button class="btn btn-muted">dismiss</button></form></td>
|
|
</tr>{{end}}</table></div>
|
|
{{else}}<div class=empty>
|
|
<svg class=icon width="20" height="20"><use href="/ethos-icons.svg#i-wave"/></svg>
|
|
<div>no proposed routines</div>
|
|
<div class=hint>maven will propose routines here when she detects a recurring pattern</div>
|
|
</div>{{end}}
|
|
</section>
|
|
{{template "shellBottom"}}
|