Inventory is now the Market
Everything the user sees says Market: the sidebar, titles, breadcrumbs, help text, messages, suggestions and the agent tool's description; the export downloads as supermarket-market.yaml. Its pages live under /market, and the old /inventory addresses redirect there (308, so a form's POST stays a POST). The YAML format (inventory:), the database and the code's names are unchanged, so exported files still import. A breadcrumb no longer repeats the page's own title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,7 +155,7 @@ Throughout, also notice:
|
|||||||
`supermarket restore <file>.tar.gz` brings back the data and the keys
|
`supermarket restore <file>.tar.gz` brings back the data and the keys
|
||||||
(Settings show them as saved).
|
(Settings show them as saved).
|
||||||
|
|
||||||
## 4. Inventory
|
## 4. Market
|
||||||
|
|
||||||
- [x] Add a partner and a competitor by hand, with websites, feeds, X
|
- [x] Add a partner and a competitor by hand, with websites, feeds, X
|
||||||
handle and mention policy. They save and show in the list.
|
handle and mention policy. They save and show in the list.
|
||||||
@@ -168,7 +168,7 @@ Throughout, also notice:
|
|||||||
|
|
||||||
### Sources
|
### Sources
|
||||||
|
|
||||||
- [ ] *Fetch* on an inventory entry finds new items from its feeds and
|
- [ ] *Fetch* on a Market entry finds new items from its feeds and
|
||||||
sitemap, and the list shows when it was last checked.
|
sitemap, and the list shows when it was last checked.
|
||||||
- [x] Items can be dismissed and restored.
|
- [x] Items can be dismissed and restored.
|
||||||
- [ ] Your own products (`/content/own`) show your sites' and feeds' new
|
- [ ] Your own products (`/content/own`) show your sites' and feeds' new
|
||||||
@@ -418,7 +418,7 @@ Throughout, also notice:
|
|||||||
where it came from; buyer searches come first and are marked.
|
where it came from; buyer searches come first and are marked.
|
||||||
- [ ] None of them is something a page of yours already covers (check two
|
- [ ] None of them is something a page of yours already covers (check two
|
||||||
against your site).
|
against your site).
|
||||||
- [ ] With competitors (and their websites) in the Inventory, some candidates
|
- [ ] With competitors (and their websites) in the Market, some candidates
|
||||||
come from their sitemaps.
|
come from their sitemaps.
|
||||||
- [ ] **(costs, up to 3 web searches)** *Read the live top 3* shows three
|
- [ ] **(costs, up to 3 web searches)** *Read the live top 3* shows three
|
||||||
results with what kind of site each is; check them in a private
|
results with what kind of site each is; check them in a private
|
||||||
@@ -581,7 +581,7 @@ Throughout, also notice:
|
|||||||
|
|
||||||
- [x] Sites → New pages offers the eight kinds (landing, product,
|
- [x] Sites → New pages offers the eight kinds (landing, product,
|
||||||
alternative, comparison, blog, home, about, contact), and lists your
|
alternative, comparison, blog, home, about, contact), and lists your
|
||||||
products, competitors (from the Inventory), buying signals and SEO
|
products, competitors (from the Market), buying signals and SEO
|
||||||
briefs for new pages.
|
briefs for new pages.
|
||||||
- [ ] **(costs)** *Build the page* for a landing page takes a minute or two
|
- [ ] **(costs)** *Build the page* for a landing page takes a minute or two
|
||||||
and opens the page: a title under 60 characters, a description, an
|
and opens the page: a title under 60 characters, a description, an
|
||||||
@@ -593,7 +593,7 @@ Throughout, also notice:
|
|||||||
you didn't give it. What it couldn't know is listed under "Still to
|
you didn't give it. What it couldn't know is listed under "Still to
|
||||||
add or check by hand".
|
add or check by hand".
|
||||||
- [ ] An alternative or comparison page needs a competitor, and says only
|
- [ ] An alternative or comparison page needs a competitor, and says only
|
||||||
what the Inventory says about them.
|
what the Market says about them.
|
||||||
- [ ] Built from a signal, its links to the site carry
|
- [ ] Built from a signal, its links to the site carry
|
||||||
`utm_campaign=<the signal>&utm_medium=landing`.
|
`utm_campaign=<the signal>&utm_medium=landing`.
|
||||||
- [ ] Change a section's type to one the site lacks and *Save*: the error
|
- [ ] Change a section's type to one the site lacks and *Save*: the error
|
||||||
@@ -740,23 +740,23 @@ Throughout, also notice:
|
|||||||
with your page it links to. Add one that doesn't: it shows as gone.
|
with your page it links to. Add one that doesn't: it shows as gone.
|
||||||
- [ ] A link to a page of yours that answers 404 shows as *points at a
|
- [ ] A link to a page of yours that answers 404 shows as *points at a
|
||||||
404*, and *What to write next* suggests a redirect.
|
404*, and *What to write next* suggests a redirect.
|
||||||
- [ ] With a partner (and its website) in the Inventory, *Look at the
|
- [ ] With a partner (and its website) in the Market, *Look at the
|
||||||
partners' pages* finds their providers or hosting page when it lists
|
partners' pages* finds their providers or hosting page when it lists
|
||||||
others but not you; *I asked*, then *Won*, move it along.
|
others but not you; *I asked*, then *Won*, move it along.
|
||||||
- [ ] **(costs, up to 4 web searches)** With a competitor in the
|
- [ ] **(costs, up to 4 web searches)** With a competitor in the
|
||||||
Inventory, *Find them* lists pages of alternatives to it that leave
|
Market, *Find them* lists pages of alternatives to it that leave
|
||||||
you out; open two and check.
|
you out; open two and check.
|
||||||
|
|
||||||
## 10. Search
|
## 10. Search
|
||||||
|
|
||||||
- [ ] Searching for an inventory entry, a fetched item, a post, a prospect
|
- [ ] Searching for a Market entry, a fetched item, a post, a prospect
|
||||||
(company or person) or a signal finds it, with a link to where it is.
|
(company or person) or a signal finds it, with a link to where it is.
|
||||||
|
|
||||||
## 11. Agents (MCP)
|
## 11. Agents (MCP)
|
||||||
|
|
||||||
- [x] `supermarket token` prints a token.
|
- [x] `supermarket token` prints a token.
|
||||||
- [ ] Claude Code (`claude mcp list`) shows Supermarket connected, and can
|
- [ ] Claude Code (`claude mcp list`) shows Supermarket connected, and can
|
||||||
read the company profile, the inventory and the CRM queue through it
|
read the company profile, the Market and the CRM queue through it
|
||||||
(`profile_get`, `inventory_list`, `crm_pending_actions`).
|
(`profile_get`, `inventory_list`, `crm_pending_actions`).
|
||||||
- [ ] Hermes uses the Supermarket and Core MCP tools in its CRM job.
|
- [ ] Hermes uses the Supermarket and Core MCP tools in its CRM job.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ const (
|
|||||||
|
|
||||||
// Tasks lists the tasks with a description, for the settings page.
|
// Tasks lists the tasks with a description, for the settings page.
|
||||||
var Tasks = []struct{ ID, Label string }{
|
var Tasks = []struct{ ID, Label string }{
|
||||||
{TaskProfile, "Drafting the profile and filling in inventory entries"},
|
{TaskProfile, "Drafting the profile and filling in Market entries"},
|
||||||
{TaskContent, "Writing posts"},
|
{TaskContent, "Writing posts"},
|
||||||
{TaskProspects, "Finding prospects for a buying signal (needs Claude, for web search)"},
|
{TaskProspects, "Finding prospects for a buying signal (needs Claude, for web search)"},
|
||||||
{TaskOutreach, "Writing emails and LinkedIn messages to prospects"},
|
{TaskOutreach, "Writing emails and LinkedIn messages to prospects"},
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ func loadKnown(d *db.DB, prof *profile.Profile) (*known, error) {
|
|||||||
}
|
}
|
||||||
for _, e := range entries {
|
for _, e := range entries {
|
||||||
for _, w := range e.Websites {
|
for _, w := range e.Websites {
|
||||||
add(w, "in your inventory ("+e.Relationship+")")
|
add(w, "in your Market ("+e.Relationship+")")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, q := range []struct{ sql, why string }{
|
for _, q := range []struct{ sql, why string }{
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ func TestFindWithClaude(t *testing.T) {
|
|||||||
if run.Found != 6 || run.Added != 1 || run.Existing != 1 || run.Skipped != 4 || run.Searches != 4 || run.Status != "done" {
|
if run.Found != 6 || run.Added != 1 || run.Existing != 1 || run.Skipped != 4 || run.Searches != 4 || run.Status != "done" {
|
||||||
t.Fatalf("run: %+v", run)
|
t.Fatalf("run: %+v", run)
|
||||||
}
|
}
|
||||||
for _, want := range []string{"Made Up: its source wasn't among the pages searched", "Rival: in your inventory", "Nope: on the suppression list", "Us: that's you"} {
|
for _, want := range []string{"Made Up: its source wasn't among the pages searched", "Rival: in your Market", "Nope: on the suppression list", "Us: that's you"} {
|
||||||
if !strings.Contains(strings.Join(run.Notes, "\n"), want) {
|
if !strings.Contains(strings.Join(run.Notes, "\n"), want) {
|
||||||
t.Errorf("notes lack %q: %q", want, run.Notes)
|
t.Errorf("notes lack %q: %q", want, run.Notes)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ func ParseYAML(data []byte, defaultRel string) ([]Entry, error) {
|
|||||||
Applications []Entry `yaml:"applications"`
|
Applications []Entry `yaml:"applications"`
|
||||||
}
|
}
|
||||||
if err2 := yaml.Unmarshal(data, &doc); err2 != nil {
|
if err2 := yaml.Unmarshal(data, &doc); err2 != nil {
|
||||||
return nil, fmt.Errorf("not an inventory list: %w", err2)
|
return nil, fmt.Errorf("not a Market list: %w", err2)
|
||||||
}
|
}
|
||||||
list = append(doc.Inventory, doc.Applications...)
|
list = append(doc.Inventory, doc.Applications...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ func addTools(s *mcp.Server, d *db.DB) {
|
|||||||
|
|
||||||
mcp.AddTool(s, &mcp.Tool{
|
mcp.AddTool(s, &mcp.Tool{
|
||||||
Name: "inventory_list",
|
Name: "inventory_list",
|
||||||
Description: "The inventory: partners (whose news we amplify), competitors (whom we position against) and projects we watch, with their accounts, keywords and talking points.",
|
Description: "The Market: partners (whose news we amplify), competitors (whom we position against) and projects we watch, with their accounts, keywords and talking points.",
|
||||||
}, func(ctx context.Context, _ *mcp.CallToolRequest, args inventoryArgs) (*mcp.CallToolResult, any, error) {
|
}, func(ctx context.Context, _ *mcp.CallToolRequest, args inventoryArgs) (*mcp.CallToolResult, any, error) {
|
||||||
entries, err := inventory.List(d, strings.ToLower(strings.TrimSpace(args.Relationship)))
|
entries, err := inventory.List(d, strings.ToLower(strings.TrimSpace(args.Relationship)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ func MentionSuggestions(ms []Mention, p *profile.Profile) []Suggestion {
|
|||||||
kind, label, link := "Product page", "Set up its page", "/sites/pages?kind=product¬es="+url.QueryEscape("A page for "+m.Name+": people name it in their replies.")+"#new"
|
kind, label, link := "Product page", "Set up its page", "/sites/pages?kind=product¬es="+url.QueryEscape("A page for "+m.Name+": people name it in their replies.")+"#new"
|
||||||
if p != nil && slices.ContainsFunc(p.Targets.Technologies, func(t string) bool { return strings.EqualFold(t, m.Name) }) {
|
if p != nil && slices.ContainsFunc(p.Targets.Technologies, func(t string) bool { return strings.EqualFold(t, m.Name) }) {
|
||||||
kind, label = "Alternative page", "Set up an alternative page"
|
kind, label = "Alternative page", "Set up an alternative page"
|
||||||
link = "/sites/pages?kind=alternative¬es=" + url.QueryEscape("For people leaving "+m.Name+": they name it in their replies. Add "+m.Name+" to the Inventory as a competitor first.") + "#new"
|
link = "/sites/pages?kind=alternative¬es=" + url.QueryEscape("For people leaving "+m.Name+": they name it in their replies. Add "+m.Name+" to the Market as a competitor first.") + "#new"
|
||||||
}
|
}
|
||||||
why := fmt.Sprintf("%s named it in their replies, and the site has no page for it.", count(m.People, "person", "people"))
|
why := fmt.Sprintf("%s named it in their replies, and the site has no page for it.", count(m.People, "person", "people"))
|
||||||
if m.Example != "" {
|
if m.Example != "" {
|
||||||
@@ -420,7 +420,7 @@ func SectionIdeas(pages []SectionPage, searches map[string][]seo.QueryRow, siteT
|
|||||||
Key: "section:table:" + pg.Path, Kind: "Add a comparison", Title: pg.Path + " " + pg.Title,
|
Key: "section:table:" + pg.Path, Kind: "Add a comparison", Title: pg.Path + " " + pg.Title,
|
||||||
Why: fmt.Sprintf("Google shows it %s times in 90 days for searches that compare: %s.", seo.Thousands(vsImpr), quoteList(vs, 3)),
|
Why: fmt.Sprintf("Google shows it %s times in 90 days for searches that compare: %s.", seo.Thousands(vsImpr), quoteList(vs, 3)),
|
||||||
Score: sectionScore(vsImpr, rate),
|
Score: sectionScore(vsImpr, rate),
|
||||||
Action: link(table, "Compare, for the searches that bring people here: "+strings.Join(vs[:min(5, len(vs))], "; ")+". Say only what the Inventory and the profile say."),
|
Action: link(table, "Compare, for the searches that bring people here: "+strings.Join(vs[:min(5, len(vs))], "; ")+". Say only what the Market and the profile say."),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ func (s *Server) inventoryList(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.serverError(w, err)
|
s.serverError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.render(w, r, "inventory", page{Title: "Inventory", Nav: "inventory", Data: map[string]any{
|
s.render(w, r, "inventory", page{Title: "Market", Nav: "inventory", Data: map[string]any{
|
||||||
"Entries": entries,
|
"Entries": entries,
|
||||||
"Relationship": rel,
|
"Relationship": rel,
|
||||||
"Relationships": inventory.Relationships,
|
"Relationships": inventory.Relationships,
|
||||||
@@ -94,7 +94,7 @@ func (s *Server) inventorySave(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.render(w, r, "entry", page{Title: title, Nav: "inventory", Error: err.Error(), Data: s.entryForm(e)})
|
s.render(w, r, "entry", page{Title: title, Nav: "inventory", Error: err.Error(), Data: s.entryForm(e)})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
redirect(w, r, "/inventory", "saved")
|
redirect(w, r, "/market", "saved")
|
||||||
}
|
}
|
||||||
|
|
||||||
func entryFromForm(r *http.Request) *inventory.Entry {
|
func entryFromForm(r *http.Request) *inventory.Entry {
|
||||||
@@ -197,11 +197,11 @@ func (s *Server) inventoryDelete(w http.ResponseWriter, r *http.Request) {
|
|||||||
s.serverError(w, err)
|
s.serverError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
redirect(w, r, "/inventory", "deleted")
|
redirect(w, r, "/market", "deleted")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) inventoryImportPage(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) inventoryImportPage(w http.ResponseWriter, r *http.Request) {
|
||||||
s.render(w, r, "import", page{Title: "Import inventory", Nav: "inventory", Data: map[string]any{
|
s.render(w, r, "import", page{Title: "Import into the Market", Nav: "inventory", Data: map[string]any{
|
||||||
"Relationships": inventory.Relationships,
|
"Relationships": inventory.Relationships,
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ func (s *Server) inventoryImport(w http.ResponseWriter, r *http.Request) {
|
|||||||
rel := r.FormValue("relationship")
|
rel := r.FormValue("relationship")
|
||||||
overwrite := r.FormValue("overwrite") == "on"
|
overwrite := r.FormValue("overwrite") == "on"
|
||||||
show := func(errMsg string, res *inventory.ImportResult) {
|
show := func(errMsg string, res *inventory.ImportResult) {
|
||||||
s.render(w, r, "import", page{Title: "Import inventory", Nav: "inventory", Error: errMsg, Data: map[string]any{
|
s.render(w, r, "import", page{Title: "Import into the Market", Nav: "inventory", Error: errMsg, Data: map[string]any{
|
||||||
"Relationships": inventory.Relationships,
|
"Relationships": inventory.Relationships,
|
||||||
"Result": res,
|
"Result": res,
|
||||||
"YAML": r.FormValue("yaml"),
|
"YAML": r.FormValue("yaml"),
|
||||||
@@ -269,7 +269,7 @@ func (s *Server) inventoryExport(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
w.Header().Set("Content-Type", "application/yaml")
|
w.Header().Set("Content-Type", "application/yaml")
|
||||||
w.Header().Set("Content-Disposition", `attachment; filename="supermarket-inventory.yaml"`)
|
w.Header().Set("Content-Disposition", `attachment; filename="supermarket-market.yaml"`)
|
||||||
w.Write(data)
|
w.Write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,20 +15,35 @@ func TestInventoryPrices(t *testing.T) {
|
|||||||
form := url.Values{"name": {"Zendesk"}, "relationship": {"competitor"}, "mention_policy": {"name"},
|
form := url.Values{"name": {"Zendesk"}, "relationship": {"competitor"}, "mention_policy": {"name"},
|
||||||
"price_plan": {"Suite Team", ""}, "price_amount": {"$55", ""}, "price_per": {"per agent per month", ""},
|
"price_plan": {"Suite Team", ""}, "price_amount": {"$55", ""}, "price_per": {"per agent per month", ""},
|
||||||
"price_checked": {"2026-11-20", "2026-11-24"}, "price_source": {"https://zendesk.com/pricing", ""}}
|
"price_checked": {"2026-11-20", "2026-11-24"}, "price_source": {"https://zendesk.com/pricing", ""}}
|
||||||
if rec := postForm(h, "/inventory/save", form); rec.Code != http.StatusSeeOther {
|
if rec := postForm(h, "/market/save", form); rec.Code != http.StatusSeeOther {
|
||||||
t.Fatalf("save: %d %s", rec.Code, rec.Body.String())
|
t.Fatalf("save: %d %s", rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
es, _ := inventory.List(s.DB, "")
|
es, _ := inventory.List(s.DB, "")
|
||||||
if len(es) != 1 || len(es[0].Prices) != 1 || es[0].Prices[0].Amount != "$55" {
|
if len(es) != 1 || len(es[0].Prices) != 1 || es[0].Prices[0].Amount != "$55" {
|
||||||
t.Fatalf("saved: %+v", es)
|
t.Fatalf("saved: %+v", es)
|
||||||
}
|
}
|
||||||
body := do(h, http.MethodGet, "/inventory/"+strconv.FormatInt(es[0].ID, 10), nil, nil).Body.String()
|
body := do(h, http.MethodGet, "/market/"+strconv.FormatInt(es[0].ID, 10), nil, nil).Body.String()
|
||||||
if !strings.Contains(body, `name="price_amount" value="$55"`) || !strings.Contains(body, "Their prices") {
|
if !strings.Contains(body, `name="price_amount" value="$55"`) || !strings.Contains(body, "Their prices") {
|
||||||
t.Errorf("edit page: %s", body)
|
t.Errorf("edit page: %s", body)
|
||||||
}
|
}
|
||||||
form.Set("price_checked", "")
|
form.Set("price_checked", "")
|
||||||
form["price_checked"] = []string{"", ""}
|
form["price_checked"] = []string{"", ""}
|
||||||
if rec := postForm(h, "/inventory/save", form); !strings.Contains(rec.Body.String(), "say when you checked the price $55") && !strings.Contains(rec.Body.String(), "Say when you checked the price $55") {
|
if rec := postForm(h, "/market/save", form); !strings.Contains(rec.Body.String(), "say when you checked the price $55") && !strings.Contains(rec.Body.String(), "Say when you checked the price $55") {
|
||||||
t.Errorf("a price without its date was saved: %d", rec.Code)
|
t.Errorf("a price without its date was saved: %d", rec.Code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The Market was the Inventory: its old addresses lead to the new ones,
|
||||||
|
// keeping the query and a form's POST.
|
||||||
|
func TestMarketMoved(t *testing.T) {
|
||||||
|
_, h := newTestServer(t, nil)
|
||||||
|
for old, want := range map[string]string{"/inventory": "/market", "/inventory/3?x=1": "/market/3?x=1", "/inventory/import": "/market/import"} {
|
||||||
|
rec := do(h, http.MethodGet, old, nil, nil)
|
||||||
|
if rec.Code != http.StatusPermanentRedirect || rec.Header().Get("Location") != want {
|
||||||
|
t.Errorf("%s: %d %s", old, rec.Code, rec.Header().Get("Location"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if rec := postForm(h, "/inventory/save", url.Values{"name": {"X"}}); rec.Code != http.StatusPermanentRedirect || rec.Header().Get("Location") != "/market/save" {
|
||||||
|
t.Errorf("post: %d %s", rec.Code, rec.Header().Get("Location"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ func (s *Server) seoLinksAction(w http.ResponseWriter, r *http.Request) {
|
|||||||
id, _ := strconv.ParseInt(r.PostFormValue("competitor"), 10, 64)
|
id, _ := strconv.ParseInt(r.PostFormValue("competitor"), 10, 64)
|
||||||
e, err := inventory.Get(s.DB, id)
|
e, err := inventory.Get(s.DB, id)
|
||||||
if err != nil || e.Relationship != inventory.Competitor {
|
if err != nil || e.Relationship != inventory.Competitor {
|
||||||
s.renderLinks(w, r, "Choose a competitor from the Inventory.")
|
s.renderLinks(w, r, "Choose a competitor from the Market.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rs, err := s.researcher()
|
rs, err := s.researcher()
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ func (s *Server) dashboard(w http.ResponseWriter, r *http.Request) {
|
|||||||
Detail: ifElse(aiErr == nil, aiCfg.Provider+" · "+aiCfg.Model, "Choose Anthropic or a server on your network; the profile draft and posts need it")},
|
Detail: ifElse(aiErr == nil, aiCfg.Provider+" · "+aiCfg.Model, "Choose Anthropic or a server on your network; the profile draft and posts need it")},
|
||||||
{Label: "Company profile", Done: p.IsSet(), Link: "/settings/profile",
|
{Label: "Company profile", Done: p.IsSet(), Link: "/settings/profile",
|
||||||
Detail: ifElse(p.IsSet(), p.Name, "Describe the company, its products and its customers (the AI can draft it from your website)")},
|
Detail: ifElse(p.IsSet(), p.Name, "Describe the company, its products and its customers (the AI can draft it from your website)")},
|
||||||
{Label: "Inventory", Done: len(entries) > 0, Link: "/inventory",
|
{Label: "Market", Done: len(entries) > 0, Link: "/market",
|
||||||
Detail: inventorySummary(counts)},
|
Detail: inventorySummary(counts)},
|
||||||
{Label: "Social accounts", Done: s.Secrets.Has(secrets.XAccessToken) || s.Secrets.Has(secrets.LinkedInAccessToken) || s.Secrets.Has(secrets.RedditAccessToken),
|
{Label: "Social accounts", Done: s.Secrets.Has(secrets.XAccessToken) || s.Secrets.Has(secrets.LinkedInAccessToken) || s.Secrets.Has(secrets.RedditAccessToken),
|
||||||
Link: "/settings/accounts", Detail: s.connectionSummary(conns)},
|
Link: "/settings/accounts", Detail: s.connectionSummary(conns)},
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ func (s *Server) search(q string) ([]hitGroup, error) {
|
|||||||
if matches(e.Name, e.Description, e.TwitterHandle, e.TalkingPoints, strings.Join(e.Websites, " "),
|
if matches(e.Name, e.Description, e.TwitterHandle, e.TalkingPoints, strings.Join(e.Websites, " "),
|
||||||
strings.Join(e.Hashtags, " "), strings.Join(e.Keywords, " "), strings.Join(e.Subreddits, " ")) {
|
strings.Join(e.Hashtags, " "), strings.Join(e.Keywords, " "), strings.Join(e.Subreddits, " ")) {
|
||||||
inv = append(inv, hit{Title: e.Name, Detail: e.Description,
|
inv = append(inv, hit{Title: e.Name, Detail: e.Description,
|
||||||
Link: "/inventory/" + strconv.FormatInt(e.ID, 10), Badge: e.Relationship})
|
Link: "/market/" + strconv.FormatInt(e.ID, 10), Badge: e.Relationship})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
entryLink := func(name string) string {
|
entryLink := func(name string) string {
|
||||||
@@ -202,7 +202,7 @@ func (s *Server) search(q string) ([]hitGroup, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var groups []hitGroup
|
var groups []hitGroup
|
||||||
for _, g := range []hitGroup{{"Posts", posts}, {"Fetched items", found}, {"Inventory", inv}, {"Prospects", prospectHits}, {"Settings", settings}} {
|
for _, g := range []hitGroup{{"Posts", posts}, {"Fetched items", found}, {"Market", inv}, {"Prospects", prospectHits}, {"Settings", settings}} {
|
||||||
if len(g.Hits) > 0 {
|
if len(g.Hits) > 0 {
|
||||||
groups = append(groups, g)
|
groups = append(groups, g)
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-10
@@ -97,15 +97,19 @@ func (s *Server) Handler() (http.Handler, error) {
|
|||||||
|
|
||||||
mux.HandleFunc("GET /search", s.searchPage)
|
mux.HandleFunc("GET /search", s.searchPage)
|
||||||
|
|
||||||
mux.HandleFunc("GET /inventory", s.inventoryList)
|
mux.HandleFunc("GET /market", s.inventoryList)
|
||||||
mux.HandleFunc("GET /inventory/new", s.inventoryEdit)
|
mux.HandleFunc("GET /market/new", s.inventoryEdit)
|
||||||
mux.HandleFunc("GET /inventory/{id}", s.inventoryEdit)
|
mux.HandleFunc("GET /market/{id}", s.inventoryEdit)
|
||||||
mux.HandleFunc("POST /inventory/save", s.inventorySave)
|
mux.HandleFunc("POST /market/save", s.inventorySave)
|
||||||
mux.HandleFunc("POST /inventory/fill", s.inventoryFill)
|
mux.HandleFunc("POST /market/fill", s.inventoryFill)
|
||||||
mux.HandleFunc("POST /inventory/{id}/delete", s.inventoryDelete)
|
mux.HandleFunc("POST /market/{id}/delete", s.inventoryDelete)
|
||||||
mux.HandleFunc("GET /inventory/import", s.inventoryImportPage)
|
mux.HandleFunc("GET /market/import", s.inventoryImportPage)
|
||||||
mux.HandleFunc("POST /inventory/import", s.inventoryImport)
|
mux.HandleFunc("POST /market/import", s.inventoryImport)
|
||||||
mux.HandleFunc("GET /inventory/export", s.inventoryExport)
|
mux.HandleFunc("GET /market/export", s.inventoryExport)
|
||||||
|
// The Market was the Inventory: its old addresses lead to the new ones
|
||||||
|
// (308 keeps a form's POST a POST).
|
||||||
|
mux.HandleFunc("/inventory", marketMoved)
|
||||||
|
mux.HandleFunc("/inventory/", marketMoved)
|
||||||
|
|
||||||
// Settings: the profile, social accounts, AI, and the Core & Hermes.
|
// Settings: the profile, social accounts, AI, and the Core & Hermes.
|
||||||
mux.HandleFunc("GET /settings", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("GET /settings", func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -476,7 +480,7 @@ func (p page) Section() string {
|
|||||||
case strings.HasPrefix(p.Nav, "settings"):
|
case strings.HasPrefix(p.Nav, "settings"):
|
||||||
return "Settings"
|
return "Settings"
|
||||||
case p.Nav == "inventory":
|
case p.Nav == "inventory":
|
||||||
return "Inventory"
|
return "Market"
|
||||||
case strings.HasPrefix(p.Nav, "sites"):
|
case strings.HasPrefix(p.Nav, "sites"):
|
||||||
return "Sites"
|
return "Sites"
|
||||||
}
|
}
|
||||||
@@ -705,3 +709,10 @@ func ago(t time.Time) string {
|
|||||||
return t.Local().Format("2 Jan 2006")
|
return t.Local().Format("2 Jan 2006")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// marketMoved sends an old /inventory address to its /market one.
|
||||||
|
func marketMoved(w http.ResponseWriter, r *http.Request) {
|
||||||
|
u := *r.URL
|
||||||
|
u.Path = "/market" + strings.TrimPrefix(r.URL.Path, "/inventory")
|
||||||
|
http.Redirect(w, r, u.RequestURI(), http.StatusPermanentRedirect)
|
||||||
|
}
|
||||||
|
|||||||
+10
-10
@@ -95,8 +95,8 @@ func TestEveryPageRenders(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, path := range []string{"/", "/?msg=saved", "/settings/profile", "/inventory", "/inventory?relationship=partner",
|
for _, path := range []string{"/", "/?msg=saved", "/settings/profile", "/market", "/market?relationship=partner",
|
||||||
"/inventory/new", "/inventory/1", "/inventory/import", "/inventory/export",
|
"/market/new", "/market/1", "/market/import", "/market/export",
|
||||||
"/settings/ai", "/settings/accounts", "/settings/core", "/static/app.css", "/favicon.ico", "/static/favicon.png", "/static/logo.png", "/static/apple-touch-icon.png", "/search", "/crm", "/search?q=rival", "/search?q=nothing+here", "/static/htmx.min.js", "/healthz",
|
"/settings/ai", "/settings/accounts", "/settings/core", "/static/app.css", "/favicon.ico", "/static/favicon.png", "/static/logo.png", "/static/apple-touch-icon.png", "/search", "/crm", "/search?q=rival", "/search?q=nothing+here", "/static/htmx.min.js", "/healthz",
|
||||||
"/content", "/content/1", "/content/1?dismissed=1", "/posts", "/posts?msg=drafted",
|
"/content", "/content/1", "/content/1?dismissed=1", "/posts", "/posts?msg=drafted",
|
||||||
"/content/scheduled", "/content/published",
|
"/content/scheduled", "/content/published",
|
||||||
@@ -107,7 +107,7 @@ func TestEveryPageRenders(t *testing.T) {
|
|||||||
t.Errorf("core=%v GET %s: %d %s", c != nil, path, rec.Code, rec.Body.String())
|
t.Errorf("core=%v GET %s: %d %s", c != nil, path, rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rec := do(h, http.MethodGet, "/inventory/999", nil, nil); rec.Code != http.StatusNotFound {
|
if rec := do(h, http.MethodGet, "/market/999", nil, nil); rec.Code != http.StatusNotFound {
|
||||||
t.Errorf("missing entry: %d", rec.Code)
|
t.Errorf("missing entry: %d", rec.Code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry := url.Values{"name": {"Rival"}, "relationship": {"competitor"}, "hashtags": {"rival, #Other"}, "twitter_handle": {"@rival"}}
|
entry := url.Values{"name": {"Rival"}, "relationship": {"competitor"}, "hashtags": {"rival, #Other"}, "twitter_handle": {"@rival"}}
|
||||||
if rec := postForm(h, "/inventory/save", entry); rec.Code != http.StatusSeeOther {
|
if rec := postForm(h, "/market/save", entry); rec.Code != http.StatusSeeOther {
|
||||||
t.Fatalf("save entry: %d %s", rec.Code, rec.Body.String())
|
t.Fatalf("save entry: %d %s", rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
entries, _ := inventory.List(s.DB, "competitor")
|
entries, _ := inventory.List(s.DB, "competitor")
|
||||||
@@ -188,12 +188,12 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
|||||||
t.Fatalf("entry: %+v", entries)
|
t.Fatalf("entry: %+v", entries)
|
||||||
}
|
}
|
||||||
// Same name, different case: refused.
|
// Same name, different case: refused.
|
||||||
rec = postForm(h, "/inventory/save", url.Values{"name": {"RIVAL"}, "relationship": {"partner"}})
|
rec = postForm(h, "/market/save", url.Values{"name": {"RIVAL"}, "relationship": {"partner"}})
|
||||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "already has that name") {
|
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "already has that name") {
|
||||||
t.Errorf("duplicate: %d", rec.Code)
|
t.Errorf("duplicate: %d", rec.Code)
|
||||||
}
|
}
|
||||||
|
|
||||||
rec = postForm(h, "/inventory/import", url.Values{"example": {"federated"}, "relationship": {"watch"}})
|
rec = postForm(h, "/market/import", url.Values{"example": {"federated"}, "relationship": {"watch"}})
|
||||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "21 added") {
|
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "21 added") {
|
||||||
t.Errorf("import example: %d %s", rec.Code, rec.Body.String())
|
t.Errorf("import example: %d %s", rec.Code, rec.Body.String())
|
||||||
}
|
}
|
||||||
@@ -202,7 +202,7 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
|||||||
t.Errorf("example entries are partners: got %d", len(partners))
|
t.Errorf("example entries are partners: got %d", len(partners))
|
||||||
}
|
}
|
||||||
|
|
||||||
if rec := postForm(h, "/inventory/1/delete", nil); rec.Code != http.StatusSeeOther {
|
if rec := postForm(h, "/market/1/delete", nil); rec.Code != http.StatusSeeOther {
|
||||||
t.Errorf("delete: %d", rec.Code)
|
t.Errorf("delete: %d", rec.Code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,17 +384,17 @@ func TestMCPNeedsTokenAndChecksIn(t *testing.T) {
|
|||||||
|
|
||||||
func TestInventoryFillNeedsAI(t *testing.T) {
|
func TestInventoryFillNeedsAI(t *testing.T) {
|
||||||
_, h := newTestServer(t, nil)
|
_, h := newTestServer(t, nil)
|
||||||
if body := do(h, http.MethodGet, "/inventory/new", nil, nil).Body.String(); !strings.Contains(body, `<a href="/settings/ai">set up the AI</a>`) {
|
if body := do(h, http.MethodGet, "/market/new", nil, nil).Body.String(); !strings.Contains(body, `<a href="/settings/ai">set up the AI</a>`) {
|
||||||
t.Error("new entry without AI: no warning")
|
t.Error("new entry without AI: no warning")
|
||||||
}
|
}
|
||||||
// The form comes back with what was typed, and says why.
|
// The form comes back with what was typed, and says why.
|
||||||
rec := postForm(h, "/inventory/fill", url.Values{"name": {"Rival"}, "relationship": {"competitor"},
|
rec := postForm(h, "/market/fill", url.Values{"name": {"Rival"}, "relationship": {"competitor"},
|
||||||
"description": {"Typed."}, "draft_url": {"https://rival.example"}})
|
"description": {"Typed."}, "draft_url": {"https://rival.example"}})
|
||||||
body := rec.Body.String()
|
body := rec.Body.String()
|
||||||
if rec.Code != http.StatusOK || !strings.Contains(body, "AI provider not configured") || !strings.Contains(body, "Typed.") {
|
if rec.Code != http.StatusOK || !strings.Contains(body, "AI provider not configured") || !strings.Contains(body, "Typed.") {
|
||||||
t.Errorf("fill without AI: %d", rec.Code)
|
t.Errorf("fill without AI: %d", rec.Code)
|
||||||
}
|
}
|
||||||
rec = postForm(h, "/inventory/fill", url.Values{"name": {"Rival"}})
|
rec = postForm(h, "/market/fill", url.Values{"name": {"Rival"}})
|
||||||
if !strings.Contains(rec.Body.String(), "Enter their website") {
|
if !strings.Contains(rec.Body.String(), "Enter their website") {
|
||||||
t.Error("fill without a website: no message")
|
t.Error("fill without a website: no message")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ func (s *Server) pageInputs(p *sites.SitePage, prof *profile.Profile) (sites.Inp
|
|||||||
if id := p.Source.Competitor; id != 0 {
|
if id := p.Source.Competitor; id != 0 {
|
||||||
e, err := inventory.Get(s.DB, id)
|
e, err := inventory.Get(s.DB, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return in, "", errors.New("that competitor isn't in the Inventory any more")
|
return in, "", errors.New("that competitor isn't in the Market any more")
|
||||||
}
|
}
|
||||||
in.Competitor = e
|
in.Competitor = e
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}
|
{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$d := .}}
|
||||||
<h2>Backups</h2>
|
<h2>Backups</h2>
|
||||||
<p class="lede">Copies of Supermarket's database: your profile, inventory, signals, prospects, drafts, SEO and metrics. Each one is a single SQLite file. Your keys and tokens aren't in them; they stay in <code>secrets.json</code>.</p>
|
<p class="lede">Copies of Supermarket's database: your profile, the Market, signals, prospects, drafts, SEO and metrics. Each one is a single SQLite file. Your keys and tokens aren't in them; they stay in <code>secrets.json</code>.</p>
|
||||||
|
|
||||||
{{with .Restored}}<p class="ok">Restored from {{.From}} {{ago .At}}{{if .Secrets}}, keys and tokens included{{end}}. What was there before is backed up as {{.Backup}}.</p>{{end}}
|
{{with .Restored}}<p class="ok">Restored from {{.From}} {{ago .At}}{{if .Secrets}}, keys and tokens included{{end}}. What was there before is backed up as {{.Backup}}.</p>{{end}}
|
||||||
{{if .Pending}}
|
{{if .Pending}}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<form method="post" action="{{.Base}}/fetch" data-busy="Fetching…">
|
<form method="post" action="{{.Base}}/fetch" data-busy="Fetching…">
|
||||||
<button type="submit" {{if not .Sources}}disabled{{end}}>Fetch new</button>
|
<button type="submit" {{if not .Sources}}disabled{{end}}>Fetch new</button>
|
||||||
</form>
|
</form>
|
||||||
{{if .Own}}<a class="button secondary" href="/settings/profile">Edit profile</a>{{else}}<a class="button secondary" href="/inventory/{{.Entry.ID}}">Edit entry</a>{{end}}
|
{{if .Own}}<a class="button secondary" href="/settings/profile">Edit profile</a>{{else}}<a class="button secondary" href="/market/{{.Entry.ID}}">Edit entry</a>{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="lede">
|
<p class="lede">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{define "content"}}{{with .Data}}
|
{{define "content"}}{{with .Data}}
|
||||||
<h1>Sources</h1>
|
<h1>Sources</h1>
|
||||||
<p class="lede">Pick an inventory entry to fetch its latest news, choose what to write about, and get a draft for each channel to review under <a href="/posts">Posts</a>.</p>
|
<p class="lede">Pick a Market entry to fetch its latest news, choose what to write about, and get a draft for each channel to review under <a href="/posts">Posts</a>.</p>
|
||||||
|
|
||||||
{{if .Rows}}
|
{{if .Rows}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
<td><a href="/content/{{.Entry.ID}}">{{.Name}}</a></td>
|
<td><a href="/content/{{.Entry.ID}}">{{.Name}}</a></td>
|
||||||
<td><span class="badge {{.Entry.Relationship}}">{{.Entry.Relationship}}</span></td>
|
<td><span class="badge {{.Entry.Relationship}}">{{.Entry.Relationship}}</span></td>
|
||||||
<td>{{if .Sources}}{{join .Sources ", "}}{{else}}<span class="muted">none: <a href="/inventory/{{.Entry.ID}}">add some</a></span>{{end}}</td>
|
<td>{{if .Sources}}{{join .Sources ", "}}{{else}}<span class="muted">none: <a href="/market/{{.Entry.ID}}">add some</a></span>{{end}}</td>
|
||||||
{{end}}
|
{{end}}
|
||||||
<td>{{if .Waiting}}{{.Waiting}}{{end}}</td>
|
<td>{{if .Waiting}}{{.Waiting}}{{end}}</td>
|
||||||
<td>{{ago .LastChecked}}</td>
|
<td>{{ago .LastChecked}}</td>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
<section class="card empty">
|
<section class="card empty">
|
||||||
<p>Add the partners and competitors you post about to the <a href="/inventory">Inventory</a> first.</p>
|
<p>Add the partners and competitors you post about to the <a href="/market">Market</a> first.</p>
|
||||||
</section>
|
</section>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{{define "content"}}{{with .Data}}{{$d := .}}{{$e := .E}}
|
{{define "content"}}{{with .Data}}{{$d := .}}{{$e := .E}}
|
||||||
<p><a href="/inventory">← Inventory</a></p>
|
<p><a href="/market">← Market</a></p>
|
||||||
<h1>{{if $e.ID}}{{$e.Name}}{{else}}New entry{{end}}</h1>
|
<h1>{{if $e.ID}}{{$e.Name}}{{else}}New entry{{end}}</h1>
|
||||||
|
|
||||||
<form method="post" action="/inventory/save" data-busy-on="fill" data-busy="Reading their website…">
|
<form method="post" action="/market/save" data-busy-on="fill" data-busy="Reading their website…">
|
||||||
<input type="hidden" name="id" value="{{$e.ID}}">
|
<input type="hidden" name="id" value="{{$e.ID}}">
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<h2>Fill in with AI</h2>
|
<h2>Fill in with AI</h2>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
{{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}}
|
{{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">
|
<div class="row">
|
||||||
<input name="draft_url" type="text" inputmode="url" value="{{.DraftURL}}" placeholder="https://example.com" aria-label="Their website">
|
<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="/inventory/fill" formnovalidate {{if .NoAI}}disabled{{end}}>Fill in the empty boxes</button>
|
<button type="submit" name="action" value="fill" class="secondary" formaction="/market/fill" formnovalidate {{if .NoAI}}disabled{{end}}>Fill in the empty boxes</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="help">Takes up to a minute or two.</p>
|
<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}}
|
{{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}}
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
{{if $e.ID}}
|
{{if $e.ID}}
|
||||||
<form method="post" action="/inventory/{{$e.ID}}/delete" class="danger-zone" data-confirm="Delete {{$e.Name}} from the inventory?">
|
<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>
|
<button type="submit" class="danger">Delete {{$e.Name}}</button>
|
||||||
</form>
|
</form>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
{{define "content"}}{{with .Data}}
|
{{define "content"}}{{with .Data}}
|
||||||
<p><a href="/inventory">← Inventory</a></p>
|
<p><a href="/market">← Market</a></p>
|
||||||
<h1>Import inventory</h1>
|
<h1>Import into the Market</h1>
|
||||||
|
|
||||||
{{with .Result}}
|
{{with .Result}}
|
||||||
<section class="card {{if .Errors}}warn{{end}}">
|
<section class="card {{if .Errors}}warn{{end}}">
|
||||||
<p>{{.Added}} added, {{.Updated}} updated, {{.Skipped}} skipped (already in the inventory).</p>
|
<p>{{.Added}} added, {{.Updated}} updated, {{.Skipped}} skipped (already in the Market).</p>
|
||||||
{{if .Errors}}<ul>{{range .Errors}}<li>{{.}}</li>{{end}}</ul>{{end}}
|
{{if .Errors}}<ul>{{range .Errors}}<li>{{.}}</li>{{end}}</ul>{{end}}
|
||||||
<p><a href="/inventory">See the inventory</a></p>
|
<p><a href="/market">See the Market</a></p>
|
||||||
</section>
|
</section>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<form class="card" method="post" action="/inventory/import" enctype="multipart/form-data">
|
<form class="card" method="post" action="/market/import" enctype="multipart/form-data">
|
||||||
<p>YAML: a list of entries, or a document with an <code>inventory:</code> list. The old app's <code>config.yaml</code> works too (its <code>applications:</code> list).</p>
|
<p>YAML: a list of entries, or a document with an <code>inventory:</code> list. The old app's <code>config.yaml</code> works too (its <code>applications:</code> list).</p>
|
||||||
<label>Paste <textarea name="yaml" rows="12" placeholder="inventory:
|
<label>Paste <textarea name="yaml" rows="12" placeholder="inventory:
|
||||||
- name: Example
|
- name: Example
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{{define "content"}}{{with .Data}}
|
{{define "content"}}{{with .Data}}
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
<h1>Inventory</h1>
|
<h1>Market</h1>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<a class="button" href="/inventory/new">New entry</a>
|
<a class="button" href="/market/new">New entry</a>
|
||||||
<a class="button secondary" href="/inventory/import">Import</a>
|
<a class="button secondary" href="/market/import">Import</a>
|
||||||
<a class="button secondary" href="/inventory/export">Export</a>
|
<a class="button secondary" href="/market/export">Export</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p class="lede"><strong>Partners</strong>: Supermarket amplifies their news.
|
<p class="lede"><strong>Partners</strong>: Supermarket amplifies their news.
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
<strong>Watch</strong>: news to curate, no promotion either way.</p>
|
<strong>Watch</strong>: news to curate, no promotion either way.</p>
|
||||||
|
|
||||||
<nav class="tabs">
|
<nav class="tabs">
|
||||||
<a href="/inventory" {{if eq .Relationship ""}}aria-current="page"{{end}}>All</a>
|
<a href="/market" {{if eq .Relationship ""}}aria-current="page"{{end}}>All</a>
|
||||||
{{$cur := .Relationship}}
|
{{$cur := .Relationship}}
|
||||||
{{range .Relationships}}<a href="/inventory?relationship={{.}}" {{if eq $cur .}}aria-current="page"{{end}}>{{.}}</a>{{end}}
|
{{range .Relationships}}<a href="/market?relationship={{.}}" {{if eq $cur .}}aria-current="page"{{end}}>{{.}}</a>{{end}}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{{if .Entries}}
|
{{if .Entries}}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{range .Entries}}
|
{{range .Entries}}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/inventory/{{.ID}}">{{.Name}}</a></td>
|
<td><a href="/market/{{.ID}}">{{.Name}}</a></td>
|
||||||
<td><span class="badge {{.Relationship}}">{{.Relationship}}</span></td>
|
<td><span class="badge {{.Relationship}}">{{.Relationship}}</span></td>
|
||||||
<td>{{if .TwitterHandle}}@{{.TwitterHandle}}{{end}}</td>
|
<td>{{if .TwitterHandle}}@{{.TwitterHandle}}{{end}}</td>
|
||||||
<td>{{if .YouTubeChannelID}}✓{{end}}</td>
|
<td>{{if .YouTubeChannelID}}✓{{end}}</td>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
<section class="card empty">
|
<section class="card empty">
|
||||||
<p>Nothing here yet. Add the partners and competitors you post about, or <a href="/inventory/import">import a list</a>.</p>
|
<p>Nothing here yet. Add the partners and competitors you post about, or <a href="/market/import">import a list</a>.</p>
|
||||||
</section>
|
</section>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<nav class="nav" aria-label="Main">
|
<nav class="nav" aria-label="Main">
|
||||||
<a href="/" {{if eq .Nav "home"}}aria-current="page"{{end}}>{{template "icon" "overview"}}<span>Overview</span></a>
|
<a href="/" {{if eq .Nav "home"}}aria-current="page"{{end}}>{{template "icon" "overview"}}<span>Overview</span></a>
|
||||||
<a href="/inventory" {{if eq .Nav "inventory"}}aria-current="page"{{end}}>{{template "icon" "inventory"}}<span>Inventory</span></a>
|
<a href="/market" {{if eq .Nav "inventory"}}aria-current="page"{{end}}>{{template "icon" "inventory"}}<span>Market</span></a>
|
||||||
|
|
||||||
<div class="nav-label">Modules</div>
|
<div class="nav-label">Modules</div>
|
||||||
{{$nav := .Nav}}{{$inbox := .Inbox}}
|
{{$nav := .Nav}}{{$inbox := .Inbox}}
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<button type="button" class="icon-button menu-button" data-nav-toggle aria-controls="sidebar" aria-label="Open navigation">{{template "icon" "menu"}}</button>
|
<button type="button" class="icon-button menu-button" data-nav-toggle aria-controls="sidebar" aria-label="Open navigation">{{template "icon" "menu"}}</button>
|
||||||
<nav class="crumbs" aria-label="Breadcrumb">
|
<nav class="crumbs" aria-label="Breadcrumb">
|
||||||
{{with .Section}}<span>{{.}}</span><span class="sep" aria-hidden="true">/</span>{{end}}
|
{{with .Section}}{{if ne . $.Title}}<span>{{.}}</span><span class="sep" aria-hidden="true">/</span>{{end}}{{end}}
|
||||||
<span class="here">{{.Title}}</span>
|
<span class="here">{{.Title}}</span>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{define "content"}}{{with .Data}}
|
{{define "content"}}{{with .Data}}
|
||||||
<div class="page-head">
|
<div class="page-head">
|
||||||
<h1>Search</h1>
|
<h1>Search</h1>
|
||||||
<p class="lede">Posts, fetched items, the inventory, your products and settings.</p>
|
<p class="lede">Posts, fetched items, the Market, your products and settings.</p>
|
||||||
</div>
|
</div>
|
||||||
<form class="search-page" action="/search" method="get" role="search">
|
<form class="search-page" action="/search" method="get" role="search">
|
||||||
<input type="search" name="q" value="{{.Q}}" placeholder="e.g. a company, a product, or words from a post" aria-label="Search for" autofocus>
|
<input type="search" name="q" value="{{.Q}}" placeholder="e.g. a company, a product, or words from a post" aria-label="Search for" autofocus>
|
||||||
|
|||||||
@@ -88,10 +88,10 @@
|
|||||||
|
|
||||||
<section class="card" id="opportunities">
|
<section class="card" id="opportunities">
|
||||||
<h2>Where to win a link</h2>
|
<h2>Where to win a link</h2>
|
||||||
<p class="small">Pages that list others like you but not you: your Inventory partners' pages of providers and hosts, and lists of alternatives to your competitors. Nothing is sent from here: open the page, ask them (a short, friendly note usually does it), and mark it. When the link shows up (Bing, or a check), it's marked won.</p>
|
<p class="small">Pages that list others like you but not you: your Market partners' pages of providers and hosts, and lists of alternatives to your competitors. Nothing is sent from here: open the page, ask them (a short, friendly note usually does it), and mark it. When the link shows up (Bing, or a check), it's marked won.</p>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form method="post" action="/seo/links/partners?site={{$d.Current.Index}}" data-busy="Reading their pages…"><button type="submit" class="secondary small" {{if not $d.Partners}}disabled{{end}}>Look at the partners' pages</button></form>
|
<form method="post" action="/seo/links/partners?site={{$d.Current.Index}}" data-busy="Reading their pages…"><button type="submit" class="secondary small" {{if not $d.Partners}}disabled{{end}}>Look at the partners' pages</button></form>
|
||||||
<span class="small muted">{{if $d.Partners}}{{$d.Partners}} {{if eq $d.Partners 1}}partner{{else}}partners{{end}} in the Inventory; looked at once a month by itself.{{else}}No partners in the <a href="/inventory">Inventory</a> yet: add the projects and companies you work with, with their websites.{{end}}</span>
|
<span class="small muted">{{if $d.Partners}}{{$d.Partners}} {{if eq $d.Partners 1}}partner{{else}}partners{{end}} in the Market; looked at once a month by itself.{{else}}No partners in the <a href="/market">Market</a> yet: add the projects and companies you work with, with their websites.{{end}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{with $d.Competitors}}
|
{{with $d.Competitors}}
|
||||||
<form method="post" action="/seo/links/alternatives?site={{$d.Current.Index}}" class="row" data-busy="Searching…">
|
<form method="post" action="/seo/links/alternatives?site={{$d.Current.Index}}" class="row" data-busy="Searching…">
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
<button type="submit" class="secondary small" {{if $d.Research}}disabled{{end}}>Find them (up to 4 web searches)</button>
|
<button type="submit" class="secondary small" {{if $d.Research}}disabled{{end}}>Find them (up to 4 web searches)</button>
|
||||||
{{with $d.Research}}<span class="small warn-text">{{.}}</span>{{end}}
|
{{with $d.Research}}<span class="small warn-text">{{.}}</span>{{end}}
|
||||||
</form>
|
</form>
|
||||||
{{else}}<p class="small muted">Add competitors to the <a href="/inventory">Inventory</a> to look for lists of alternatives to them.</p>{{end}}
|
{{else}}<p class="small muted">Add competitors to the <a href="/market">Market</a> to look for lists of alternatives to them.</p>{{end}}
|
||||||
{{with $d.Opportunities}}
|
{{with $d.Opportunities}}
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead><tr><th>Page</th><th>Why</th><th>Status</th><th></th></tr></thead>
|
<thead><tr><th>Page</th><th>Why</th><th>Status</th><th></th></tr></thead>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{define "content"}}{{with .Data}}{{$d := .}}
|
{{define "content"}}{{with .Data}}{{$d := .}}
|
||||||
<p><a href="/sites{{with .Current}}?site={{.Index}}{{end}}">← Sections and pages</a></p>
|
<p><a href="/sites{{with .Current}}?site={{.Index}}{{end}}">← Sections and pages</a></p>
|
||||||
<h1>Add a section</h1>
|
<h1>Add a section</h1>
|
||||||
<p class="lede">One more section on a page that's already on the site, of one of the site's own types: a FAQ for the questions people search, a comparison table, more features. The AI writes it from the page, your profile and the Inventory, with the same rules as a new page: nothing invented, claims of experience to confirm, a pull request that adds only that section.</p>
|
<p class="lede">One more section on a page that's already on the site, of one of the site's own types: a FAQ for the questions people search, a comparison table, more features. The AI writes it from the page, your profile and the Market, with the same rules as a new page: nothing invented, claims of experience to confirm, a pull request that adds only that section.</p>
|
||||||
{{with .Page}}
|
{{with .Page}}
|
||||||
<form method="post" action="/sites/pages/add?site={{$d.Current.Index}}" class="card" data-busy="Reading the page and writing…">
|
<form method="post" action="/sites/pages/add?site={{$d.Current.Index}}" class="card" data-busy="Reading the page and writing…">
|
||||||
<input type="hidden" name="page" value="{{.Path}}">
|
<input type="hidden" name="page" value="{{.Path}}">
|
||||||
|
|||||||
Reference in New Issue
Block a user