{{define "content"}}{{template "settings-start" .}}{{with .Data}}

Social accounts

The keys Supermarket reads posts with, and the sign-ins it publishes with. Keys are kept in secrets.json in Supermarket's data folder, readable only by you; saved values are never shown, and an empty field keeps what's saved.

{{range .Networks}}{{template "network" .}}{{end}} {{end}}{{template "settings-end"}}{{end}} {{/* One network's card. Its keys form saves in place (htmx swaps the card for the server's new copy); the sign-in form is a sibling, not nested. */}} {{define "network"}}{{$set := .Set}}{{$name := .Name}}

{{.Name}} {{with .Connect}}{{if .Signed}}connected{{with .Account}} as {{.}}{{end}}{{else}}not connected{{end}}{{end}}

{{range .Fields}}
{{if index $set .Name}}{{end}}
{{end}}
{{if .Saved}}Saved.{{end}}
{{with .Connect}}

Sign in to post

{{if .Accounts}}

Who may post to each: Settings → Posting accounts.

{{end}} {{with .Expiry}} {{if .Expired}}

The sign-in expired on {{.At.Local.Format "2 Jan 2006"}}: reconnect to publish again.

{{else if .Soon}}

The sign-in expires {{if eq .Days 0}}today{{else if eq .Days 1}}tomorrow{{else}}in {{.Days}} days{{end}}, on {{.At.Local.Format "2 Jan 2006"}}. Reconnect now to keep posting.

{{else}}

The sign-in lasts until {{.At.Local.Format "2 Jan 2006"}}; {{.Network}} doesn't let it be renewed without signing in again. Supermarket reminds you two weeks before.

{{end}} {{end}}

{{.Setup}} {{.Redirect}}{{with .Note}}
{{.}}{{end}}

{{with .Page}}{{$pg := .}}

The company page

{{if .Signed}} {{if .Orgs}}
Post as {{range .Orgs}}{{end}}
{{else}} {{with .Note}}

Couldn't list your pages: {{.}}

{{end}} {{end}} {{with .Chosen}}

Posting as {{.Name}}.

{{end}} {{else}}

Once connected, choose the page here.

{{end}}
New LinkedIn drafts post as Each draft can still be switched before it's published.
{{if .Signed}}{{end}}
{{end}} {{end}}
{{end}}