|
- <% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
-
- <div class="d-flex justify-content-between align-items-center mb-3">
- <h1 class="h3 mb-0">Bulk log: review matches</h1>
- </div>
-
- <div class="card shadow-sm mb-3">
- <div class="card-body">
- <dl class="row mb-0 small">
- <dt class="col-sm-3">How</dt>
- <dd class="col-sm-9"><%= H(Businesses_Label(Businesses_Methods(), v("method"))) %></dd>
- <dt class="col-sm-3">Outcome</dt>
- <dd class="col-sm-9"><% If Len(v("outcome")) > 0 Then Response.Write H(Businesses_Label(Businesses_Outcomes(), v("outcome"))) Else Response.Write "—" %></dd>
- <dt class="col-sm-3">Date contacted</dt>
- <dd class="col-sm-9"><%= Date_Fmt(Date_Parse(v("contacted_at"))) %></dd>
- <dt class="col-sm-3">Contact again on</dt>
- <dd class="col-sm-9"><% If Len(v("follow_up_date")) > 0 Then Response.Write Date_Fmt(Date_Parse(v("follow_up_date"))) Else Response.Write "— (no follow-up)" %></dd>
- <% If Len(v("notes")) > 0 Then %>
- <dt class="col-sm-3">Notes</dt>
- <dd class="col-sm-9"><%= Html_Nl2Br(v("notes")) %></dd>
- <% End If %>
- </dl>
- </div>
- </div>
-
- <div class="card shadow-sm mb-3">
- <div class="card-body">
- <h2 class="h5 mb-3">Will be updated <span class="text-muted fs-6">(<%= toLog.Count %>)</span></h2>
- <% If toLog.Count = 0 Then %>
- <p class="text-muted mb-0">No active businesses matched.</p>
- <% Else %>
- <div class="table-responsive">
- <table class="table table-sm align-middle mb-0">
- <thead class="table-light"><tr><th>Business</th><th>Email</th><th>City</th><th>Status</th><th>Current next contact</th></tr></thead>
- <tbody>
- <% Dim ti, row
- For ti = 0 To toLog.Count - 1
- Set row = toLog(ti) %>
- <tr>
- <td><a href="/businesses/<%= row("id") %>" class="text-decoration-none"><%= H(row("name")) %></a></td>
- <td><%= H(row("email")) %></td>
- <td><%= H(row("city")) %></td>
- <td><span class="badge <%= Businesses_StatusClass(row("status")) %>"><%= H(Businesses_StatusLabel(row("status"))) %></span></td>
- <td><%= Date_Fmt(row("next_action_date")) %></td>
- </tr>
- <% Next %>
- </tbody>
- </table>
- </div>
- <% End If %>
- </div>
- </div>
-
- <% If skipped.Count > 0 Then %>
- <div class="alert alert-secondary">
- <strong>Skipped (removed from the list):</strong>
- <% Dim si
- For si = 0 To skipped.Count - 1 %>
- <div><%= H(skipped(si)("name")) %> <<%= H(skipped(si)("email")) %>></div>
- <% Next %>
- </div>
- <% End If %>
-
- <% If missing.Count > 0 Or parsed("invalid").Count > 0 Then %>
- <div class="alert alert-warning">
- <% If missing.Count > 0 Then %>
- <strong>No business has these emails (<%= missing.Count %>):</strong>
- <div class="small"><% Dim mi
- For mi = 0 To missing.Count - 1
- If mi > 0 Then Response.Write ", "
- Response.Write H(missing(mi))
- Next %></div>
- <% End If %>
- <% If parsed("invalid").Count > 0 Then %>
- <div class="<% If missing.Count > 0 Then Response.Write "mt-2" %>"><strong>Not valid email addresses (ignored):</strong></div>
- <div class="small"><% Dim ii
- For ii = 0 To parsed("invalid").Count - 1
- If ii > 0 Then Response.Write ", "
- Response.Write H(parsed("invalid")(ii))
- Next %></div>
- <% End If %>
- </div>
- <% End If %>
-
- <form method="post" action="/bulk-log/run" class="d-flex gap-2">
- <input type="hidden" name="csrf" value="<%= H(csrf) %>" />
- <input type="hidden" name="emails" value="<%= H(emailsJoined) %>" />
- <input type="hidden" name="method" value="<%= H(v("method")) %>" />
- <input type="hidden" name="outcome" value="<%= H(v("outcome")) %>" />
- <input type="hidden" name="contacted_at" value="<%= H(v("contacted_at")) %>" />
- <input type="hidden" name="follow_up_date" value="<%= H(v("follow_up_date")) %>" />
- <input type="hidden" name="notes" value="<%= H(v("notes")) %>" />
- <% If toLog.Count > 0 Then %>
- <button type="submit" class="btn btn-primary btn-sm"><i class="bi bi-check2"></i> Log contact on <%= toLog.Count %> business<% If toLog.Count <> 1 Then Response.Write "es" %></button>
- <% End If %>
- <a href="/bulk-log" class="btn btn-outline-secondary btn-sm">Back</a>
- </form>
|