Social accounts: X's 127.0.0.1 callback, "Get it" links, save in place; cart logo
- X refuses "localhost" in callback URLs, so its sign-in now uses http://127.0.0.1:8470/auth/x/callback (shown on the page and sent to X); LinkedIn and Reddit keep localhost. - Every key, on Social accounts and the AI tab, has a "Get it" link to the service's page for it (opens a new tab) and says where on that page to find it. Addresses checked on 2026-11-21. - Each network's card saves its own keys in place (htmx swaps the card), saying "Saved." and enabling Connect when ready; no reload. Without JavaScript it still saves and reloads. - The shopping-cart image is the logo in the sidebar, the tab icon (PNG, and a multi-size favicon.ico at /favicon.ico) and the touch icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,26 +1,33 @@
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$set := .Set}}
|
||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}
|
||||
<h2>Social accounts</h2>
|
||||
<p class="lede">The keys Supermarket reads posts with, and the sign-ins it publishes with. Keys are kept in <code>secrets.json</code> in Supermarket's data folder, readable only by you; saved values are never shown, and an empty field keeps what's saved.</p>
|
||||
|
||||
{{/* The key fields of every card belong to this one form (form="accounts"),
|
||||
so each card's Save saves them all, and the sign-in forms aren't nested. */}}
|
||||
<form method="post" action="/settings/accounts" id="accounts"></form>
|
||||
{{range .Networks}}{{template "network" .}}{{end}}
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
|
||||
{{range .Networks}}{{$name := .Name}}
|
||||
<section class="card network">
|
||||
{{/* 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}}
|
||||
<section class="card network" id="network-{{.Name}}">
|
||||
<h2>{{.Name}}
|
||||
{{with .Connect}}{{if .Signed}}<span class="badge published">connected{{with .Account}} as {{.}}{{end}}</span>{{else}}<span class="badge">not connected</span>{{end}}{{end}}
|
||||
</h2>
|
||||
{{range .Fields}}
|
||||
<div class="secret">
|
||||
<label>{{.Label}}
|
||||
<input type="password" name="{{.Name}}" form="accounts" autocomplete="off" placeholder="{{if index $set .Name}}saved — type to replace{{else}}not set{{end}}">
|
||||
{{if .Help}}<span class="help">{{.Help}}</span>{{end}}
|
||||
</label>
|
||||
{{if index $set .Name}}<label class="check small"><input type="checkbox" name="remove:{{.Name}}" form="accounts"> remove</label>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<button type="submit" form="accounts" class="secondary">Save keys</button>
|
||||
<form method="post" action="/settings/accounts" hx-post="/settings/accounts" hx-target="closest section" hx-swap="outerHTML" autocomplete="off">
|
||||
<input type="hidden" name="network" value="{{.Name}}">
|
||||
{{range .Fields}}
|
||||
<div class="secret">
|
||||
<label><span class="label-row">{{.Label}}{{with .Link}} <a class="get-it" href="{{.}}" target="_blank" rel="noopener noreferrer">Get it ↗</a>{{end}}</span>
|
||||
<input type="password" name="{{.Name}}" autocomplete="off" placeholder="{{if index $set .Name}}saved — type to replace{{else}}not set{{end}}">
|
||||
{{if .Help}}<span class="help">{{.Help}}</span>{{end}}
|
||||
</label>
|
||||
{{if index $set .Name}}<label class="check small"><input type="checkbox" name="remove:{{.Name}}"> remove</label>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="row">
|
||||
<button type="submit" class="secondary">Save {{.Name}} keys</button>
|
||||
{{if .Saved}}<span class="ok small" role="status">Saved.</span>{{end}}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{with .Connect}}
|
||||
<div class="signin">
|
||||
@@ -34,4 +41,3 @@
|
||||
{{end}}
|
||||
</section>
|
||||
{{end}}
|
||||
{{end}}{{template "settings-end"}}{{end}}
|
||||
|
||||
Reference in New Issue
Block a user