| {{.PublishAt.Local.Format "Mon 2 Jan 15:04"}} |
- {{.ChannelName}}{{if not (index $conn .Channel)}} not connected{{end}} |
+ {{.Where}}{{if not (index $conn .Channel)}} not connected{{end}} |
{{.InventoryName}} |
- {{truncate 200 .Content}} |
+ {{if .Title}}{{.Title}} {{end}}{{truncate 200 .Content}} |
+
+ Reddit
+ {{with index .Connections "reddit"}}{{if .Account}} Connected as u/{{.Account}}, {{ago .At}}. {{end}}{{end}}
+ At reddit.com/prefs/apps, create a web app with this redirect URI: {{.RedditRedirect}}.
+ Reddit's API terms need approval for commercial use: Supermarket is meant for a few hand-approved posts, not volume.
+
+
{{end}}{{end}}
diff --git a/internal/web/templates/inbox.html b/internal/web/templates/inbox.html
index da3ba10..9833dda 100644
--- a/internal/web/templates/inbox.html
+++ b/internal/web/templates/inbox.html
@@ -1,4 +1,4 @@
-{{define "content"}}{{with .Data}}{{$conn := .Connected}}{{$now := .Now}}{{$zone := .Zone}}
+{{define "content"}}{{with .Data}}{{$conn := .Connected}}{{$now := .Now}}{{$zone := .Zone}}{{$reddit := .Reddit}}
Inbox
Everything waiting for your approval. Nothing is published until you say so: publish a draft now, or schedule it.
{{if .Tagged}}Links to your own sites get UTM tags when published.{{end}}
@@ -16,12 +16,31 @@
{{range .Drafts}}
- {{.ChannelName}}
+ {{.Where}}
{{if .Error}} {{.Error}} {{end}}
+ {{$rv := index $reddit .ID}}
+ {{if $rv}}
+ {{if $rv.Warnings}} {{range $rv.Warnings}}- {{.}}
{{end}} {{end}}
+ {{with $rv.Info}}
+
+ r/{{.Name}}'s rules{{if .Rules}} ({{len .Rules}}){{end}} · read {{ago .FetchedAt}}
+ {{if .SubmitText}}{{truncate 1200 .SubmitText}} {{end}}
+ {{if .Rules}}{{range .Rules}}- {{.Name}}{{if .Description}}: {{truncate 500 .Description}}{{end}}
{{end}} {{end}}
+ Posts: {{if eq .SubmissionType "self"}}text only{{else if eq .SubmissionType "link"}}links only{{else}}text or links{{end}}{{if .Subscribers}} · {{.Subscribers}} members{{end}}
+
+ {{end}}
+
+ {{end}}
|