← back to Commercialrealestate
residential-brokers: always show broker phone+email (TK-10703)
90f39542723efc0b16f96261e9050592217cd897 · 2026-08-18 18:25:02 -0700 · Steve Abrams
Files touched
M public/residential-brokers.html
Diff
commit 90f39542723efc0b16f96261e9050592217cd897
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Aug 18 18:25:02 2026 -0700
residential-brokers: always show broker phone+email (TK-10703)
---
public/residential-brokers.html | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/public/residential-brokers.html b/public/residential-brokers.html
index 9edc505..b21d2e1 100644
--- a/public/residential-brokers.html
+++ b/public/residential-brokers.html
@@ -31,6 +31,12 @@
.row{color:var(--muted);font-size:11.5px;margin:1px 0}
.row b{color:var(--ink);font-weight:500}
.pill{display:inline-block;font-size:10px;padding:1px 7px;border-radius:10px;background:#1a2130;color:var(--muted);border:1px solid var(--line);margin-top:6px}
+ /* always-visible broker contact (Steve HARD RULE: every card shows phone + email) */
+ .contact{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:7px;padding-top:7px;border-top:1px solid var(--line);font-size:11.5px}
+ .contact a{color:var(--accent);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
+ .contact a:hover{text-decoration:underline}
+ .contact .tier{font-size:9.5px;color:var(--muted);opacity:.8}
+ .contact .none{color:var(--muted)}
.empty{color:var(--muted);padding:40px;text-align:center}
</style>
<link rel="stylesheet" href="/crcp-theme.css"><!-- CRCP day/night tokens: load LAST so html[data-theme] wins -->
@@ -102,11 +108,31 @@ function draw(){
}).join('');
const firm = !state.off.firm && r.firm_name ? `<div class="fm">${esc(r.firm_name)}</div>` : '';
const cls = !state.off.class && r.asset_class ? `<span class="pill">${esc(r.asset_class)}</span>` : '';
- return `<div class="card"><div class="nm">${esc(r.name||'—')}</div>${firm}${lines}${cls}</div>`;
+ return `<div class="card"><div class="nm">${esc(r.name||'—')}</div>${firm}${lines}${cls}${contact(r)}</div>`;
}).join('');
}
function esc(s){ return String(s).replace(/[&<>"]/g,c=>({'&':'&','<':'<','>':'>','"':'"'}[c])); }
+// ── broker contact (Steve HARD RULE: ALWAYS show broker phone + email, always visible) ──
+// The /api/residential-brokers row already resolves phone/email (broker→firm) with a phone_tier,
+// so no client-side join is needed. Fall back to a directory/profile link, NEVER fabricate.
+function contact(r){
+ const phone = r.phone || r.broker_phone || r.firm_phone || '';
+ const email = r.email || r.broker_email || r.firm_email || '';
+ const tier = r.phone_tier==='direct' ? 'direct' : (phone ? 'firm' : '');
+ const site = r.broker_website || r.firm_website || '';
+ let ph = phone
+ ? `<a href="tel:${esc(phone.replace(/[^0-9+]/g,''))}" onclick="event.stopPropagation()">📞 ${esc(phone)}</a>${tier?`<span class="tier">${esc(tier)}</span>`:''}`
+ : '<span class="none">📞 —</span>';
+ let em = email
+ ? `<a href="mailto:${esc(email)}" onclick="event.stopPropagation()">✉️ ${esc(email)}</a>`
+ : '<span class="none">✉️ —</span>';
+ let dir = (!phone && !email && site && /^https?:/i.test(site))
+ ? `<a href="${esc(site)}" target="_blank" rel="noopener noreferrer" onclick="event.stopPropagation()">🌐 contact via directory ↗</a>`
+ : '';
+ return `<div class="contact">${ph}${em}${dir}</div>`;
+}
+
async function load(){
$('count').textContent='loading…';
const p=new URLSearchParams({state:state.state,limit:'500'});
← ebdd253 auto-data-snapshot: 2026-08-18T18:16:14 (3 data files) — dat
·
back to Commercialrealestate
·
CRCP filters: responsive hybrid (collapsed rail desktop / ⚙ f97fd3d →