Phase 6 part 4: post as the LinkedIn company page

A second LinkedIn app (Community Management API) with its own sign-in on
Settings → Social accounts: the pages the member may post for are listed
and one chosen, new LinkedIn drafts default to the page or to you, and
each draft can switch before it's published. Schema 25.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-22 15:05:30 -07:00
co-authored by Claude Opus 5.5
parent 2c42857419
commit 98913971ea
20 changed files with 841 additions and 74 deletions
+28
View File
@@ -43,6 +43,34 @@
<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>
</form>
</div>
{{with .Page}}{{$pg := .}}
<form method="post" action="/settings/accounts/linkedin-page" class="signin">
<h3>The company page</h3>
{{if .Signed}}
{{if .Orgs}}
<fieldset><legend>Post as</legend>
{{range .Orgs}}<label class="check"><input type="radio" name="org" value="{{.URN}}" {{if and $pg.Chosen (eq $pg.Chosen.URN .URN)}}checked{{end}}> {{.Name}}{{with .Vanity}} <span class="muted small">linkedin.com/company/{{.}}</span>{{end}} <span class="badge">{{.Role}}</span></label>{{end}}
</fieldset>
{{else}}
{{with .Note}}<p class="warn-text">Couldn't list your pages: {{.}}</p>{{end}}
<label>The page's number <span class="muted">(from its admin view: linkedin.com/company/&lt;number&gt;/admin)</span>
<input name="org_manual" value="{{with $pg.Chosen}}{{.ID}}{{end}}" placeholder="12345678"></label>
{{end}}
{{with .Chosen}}<p class="small">Posting as <strong>{{.Name}}</strong>.</p>{{end}}
{{else}}<p class="help">Once connected, choose the page here.</p>{{end}}
<fieldset><legend>New LinkedIn drafts post as</legend>
<label class="check"><input type="radio" name="default" value="" {{if ne .Default "page"}}checked{{end}}> You</label>
<label class="check"><input type="radio" name="default" value="page" {{if eq .Default "page"}}checked{{end}}> The company page</label>
<span class="help">Each draft can still be switched before it's published.</span>
</fieldset>
<label>Permissions to ask for <input name="scopes" value="{{.Scopes}}">
<span class="help">As on the approved app's Auth tab: posting as the page (<code>w_organization_social</code>) and reading the pages you manage (<code>r_organization_admin</code> or <code>rw_organization_admin</code>). Reconnect after changing them.</span></label>
<div class="row">
<button type="submit" class="secondary">Save</button>
{{if .Signed}}<button type="submit" class="secondary" name="do" value="refresh">List my pages again</button>{{end}}
</div>
</form>
{{end}}
{{end}}
</section>
{{end}}