{{define "content"}}{{with .Data}}

Approvals

What agents ask to send out of Supermarket: posts, emails, mailing-list adds, changes to the sites. Nothing goes until a person approves it, unless that kind of action has been allowed on its own. Edit it first if you like.

{{if .Waiting}} {{range .Waiting}}{{$req := .}}

{{.Agent}} agent asks to: {{.Summary}} · {{ago .Created}}

{{with .Draft}} {{if eq .Channel "reddit"}}

r/{{.Target}}

{{end}} {{with .SourceURL}}

Source: {{.}}

{{end}} {{if $req.Accounts}} {{else}}

You can't post to any account for this channel: an admin can let you (Settings → Posting accounts).

{{end}} {{if not $req.At.IsZero}}

To go out {{$req.At.Local.Format "Mon 2 Jan 2006, 15:04"}} (or at once, if that's passed).

{{end}} {{end}} {{with .Message}}

To {{.Contact.Name}} <{{.To}}>{{with .Company}} at {{.}}{{end}}

{{end}} {{with .Change}}

{{.Page}}

{{end}}
{{end}} {{else}}

Nothing waiting for you.

{{end}} {{if .Allowed}}

What agents may do on their own

{{range .Allowed}}{{end}}
AgentMayCapSince
{{.Agent}}{{.Label}}{{if .DailyCap}}{{.DailyCap}} a day{{else}}none{{end}}{{ago .Granted}}{{with by .GrantedBy}} {{.}}{{end}} {{if .Mine}}
{{end}}
{{end}} {{if .Recent}}

Decided

{{range .Recent}}{{end}}
WhenAgentAsked toOutcome
{{ago .Decided}}{{.Agent}}{{.Summary}} {{if eq .Status "refused"}}Refused{{with by .DecidedBy}} {{.}}{{end}}{{else if eq .Status "failed"}}Failed: {{truncate 120 .Result}}{{else if .OnItsOwn}}Done on its own{{with .Result}}: {{truncate 120 .}}{{end}}{{else}}Approved{{with by .DecidedBy}} {{.}}{{end}}{{with .Result}}: {{truncate 120 .}}{{end}}{{end}}
{{end}} {{end}}{{end}}