Files
supermarket/internal/web/templates/content-scheduled.html
T
davidandClaude Opus 5.5 f275f039f9 Phase 1, part 2: Inbox, scheduled publishing and UTM tags
- Inbox: a top-level page, with a count in the menu, for everything
  waiting for approval; Content's drafts are reviewed there. /drafts
  redirects to it.
- Scheduling: publish a draft now or at a time (migration 3 adds
  publish_at). A scheduler in the app publishes due drafts every 30
  seconds. Posts more than 12 hours overdue, or refused before posting,
  go back to the Inbox with the reason. Content gets Scheduled and
  Published tabs.
- UTM tags on links to the company's own websites and product pages,
  added when publishing; drafts stay untagged.
- The container runs in the computer's time zone, so times are shown
  and read correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 13:17:38 -07:00

37 lines
1.5 KiB
HTML

{{define "content"}}{{with .Data}}{{$conn := .Connected}}
<nav class="tabs">
<a href="/content">Sources</a>
<a href="/content/scheduled" aria-current="page">Scheduled</a>
<a href="/content/published">Published</a>
</nav>
<h1>Scheduled</h1>
<p class="lede">Approved posts, in the order they go out ({{.Zone}}). Supermarket publishes them on time as long as it's running; one more than 12 hours late goes back to the Inbox instead.</p>
{{if .Drafts}}
<table class="list">
<thead><tr><th>When</th><th>Channel</th><th>Entry</th><th>Post</th><th></th></tr></thead>
<tbody>
{{range .Drafts}}
<tr>
<td>{{.PublishAt.Local.Format "Mon 2 Jan 15:04"}}</td>
<td>{{.ChannelName}}{{if not (index $conn .Channel)}}<br><span class="warn-text small">not connected</span>{{end}}</td>
<td>{{.InventoryName}}</td>
<td class="post-text">{{truncate 200 .Content}}</td>
<td class="row-actions">
<form method="post" action="/drafts/{{.ID}}/publish" data-busy="Publishing…">
<input type="hidden" name="from" value="scheduled">
<button type="submit" class="small" {{if not (index $conn .Channel)}}disabled{{end}}>Publish now</button>
</form>
<form method="post" action="/drafts/{{.ID}}/unschedule">
<button type="submit" class="secondary small">Unschedule</button>
</form>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<section class="card empty"><p>Nothing scheduled. Schedule drafts from the <a href="/inbox">Inbox</a>.</p></section>
{{end}}
{{end}}{{end}}