← back to NationalPaperHangers

views/public/claim.ejs

82 lines

<%- include('../partials/head', { title }) %>
<%- include('../partials/header') %>

<section class="auth-page">
  <div class="auth-card auth-card-wide">
    <p class="kicker">Claim listing</p>
    <h1 class="display-sm">Is <%= installer.business_name %> your studio?</h1>

    <% if (sent) { %>
      <div class="callout callout-success">
        <strong>Verification email sent to <%= sentTo %>.</strong>
        Click the link in that email to confirm. The link expires in 24 hours.
      </div>

      <ol class="claim-next-steps" aria-label="What happens next">
        <li>
          <strong>Your listing goes live under your control.</strong>
          Once you verify your email you'll have full edit access — update your bio, materials, portfolio, and service area instantly.
        </li>
        <li>
          <strong>Upgrade to Pro to unlock calendar bookings and a Verified badge.</strong>
          Clients on the Pro tier can self-book consultations directly into your calendar and your listing displays a prominent Verified mark.
        </li>
        <li>
          <strong>We'll email you a setup checklist.</strong>
          After verification you'll receive a short guide covering profile completion, availability setup, and how to get your first booking.
        </li>
      </ol>

      <p><a href="/installer/<%= installer.slug %>" class="btn btn-ghost">Back to profile</a></p>
    <% } else { %>
      <p class="lede">
        This is an unclaimed public directory listing seeded from <%= installer.source_name === 'wia' ? 'the Wallcovering Installers Association directory' : 'a public source' %>. To claim it, verify ownership using an email address on the studio's domain.
      </p>

      <%
        var _safeWebsite = (function(u){
          if (!u) return null;
          try { var x = new URL(u); return (x.protocol === 'http:' || x.protocol === 'https:') ? x.toString() : null; }
          catch (e) { return null; }
        })(installer.website);
      %>
      <% if (_safeWebsite) { %>
        <p class="muted">Website on file: <a href="<%= _safeWebsite %>" target="_blank" rel="noopener"><%= _safeWebsite %></a> · Use an email on this domain.</p>
      <% } %>

      <% if (error) { %><p class="form-error"><%= error %></p><% } %>

      <form method="post" action="/installer/<%= installer.slug %>/claim">
        <input type="hidden" name="_csrf" value="<%= csrfToken %>">
        <label>Email on the studio's domain
          <input type="email" name="email" required placeholder="info@yourdomain.com" autofocus>
        </label>
        <button type="submit" class="btn btn-primary btn-lg">Send verification email</button>
      </form>

      <hr style="margin:32px 0;border:none;border-top:1px solid var(--border)">
      <p class="muted">
        No matching email address? Email
        <a href="mailto:info@nationalpaperhangers.com?subject=Manual%20claim%3A%20<%= encodeURIComponent(installer.business_name) %>">info@nationalpaperhangers.com</a>
        for manual review (we accept proof via website live chat, public phone reply, or DNS TXT record).
      </p>
      <p class="muted">
        To request removal of this listing,
        <a href="mailto:info@nationalpaperhangers.com?subject=Opt-out%3A%20<%= encodeURIComponent(installer.business_name) %>">email us</a>
        and we'll remove it within 5 business days per our public directory data policy.
      </p>
    <% } %>
  </div>
</section>

<%- include('../partials/footer') %>
<% if (!sent) { %>
<script>
  // GA4 conversion: claim_started (form is visible, verification email not yet sent)
  gtag('event', 'claim_started', {
    installer_slug: '<%= installer.slug %>',
    installer_name: '<%= installer.business_name.replace(/'/g, "\\'") %>'
  });
</script>
<% } %>