Phase 10, part 7: posting accounts, and who may post to which
Social accounts become posting accounts: several per network, the company's and each person's own, with their tokens kept per account. The old sign-ins are adopted as the company's. Admins say who may post to which (Settings → Posting accounts); a draft can go out from one account or a copy to several, each recording who posted it and as what. Signing an account out, or removing its owner, holds the posts scheduled to it and tells whoever scheduled them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,6 +72,20 @@
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
{{if or .Posting .Connectable}}
|
||||
<section class="card" id="posting">
|
||||
<h2>Your posting accounts</h2>
|
||||
<p class="help">Your own social accounts, to post as yourself. They're yours to post to; an admin can let others too. Signing one out takes it out of everyone's list, and posts scheduled to it come back to Posts.</p>
|
||||
{{if .Posting}}<ul class="accounts">{{range .Posting}}
|
||||
<li><strong>{{.Label}}</strong>{{if not .Expires.IsZero}} <span class="muted small">until {{.Expires.Local.Format "2 Jan 2006"}}</span>{{end}}
|
||||
<form class="inline" method="post" action="/settings/account/posting/{{.ID}}/remove"><button type="submit" class="secondary small">Sign out</button></form></li>
|
||||
{{end}}</ul>{{end}}
|
||||
<div class="actions">{{range .Connectable}}
|
||||
<form class="inline" method="post" action="/auth/{{.ID}}/start?for=me"><button type="submit" class="secondary">Connect your {{.Name}}</button></form>
|
||||
{{end}}</div>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<section class="card" id="sessions">
|
||||
<h2>Where you're signed in</h2>
|
||||
<table class="list">
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
{{with .Connect}}
|
||||
<div class="signin">
|
||||
<h3>Sign in to post</h3>
|
||||
{{if .Signed}}<p>Connected{{with .Account}} as <strong>{{.}}</strong>{{end}}{{if not .At.IsZero}}, {{ago .At}}{{end}}.</p>{{end}}
|
||||
{{if .Accounts}}<ul class="accounts">{{range .Accounts}}
|
||||
<li><strong>{{.Name}}</strong> <span class="muted small">{{if eq .Owner 0}}the company's{{else}}someone's own{{end}}, since {{.Created.Local.Format "2 Jan 2006"}}{{if not .Expires.IsZero}}, until {{.Expires.Local.Format "2 Jan 2006"}}{{end}}</span>
|
||||
<form class="inline" method="post" action="/settings/posting/{{.ID}}/remove" data-confirm="Sign {{.Name}} out? Posts scheduled to it go back to Posts."><button type="submit" class="secondary small">Sign out</button></form></li>
|
||||
{{end}}</ul>
|
||||
<p class="help">Who may post to each: <a href="/settings/posting">Settings → Posting accounts</a>.</p>{{end}}
|
||||
{{with .Expiry}}
|
||||
{{if .Expired}}<p class="error">The sign-in expired on {{.At.Local.Format "2 Jan 2006"}}: reconnect to publish again.</p>
|
||||
{{else if .Soon}}<p class="warn-text"><strong>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"}}.</strong> Reconnect now to keep posting.</p>
|
||||
@@ -40,7 +44,7 @@
|
||||
{{end}}
|
||||
<p class="help">{{.Setup}} <code>{{.Redirect}}</code>{{with .Note}}<br>{{.}}{{end}}</p>
|
||||
<form method="post" action="/auth/{{.Provider}}/start">
|
||||
<button type="submit" {{if not .Ready}}disabled title="Save the client ID{{if ne .Provider "x"}} and secret{{end}} first"{{end}}>{{if .Signed}}Reconnect{{else}}Connect{{end}} {{$name}}</button>
|
||||
<button type="submit" {{if not .Ready}}disabled title="Save the client ID{{if ne .Provider "x"}} and secret{{end}} first"{{end}}>{{if .Signed}}Add or reconnect a company account{{else}}Connect {{$name}}{{end}}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{with .Page}}{{$pg := .}}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{range .Drafts}}
|
||||
<tr>
|
||||
<td>{{.PublishedAt.Local.Format "2 Jan 2006 15:04"}}</td>
|
||||
<td>{{.Where}}</td>
|
||||
<td>{{.Where}}{{with .PostedAs}}<br><span class="muted small">as {{.}}</span>{{end}}</td>
|
||||
<td>{{.InventoryName}}</td>
|
||||
<td class="post-text">{{if .PostURL}}<a href="{{.PostURL}}" target="_blank" rel="noopener noreferrer">{{if .Title}}<strong>{{.Title}}</strong> {{end}}{{truncate 200 .Content}}</a>{{else}}{{if .Title}}<strong>{{.Title}}</strong> {{end}}{{truncate 200 .Content}}{{end}}</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{define "content"}}{{with .Data}}{{$conn := .Connected}}{{$page := .Page}}{{$now := .Now}}{{$zone := .Zone}}{{$reddit := .Reddit}}
|
||||
{{define "content"}}{{with .Data}}{{$conn := .Connected}}{{$accounts := .Accounts}}{{$chosen := .Chosen}}{{$now := .Now}}{{$zone := .Zone}}{{$reddit := .Reddit}}
|
||||
<h1>Posts</h1>
|
||||
<p class="lede">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}}</p>
|
||||
@@ -43,11 +43,13 @@
|
||||
data-count="{{.Channel}}" data-limit="{{.Limit}}" data-reserve="{{if eq .Channel "x"}}{{xreserve .SourceURL}}{{else}}0{{end}}"
|
||||
aria-describedby="count-{{.ID}}" id="text-{{.ID}}">{{.Content}}</textarea>
|
||||
{{if eq .Channel "reddit"}}{{if .SourceURL}}<p class="help">The source link is added at the end as “Source: …”.</p>{{end}}{{end}}
|
||||
{{if and (eq .Channel "linkedin") $page}}
|
||||
<label class="small inline-label">Post as
|
||||
<select name="linkedin_as"><option value="">You</option><option value="page" {{if eq .LinkedInAs "page"}}selected{{end}}>{{$page.Name}}</option></select>
|
||||
</label>
|
||||
{{else if eq .LinkedInAs "page"}}<p class="warn-text small">This draft posts as the company page, which isn't connected: set it up under <a href="/settings/accounts">Settings → Social accounts</a>.</p>{{end}}
|
||||
{{$d := .}}{{$accts := index $accounts .Channel}}
|
||||
{{if $accts}}
|
||||
<fieldset class="post-as">
|
||||
<legend class="small">Post as{{if gt (len $accts) 1}} <span class="muted">(choose several to post a copy to each)</span>{{end}}</legend>
|
||||
{{range $accts}}<label class="check small"><input type="checkbox" name="accounts" value="{{.ID}}" {{if eq (index $chosen $d.ID) .ID}}checked{{end}}> {{.Label}}</label>{{end}}
|
||||
</fieldset>
|
||||
{{end}}
|
||||
<p class="count{{if .TooLong}} over{{end}}" id="count-{{.ID}}">{{.Length}} / {{.Limit}}{{if and (eq .Channel "x") .SourceURL}} including the link{{end}}</p>
|
||||
<div class="actions">
|
||||
<button type="submit" name="action" value="publish" formaction="/drafts/{{.ID}}/publish"
|
||||
|
||||
@@ -146,6 +146,7 @@
|
||||
<a href="/settings/profile" {{if eq .Nav "settings/profile"}}aria-current="page"{{end}}>{{template "icon" "profile"}}Profile</a>
|
||||
<div class="nav-label">Connections</div>
|
||||
<a href="/settings/connections" {{if eq .Nav "settings/connections"}}aria-current="page"{{end}}>{{template "icon" "core"}}All connections</a>
|
||||
<a href="/settings/posting" {{if eq .Nav "settings/posting"}}aria-current="page"{{end}}>{{template "icon" "accounts"}}Posting accounts</a>
|
||||
<a href="/settings/accounts" {{if eq .Nav "settings/accounts"}}aria-current="page"{{end}}>{{template "icon" "accounts"}}Social accounts</a>
|
||||
<a href="/settings/core" {{if eq .Nav "settings/core"}}aria-current="page"{{end}}>{{template "icon" "core"}}Core & Hermes</a>
|
||||
<a href="/settings/sources" {{if eq .Nav "settings/sources"}}aria-current="page"{{end}}>{{template "icon" "prospects"}}Lead sources</a>
|
||||
@@ -172,7 +173,7 @@
|
||||
<section class="card warn reminder" role="status">
|
||||
<p><strong>{{if .Expired}}{{.Network}}'s sign-in expired on {{.At.Local.Format "2 Jan 2006"}}.{{else}}{{.Network}}'s 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"}}.{{end}}</strong>
|
||||
{{if .Expired}}Nothing can be published to {{.Network}} until you reconnect; scheduled posts for it come back to Posts.{{else}}After that, nothing can be published to {{.Network}} until you reconnect.{{end}}</p>
|
||||
<a class="button" href="/settings/accounts#network-{{.Network}}">Reconnect {{.Network}}</a>
|
||||
<a class="button" href="/settings/accounts">Reconnect {{.Network}}</a>
|
||||
</section>
|
||||
{{end}}{{end}}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}
|
||||
<h2>Posting accounts</h2>
|
||||
<p class="lede">The accounts posts go out from, and who may post to each. Admins may post to all of them; a person's own account is theirs. Tick to let someone else post to an account: the post records who wrote it and which account it went out as.</p>
|
||||
{{if not .Accounts}}
|
||||
<section class="card empty"><p>No posting accounts yet. Connect the company's under <a href="/settings/accounts">Social accounts</a>; each person can connect their own under Your account.</p></section>
|
||||
{{else}}
|
||||
<form class="card" method="post" action="/settings/posting">
|
||||
<div class="table-scroll">
|
||||
<table class="list grid">
|
||||
<thead><tr><th>Person</th>{{range .Accounts}}<th>{{.Label}}<br><span class="muted small">{{if eq .Owner 0}}the company's{{else}}{{index $d.Owners .Owner}}'s own{{end}}{{if not (index $d.Working .ID)}} · not working{{end}}</span></th>{{end}}</tr></thead>
|
||||
<tbody>
|
||||
{{range $p := .People}}<tr>
|
||||
<td>{{if .Name}}{{.Name}}{{else}}{{.Email}}{{end}}<br><span class="muted small">{{if .Admin}}admin{{else if .Can "content" true}}member{{else}}no Content: can't post{{end}}</span></td>
|
||||
{{range $a := $d.Accounts}}<td>
|
||||
{{if $p.Admin}}<input type="checkbox" checked disabled title="Admins may post to every account">
|
||||
{{else if eq $a.Owner $p.ID}}<input type="checkbox" checked disabled title="Their own account">
|
||||
{{else}}<input type="checkbox" name="grant" value="{{$a.ID}}:{{$p.ID}}" {{with index $d.Grants $a.ID}}{{if index . $p.ID}}checked{{end}}{{end}} aria-label="{{$p.Email}} may post to {{$a.Label}}">{{end}}
|
||||
</td>{{end}}
|
||||
</tr>{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="help">Members also need edit on Content to post at all.</p>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
{{end}}
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
Reference in New Issue
Block a user