← back to NationalPaperHangers

views/public/installer-tpl-editorial.ejs

92 lines

<%- include('../partials/head', { title, bodyClass: 'tpl-editorial' }) %>
<%- include('../partials/header') %>
<%
  function _heroUrl() {
    var s = installer.template_settings || {};
    if (s.hero_url) return s.hero_url;
    if (portfolio.length && portfolio[0].image_url) return portfolio[0].image_url;
    var seg = (typeof pickSegmentImage === 'function') ? pickSegmentImage(installer) : null;
    return seg ? seg.file : null;
  }
  var heroUrl = _heroUrl();
  var founded = installer.founded_year ? ('Est. ' + installer.founded_year) : null;
%>
<article class="tpl-root">
  <p class="ed-kicker"><%= [installer.city, installer.state].filter(Boolean).join(' · ') %><% if (founded) { %> · <%= founded %><% } %></p>
  <h1 class="ed-title"><%= installer.business_name %></h1>
  <% if (installer.headline) { %><p class="ed-deck"><%= installer.headline %></p><% } %>

  <% if (heroUrl) { %><img class="ed-hero" src="<%= heroUrl %>" alt="<%= installer.business_name %> — feature project" loading="eager"><% } %>
  <p class="ed-hero-cap"><% if (portfolio[0] && portfolio[0].title) { %>Above: <%= portfolio[0].title %><% if (portfolio[0].brand) { %> · <%= portfolio[0].brand %><% } %><% } else { %>Studio profile · National Paper Hangers<% } %></p>

  <% if (installer.claim_status === 'unclaimed') { %>
    <div class="tpl-claim-cta" style="color:#8c1d1d">
      <div style="flex:1">Trade buyers are finding this studio. If you operate <%= installer.business_name %>, claim your listing in 2 minutes.</div>
      <a href="/installer/<%= installer.slug %>/claim" class="btn-ed" style="padding:10px 22px">Claim listing →</a>
    </div>
  <% } %>

  <div class="ed-body">
    <div class="ed-prose">
      <% if (installer.bio) { %><p><%= installer.bio %></p><% } else { %><p><em>This studio has not yet shared a long-form profile. Their work below speaks first.</em></p><% } %>
      <% if ((installer.materials || []).length) { %>
        <h2>Materials &amp; methods</h2>
        <p><%= installer.business_name %> works in <%= installer.materials.map(function(m){return String(m||'').replace(/_/g,' ');}).filter(Boolean).join(', ') %><% if ((installer.brands_handled||[]).length) { %>, with installations of <%= installer.brands_handled.slice(0,5).join(', ') %><% } %>.</p>
      <% } %>
      <% if ((installer.market_segments || []).length) { %>
        <h2>Project mix</h2>
        <p>Active in <%= installer.market_segments.map(function(s){return String(s||'').replace(/_/g,' ');}).filter(Boolean).join(', ') %><% if (installer.travel_available) { %>; available to travel for projects<% } else if (installer.service_radius_miles) { %>; <%= installer.service_radius_miles %>-mile service radius from <%= installer.city || 'home base' %><% } %>.</p>
      <% } %>
    </div>
    <aside class="ed-side">
      <h3>At a glance</h3>
      <dl>
        <% if (installer.team_size) { %><dt>Team</dt><dd><%= installer.team_size %></dd><% } %>
        <dt>Radius</dt><dd><%= installer.service_radius_miles || '—' %> mi</dd>
        <% if (installer.response_time_hours) { %><dt>Replies in</dt><dd>&lt; <%= installer.response_time_hours %>h</dd><% } %>
        <% if (installer.insurance_on_file) { %><dt>Insured</dt><dd>Yes</dd><% } %>
        <% if (acceptance) { %><dt>Books</dt><dd><%= acceptance.rate %>% of inquiries</dd><% } %>
      </dl>
      <% if ((credentials || []).length) { %>
        <h3>Credentials</h3>
        <dl>
          <% credentials.slice(0,8).forEach(function(c){ %>
            <dt><%= c.brand %></dt><dd><%= c.credential_type.replace(/_/g,' ') %><% if (c.year_issued) { %> · <%= c.year_issued %><% } %></dd>
          <% }); %>
        </dl>
      <% } %>
      <% if ((installer.accreditations || []).length) { %>
        <h3>Memberships</h3>
        <p style="margin:0"><%= installer.accreditations.join(' · ') %></p>
      <% } %>
    </aside>
  </div>

  <% if (portfolio.length) { %>
    <section class="ed-portfolio">
      <h2>Selected projects</h2>
      <div class="ed-pf-grid">
        <% portfolio.slice(0,9).forEach(function(p){ %>
          <figure class="ed-pf-card">
            <% if (p.image_url) { %><img class="tpl-portfolio-img" src="<%= p.image_url %>" alt="<%= p.title %>" loading="lazy"><% } %>
            <figcaption><strong><%= p.title %></strong><br><%= [p.city, p.state, p.year].filter(Boolean).join(' · ') %><% if (p.brand) { %> · <%= p.brand %><% } %></figcaption>
          </figure>
        <% }); %>
      </div>
    </section>
  <% } %>

  <%- include('../partials/social-videos') %>

  <% if (installer.claim_status === 'claimed') { %>
    <section class="ed-cta">
      <h2>Book <%= installer.business_name %></h2>
      <a class="btn-ed" href="/installer/<%= installer.slug %>/book">Open the calendar →</a>
    </section>
  <% } %>
</article>
<%- include('../partials/paper-contributions') %>
<%- include('../partials/coi-request') %>
<%- include('../partials/call-installer') %>
<%- include('../partials/footer') %>