Schema 6 adds prospect_companies, prospect_contacts (merged by domain and email, each with its source, detail and date) and suppressions. Prospects -> Review lists New, Accepted and Set aside: accepting a company queues an EspoCRM Account, a person a Lead at their company, with provenance and why they fit in the description; the page warns about records already in the CRM as of the last sync, and shows each accepted prospect's CRM progress. Prospects can be added by hand. The suppression list (emails and domains) is checked on add and again before queueing, and suppressing sets matching new prospects aside. Search finds prospects too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
122 lines
7.5 KiB
HTML
122 lines
7.5 KiB
HTML
{{define "content"}}{{with .Data}}{{$tab := .Tab}}{{$matches := .Matches}}
|
|
<div class="heading">
|
|
<h1>Review prospects</h1>
|
|
<div class="buttons">
|
|
<a class="button" href="/prospects/new">Add a prospect</a>
|
|
</div>
|
|
</div>
|
|
<p class="lede">Companies and people who may fit your targets. Nothing goes to your CRM until you accept it: accepting a company adds an Account, accepting a person adds a Lead, through <a href="/crm">the CRM queue</a>. Each one keeps where and when it was found.</p>
|
|
|
|
<nav class="tabs">
|
|
{{range .Statuses}}<a href="/prospects?status={{.}}" {{if eq $tab .}}aria-current="page"{{end}}>{{if eq . "new"}}New{{else if eq . "accepted"}}Accepted{{else}}Set aside{{end}}{{with index $.Data.Counts .}} <span class="muted">{{.}}</span>{{end}}</a>{{end}}
|
|
</nav>
|
|
|
|
{{if and (eq $tab "new") (or .Companies .Loose)}}
|
|
<p class="help">{{if .Synced.IsZero}}Your CRM hasn't been synced yet, so Supermarket can't warn you about records you already have.{{else}}Checked against your CRM as of {{ago .Synced}}.{{end}}</p>
|
|
{{end}}
|
|
|
|
{{range .Companies}}{{$c := .}}
|
|
<section class="card prospect">
|
|
<div class="prospect-head">
|
|
<div>
|
|
<h2>{{.Name}}{{if ne .Status $tab}} <span class="badge">{{template "prospect-status" .Status}}</span>{{end}}</h2>
|
|
<p class="meta">
|
|
{{with .Website}}<a href="{{.}}" target="_blank" rel="noopener noreferrer">{{$c.Domain}}</a>{{end}}
|
|
{{with .Industry}} · {{.}}{{end}}{{with .Size}} · {{.}}{{end}}{{with .Location}} · {{.}}{{end}}
|
|
{{with .LinkedIn}} · <a href="{{.}}" target="_blank" rel="noopener noreferrer">LinkedIn</a>{{end}}
|
|
</p>
|
|
</div>
|
|
{{if eq .Status $tab}}
|
|
<div class="row-actions">
|
|
{{if eq $tab "new"}}
|
|
{{if .Contacts}}<form method="post" action="/prospects/company/{{.ID}}/accept-all"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="small">Accept with {{len .Contacts}} {{if eq (len .Contacts) 1}}person{{else}}people{{end}}</button></form>{{end}}
|
|
<form method="post" action="/prospects/company/{{.ID}}/accept"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="small {{if .Contacts}}secondary{{end}}">Accept {{if .Contacts}}company only{{else}}company{{end}}</button></form>
|
|
<form method="post" action="/prospects/company/{{.ID}}/reject"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Set aside</button></form>
|
|
{{if .Domain}}<form method="post" action="/prospects/company/{{.ID}}/suppress" data-confirm="Never add anyone at {{.Domain}}? This puts the domain on your suppression list."><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Suppress {{.Domain}}</button></form>{{end}}
|
|
{{else if eq $tab "accepted"}}
|
|
{{template "crm-state" dict "CRM" .CRM "Kind" "company" "ID" .ID "Tab" $tab}}
|
|
{{else}}
|
|
<form method="post" action="/prospects/company/{{.ID}}/reconsider"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Reconsider</button></form>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{with .Why}}<p class="why">{{.}}</p>{{end}}
|
|
<p class="meta">{{template "provenance" .}}</p>
|
|
{{with index $matches (printf "company:%d" .ID)}}{{template "crm-matches" .}}{{end}}
|
|
|
|
{{if .Contacts}}
|
|
<ul class="items people">
|
|
{{range .Contacts}}{{template "contact" dict "P" . "Tab" $tab "Matches" $matches}}{{end}}
|
|
</ul>
|
|
{{end}}
|
|
{{if eq $tab "new"}}<p class="small"><a href="/prospects/new?company={{.ID}}">Add a person at {{.Name}}</a></p>{{end}}
|
|
</section>
|
|
{{end}}
|
|
|
|
{{if .Loose}}
|
|
<section class="card prospect">
|
|
<h2>People without a company</h2>
|
|
<ul class="items people">
|
|
{{range .Loose}}{{template "contact" dict "P" . "Tab" $tab "Matches" $matches}}{{end}}
|
|
</ul>
|
|
</section>
|
|
{{end}}
|
|
|
|
{{if not (or .Companies .Loose)}}
|
|
<section class="card empty">
|
|
{{if eq $tab "new"}}<p>Nothing to review. <a href="/prospects/new">Add a prospect</a> by hand; finding them for you comes next.</p>
|
|
{{else if eq $tab "accepted"}}<p>Nothing accepted yet.</p>
|
|
{{else}}<p>Nothing set aside.</p>{{end}}
|
|
</section>
|
|
{{end}}
|
|
{{end}}{{end}}
|
|
|
|
{{define "contact"}}{{$p := .P}}{{$tab := .Tab}}
|
|
<li class="item">
|
|
<div class="prospect-head">
|
|
<div>
|
|
<strong>{{$p.Name}}</strong>{{with $p.Title}} · {{.}}{{end}}{{if ne $p.Status $tab}} <span class="badge">{{template "prospect-status" $p.Status}}</span>{{end}}
|
|
<div class="meta">
|
|
{{with $p.Email}}<a href="mailto:{{.}}">{{.}}</a>{{if eq $p.EmailStatus "valid"}} <span class="badge published">verified</span>{{else if eq $p.EmailStatus "risky"}} <span class="badge">risky</span>{{else if eq $p.EmailStatus "invalid"}} <span class="badge failed">bounces</span>{{else}} <span class="muted">not verified</span>{{end}}{{end}}
|
|
{{with $p.Phone}} · {{.}}{{end}}
|
|
{{with $p.LinkedIn}} · <a href="{{.}}" target="_blank" rel="noopener noreferrer">LinkedIn</a>{{end}}
|
|
</div>
|
|
<div class="meta">{{template "provenance" $p}}</div>
|
|
{{with index .Matches (printf "contact:%d" $p.ID)}}{{template "crm-matches" .}}{{end}}
|
|
</div>
|
|
{{if eq $p.Status $tab}}
|
|
<div class="row-actions">
|
|
{{if eq $tab "new"}}
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/accept"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="small">Accept</button></form>
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/reject"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Set aside</button></form>
|
|
{{if $p.Email}}<form method="post" action="/prospects/contact/{{$p.ID}}/suppress" data-confirm="Never add {{$p.Email}}? This puts the address on your suppression list."><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Suppress</button></form>{{end}}
|
|
{{else if eq $tab "accepted"}}
|
|
{{template "crm-state" dict "CRM" $p.CRM "Kind" "contact" "ID" $p.ID "Tab" $tab}}
|
|
{{else}}
|
|
<form method="post" action="/prospects/contact/{{$p.ID}}/reconsider"><input type="hidden" name="tab" value="{{$tab}}"><button type="submit" class="secondary small">Reconsider</button></form>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</li>
|
|
{{end}}
|
|
|
|
{{define "prospect-status"}}{{if eq . "new"}}new{{else if eq . "accepted"}}accepted{{else}}set aside{{end}}{{end}}
|
|
|
|
{{define "provenance"}}{{if eq .Source "manual"}}Added by hand{{else}}Found by {{.Source}}{{end}} {{ago .FoundAt}}{{with .SourceDetail}} · {{if or (hasPrefix . "https://") (hasPrefix . "http://")}}<a href="{{.}}" target="_blank" rel="noopener noreferrer">source</a>{{else}}{{.}}{{end}}{{end}}{{end}}
|
|
|
|
{{define "crm-matches"}}
|
|
<p class="warnings">Already in your CRM: {{range $i, $r := .}}{{if $i}}, {{end}}{{$r.Entity}} <strong>{{$r.Name}}</strong>{{with $r.Email}} ({{.}}){{end}}{{end}}.</p>
|
|
{{end}}
|
|
|
|
{{define "crm-state"}}
|
|
{{if eq .CRM.Status "done"}}<span class="badge published">{{if eq .CRM.Outcome "existing"}}already in the CRM{{else}}in the CRM{{end}}</span>
|
|
{{else if eq .CRM.Status "failed"}}<span class="badge failed">failed</span> <a class="small" href="/crm">CRM queue</a>
|
|
{{else if eq .CRM.Status "cancelled"}}<span class="badge">cancelled</span>
|
|
<form method="post" action="/prospects/{{.Kind}}/{{.ID}}/accept"><input type="hidden" name="tab" value="{{.Tab}}"><button type="submit" class="secondary small">Queue again</button></form>
|
|
{{else if eq .CRM.Status "claimed"}}<span class="badge scheduled">with Hermes</span>
|
|
{{else if .CRM.Status}}<span class="badge draft">waiting for Hermes</span>
|
|
{{else}}<span class="badge">accepted</span>{{end}}
|
|
{{end}}
|