oficina / fichas Public

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

Plain git — no account needed to clone.

Download

Download this file

1{{define "title"}}Arrange the {{.Type.Label}} card · Fichas{{end}}
2{{define "content"}}
3<header fichas-appbar>
4 <h1 fichas-appbar-title>Arrange the {{.Type.Label}} card <span>what each card shows in Cards view</span></h1>
5</header>
6<form method="post" action="/t/{{.TypeKey}}/layout" fichas-layout-editor>
7 <div rst-stack>
8 <fieldset fichas-checklist>
9 <legend>Show on the card</legend>
10 {{range .Options}}
11 {{if .Locked}}{{template "field-check" (dict "Name" "_title" "Value" .Key "Label" (printf "%s — always the title" .Label) "Checked" true "Disabled" true)}}
12 {{else}}{{template "field-check" (dict "Name" "face" "Value" .Key "Label" .Label "Checked" .On)}}{{end}}
13 {{end}}
14 </fieldset>
15 {{with errFor .Errors "face"}}<p rst-field-error role="alert">{{.}}</p>{{end}}
16 <p fichas-meta>The first Choice you show sits beside the title as a status.</p>
17 {{template "form-foot" (dict "Submit" "Save card layout" "CancelHref" (printf "/t/%s?view=cards" .TypeKey) "CancelLabel" "Cancel")}}
18 </div>
19 <aside rst-stack>
20 <p fichas-meta>Current layout, on your most recent card</p>
21 {{with .Preview}}{{$face := .Face $.Face}}
22 <ul fichas-card-grid><li><article rst-card>
23 <h2 fichas-card-title><span>{{.Title}}</span>{{with $face.Pill}}{{template "status-pill" (dict "Label" . "Tone" (stageTone .))}}{{end}}</h2>
24 {{range $face.Lines}}
25 {{if eq .Kind "call"}}<p fichas-card-quote>{{.Value}}</p>
26 {{else if eq .Kind "date"}}<p fichas-meta>{{.Label}} <time datetime="{{.Date}}" title="{{longDate $.L .Date}}"{{with dateLang $.L .Date}} lang="{{.}}"{{end}}>{{dateAgo $.L .Date}}</time></p>
27 {{else if eq .Kind "longtext"}}<p fichas-meta fichas-clamp>{{.Value}}</p>
28 {{else if eq .Kind "url"}}<p fichas-meta>{{displayURL .Value}}</p>
29 {{else}}<p fichas-meta>{{.Value}}</p>{{end}}
30 {{end}}
31 </article></li></ul>
32 {{else}}<p fichas-meta>Add a card to see a preview.</p>{{end}}
33 </aside>
34</form>
35{{end}}
36