← back to Commercialrealestate
contractors: always show email alongside phone (TK-10703)
2681078bc04f18522539a4cf461b66e8cf6f0179 · 2026-08-18 18:26:47 -0700 · Steve Abrams
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
M public/contractors.html
Diff
commit 2681078bc04f18522539a4cf461b66e8cf6f0179
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Aug 18 18:26:47 2026 -0700
contractors: always show email alongside phone (TK-10703)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
public/contractors.html | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/public/contractors.html b/public/contractors.html
index 655439b..6173dfb 100644
--- a/public/contractors.html
+++ b/public/contractors.html
@@ -193,9 +193,22 @@ function classTags(c){
if(prim)push(prim); all.forEach(push);
return tags.length?`<div class="classrow">${tags.join('')}</div>`:'';
}
+// Steve's hard rule: ALWAYS show phone AND email, both clickable, on every card.
+// CSLB public license data carries phone but NO email address, so email is future-proofed:
+// render a mailto: whenever the row (or a joined broker record) supplies one, else an honest
+// "not on the CSLB record" note — styled like phone, never fabricated.
+function emailOf(c){
+ const cand=[c.email,c.contact_email,c.business_email,c.owner_email,c.e_mail,c.mail];
+ for(const v of cand){if(v&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(String(v).trim()))return String(v).trim();}
+ return '';
+}
function card(c){
const county=c.county||''; const city=c.city||'';
- const phone=c.phone?`<span class="i">☎ <a class="ddrill" href="tel:${esc(c.phone)}"><b>${esc(c.phone)}</b></a></span>`:'';
+ const phone=c.phone?`<span class="i">☎ <a class="ddrill" href="tel:${esc(c.phone)}"><b>${esc(c.phone)}</b></a></span>`
+ :`<span class="i" style="color:var(--mut)" title="No phone on the CSLB record">☎ <span>—</span></span>`;
+ const emailV=emailOf(c);
+ const email=emailV?`<span class="i">✉️ <a class="ddrill" href="mailto:${esc(emailV)}"><b>${esc(emailV)}</b></a></span>`
+ :`<span class="i" style="color:var(--mut)" title="Email is not part of the public CSLB license record — verify contact at cslb.ca.gov">✉️ <span>not on CSLB record</span></span>`;
const cityD=city?`<span class="i" data-drillf="city" data-drillv="${esc(city)}">📍 <a class="ddrill" href="?city=${encodeURIComponent(city)}" title="All contractors in ${esc(city)}">${esc(city)}</a></span>`:'';
const countyD=county?`<span class="i" data-drillf="county" data-drillv="${esc(county)}">🗺️ <a class="ddrill" href="?county=${encodeURIComponent(county)}" title="All contractors in ${esc(county)} County">${esc(county)}</a></span>`:'';
const lic=c.license_no?`<span class="i">🪪 <a class="ddrill" href="https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/LicenseDetail.aspx?LicNum=${encodeURIComponent(String(c.license_no).replace(/\D/g,''))}" target="_blank" rel="noopener noreferrer" title="Verify on CSLB ↗"><b>#${esc(c.license_no)}</b></a></span>`:'';
@@ -204,7 +217,7 @@ function card(c){
return `<div class="ccard">
<div class="top"><div class="name">${esc(c.business_name||'—')}</div>${statusPill(c.license_status)}</div>
${classTags(c)}
- <div class="dl">${lic}${phone}${cityD}${countyD}</div>
+ <div class="dl">${lic}${phone}${email}${cityD}${countyD}</div>
${dateRow(c)}
<div style="margin-top:2px">${fin}</div>
${freshLine(c)}
@@ -344,5 +357,6 @@ $('#body').addEventListener('click',e=>{
</script>
<script src="/corner-nav.js" defer></script>
<script src="/nav-agent/nav-agent.js" defer></script><!-- nav-agent -->
+ <script src="/filter-modal.js" defer></script><!-- responsive filters: collapsed rail (desktop) / modal (mobile) -->
<script src="/crcp-theme.js" defer></script><!-- CRCP day/night toggle (auto-injects into header) -->
</body></html>
← a7b1904 loan-officers: always show phone+email (TK-10703)
·
back to Commercialrealestate
·
CRCP filters: fan responsive filter-modal to deals-flow + co 5d50017 →