Reddit's API isn't open to apps like this one, so Supermarket no longer signs in to Reddit, publishes or schedules there, or reads subreddits and the account's posts. The internal/api/reddit client, Reddit's OAuth, its keys and its Social accounts card are gone. Supermarket still writes the post. Each Reddit draft in Posts has a box for its subreddit's rules, with a link to them on Reddit: pasted once, they're kept (subreddits.data, as pasted_rules) and given to the model for later drafts. Open in Reddit saves the edits and opens the submit page filled in; Copy title and Copy text (with the tagged source link) cover a box that comes up empty; Mark as posted records it. Warnings come from the pasted rules and the posts marked as posted. Fill's subreddit suggestions are kept unchecked, and say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
103 lines
6.8 KiB
HTML
103 lines
6.8 KiB
HTML
{{define "content"}}{{with .Data}}{{$d := .}}{{$e := .E}}
|
|
<p><a href="/market">← Market</a></p>
|
|
<h1>{{if $e.ID}}{{$e.Name}}{{else}}New entry{{end}}</h1>
|
|
|
|
<form method="post" action="/market/save" data-busy-on="fill" data-busy="Reading their website…">
|
|
<input type="hidden" name="id" value="{{$e.ID}}">
|
|
<section class="card">
|
|
<h2>Fill in with AI</h2>
|
|
<p class="help">Reads their website and fills in the boxes that are still empty: links and accounts straight from the pages, and a description, talking points, keywords, hashtags and subreddits from the AI, set against your <a href="/settings/profile">company profile</a>. What you've typed stays. Nothing is saved until you press Save.</p>
|
|
{{if .NoAI}}<p class="warn-text">This needs the AI: first <a href="/settings/ai">set up the AI</a>, then come back. Or fill in the form by hand.</p>{{end}}
|
|
<div class="row">
|
|
<input name="draft_url" type="text" inputmode="url" value="{{.DraftURL}}" placeholder="https://example.com" aria-label="Their website">
|
|
<button type="submit" name="action" value="fill" class="secondary" formaction="/market/fill" formnovalidate {{if .NoAI}}disabled{{end}}>Fill in the empty boxes</button>
|
|
</div>
|
|
<p class="help">Takes up to a minute or two.</p>
|
|
{{if .Drafted}}{{if .Filled}}<p class="flash">Filled in: {{join .Filled ", "}}. Check them, correct what's wrong, then Save.</p>{{else}}<p class="muted">Nothing to fill in: every box the website could answer is already filled, or the site doesn't say.</p>{{end}}{{end}}
|
|
{{with .Suggestions}}
|
|
<details class="suggestions" open>
|
|
<summary>Subreddits the AI suggested</summary>
|
|
<ul>
|
|
{{range .}}
|
|
<li class="{{if .Kept}}kept{{else}}dropped{{end}}">
|
|
<a href="https://www.reddit.com/r/{{.Name}}/" target="_blank" rel="noopener noreferrer">r/{{.Name}}</a>
|
|
{{if not .Kept}}<span class="small">left out: more than enough already</span>{{end}}
|
|
{{with .Why}}<span class="help">{{.}}</span>{{end}}
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
<p class="help">The ones kept are in the Subreddits box below. They aren't checked with Reddit, so one may not exist, or be private: open each before posting there. The AI picks by topic, not by how a community treats companies.</p>
|
|
</details>
|
|
{{end}}
|
|
</section>
|
|
|
|
<section class="card">
|
|
<div class="cols">
|
|
<label>Name <input name="name" value="{{$e.Name}}" required></label>
|
|
<label>Relationship
|
|
<select name="relationship">
|
|
{{range .Relationships}}<option value="{{.}}" {{if eq $e.Relationship .}}selected{{end}}>{{.}}</option>{{end}}
|
|
</select>
|
|
</label>
|
|
</div>
|
|
<label>Description <textarea name="description" rows="2">{{$e.Description}}</textarea></label>
|
|
<label>Talking points <textarea name="talking_points" rows="4">{{$e.TalkingPoints}}</textarea>
|
|
<span class="help">Partners: how you work together. Competitors: how you differ, where you win, and what not to claim.</span></label>
|
|
<fieldset class="prices">
|
|
<legend>Their prices</legend>
|
|
<p class="help">As you read them on their pricing page. Pages that compare with them say only these, with the month you checked; after six months, those pages ask you to check them again. Clear a row to remove it.</p>
|
|
{{with $d.Stale}}<p class="warn-text small">{{len .}} {{if eq (len .) 1}}price was{{else}}prices were{{end}} checked more than six months ago: look again{{with (index . 0).Source}} (<a href="{{.}}" target="_blank" rel="noopener noreferrer">their pricing page ↗</a>){{end}}.</p>{{end}}
|
|
<div class="table-wrap"><table class="compact price-rows">
|
|
<thead><tr><th>Plan</th><th>Price</th><th>Per</th><th>Checked</th><th>Where you read it</th></tr></thead>
|
|
<tbody>
|
|
{{range $e.Prices}}<tr>
|
|
<td><input name="price_plan" value="{{.Plan}}" aria-label="Plan" placeholder="Pro"></td>
|
|
<td><input name="price_amount" value="{{.Amount}}" aria-label="Price" placeholder="$25"></td>
|
|
<td><input name="price_per" value="{{.Per}}" aria-label="Per" placeholder="per agent per month"></td>
|
|
<td><input type="date" name="price_checked" value="{{.Checked}}" aria-label="Checked on"></td>
|
|
<td><input type="url" name="price_source" value="{{.Source}}" aria-label="Where you read it" placeholder="https://…/pricing"></td>
|
|
</tr>{{end}}
|
|
{{range $d.Blank}}<tr>
|
|
<td><input name="price_plan" aria-label="Plan" placeholder="Pro"></td>
|
|
<td><input name="price_amount" aria-label="Price" placeholder="$25"></td>
|
|
<td><input name="price_per" aria-label="Per" placeholder="per agent per month"></td>
|
|
<td><input type="date" name="price_checked" value="{{$d.Today}}" aria-label="Checked on"></td>
|
|
<td><input type="url" name="price_source" aria-label="Where you read it" placeholder="https://…/pricing"></td>
|
|
</tr>{{end}}
|
|
</tbody>
|
|
</table></div>
|
|
</fieldset>
|
|
<label>Naming them in posts (competitors only)
|
|
<select name="mention_policy">
|
|
<option value="category" {{if ne $e.MentionPolicy "name"}}selected{{end}}>Don't name them; talk about the category</option>
|
|
<option value="name" {{if eq $e.MentionPolicy "name"}}selected{{end}}>Posts may name them</option>
|
|
</select>
|
|
</label>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Where to watch them</h2>
|
|
<div class="cols">
|
|
<label>X handle <input name="twitter_handle" value="{{$e.TwitterHandle}}" placeholder="without @"></label>
|
|
<label>YouTube channel ID <input name="youtube_channel_id" value="{{$e.YouTubeChannelID}}" placeholder="UC…"></label>
|
|
<label>Instagram handle <input name="instagram_handle" value="{{$e.InstagramHandle}}"></label>
|
|
<label>LinkedIn page <input name="linkedin" value="{{$e.LinkedIn}}"></label>
|
|
<label>Websites <textarea name="websites" rows="3">{{lines $e.Websites}}</textarea><span class="help">One per line.</span></label>
|
|
<label>RSS or Atom feeds <textarea name="rss" rows="3">{{lines $e.RSS}}</textarea><span class="help">One per line.</span></label>
|
|
<label>Subreddits <textarea name="subreddits" rows="3">{{lines $e.Subreddits}}</textarea><span class="help">One per line, without r/.</span></label>
|
|
<label>Hashtags <input name="hashtags" value="{{join $e.Hashtags " "}}" placeholder="#Example #OpenSource"></label>
|
|
</div>
|
|
<label>Keywords <textarea name="keywords" rows="3">{{lines $e.Keywords}}</textarea>
|
|
<span class="help">Terms they own or compete on, one per line.</span></label>
|
|
</section>
|
|
|
|
<div class="actions"><button type="submit">Save</button></div>
|
|
</form>
|
|
|
|
{{if $e.ID}}
|
|
<form method="post" action="/market/{{$e.ID}}/delete" class="danger-zone" data-confirm="Delete {{$e.Name}} from the Market?">
|
|
<button type="submit" class="danger">Delete {{$e.Name}}</button>
|
|
</form>
|
|
{{end}}
|
|
{{end}}{{end}}
|