You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 line
4.2KB

  1. <% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
  2. <div class="d-flex justify-content-between align-items-center mb-3">
  3. <h1 class="h3 mb-0">Bulk log: review matches</h1>
  4. </div>
  5. <div class="card shadow-sm mb-3">
  6. <div class="card-body">
  7. <dl class="row mb-0 small">
  8. <dt class="col-sm-3">How</dt>
  9. <dd class="col-sm-9"><%= H(Businesses_Label(Businesses_Methods(), v("method"))) %></dd>
  10. <dt class="col-sm-3">Outcome</dt>
  11. <dd class="col-sm-9"><% If Len(v("outcome")) > 0 Then Response.Write H(Businesses_Label(Businesses_Outcomes(), v("outcome"))) Else Response.Write "&mdash;" %></dd>
  12. <dt class="col-sm-3">Date contacted</dt>
  13. <dd class="col-sm-9"><%= Date_Fmt(Date_Parse(v("contacted_at"))) %></dd>
  14. <dt class="col-sm-3">Contact again on</dt>
  15. <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 "&mdash; (no follow-up)" %></dd>
  16. <% If Len(v("notes")) > 0 Then %>
  17. <dt class="col-sm-3">Notes</dt>
  18. <dd class="col-sm-9"><%= Html_Nl2Br(v("notes")) %></dd>
  19. <% End If %>
  20. </dl>
  21. </div>
  22. </div>
  23. <div class="card shadow-sm mb-3">
  24. <div class="card-body">
  25. <h2 class="h5 mb-3">Will be updated <span class="text-muted fs-6">(<%= toLog.Count %>)</span></h2>
  26. <% If toLog.Count = 0 Then %>
  27. <p class="text-muted mb-0">No active businesses matched.</p>
  28. <% Else %>
  29. <div class="table-responsive">
  30. <table class="table table-sm align-middle mb-0">
  31. <thead class="table-light"><tr><th>Business</th><th>Email</th><th>City</th><th>Status</th><th>Current next contact</th></tr></thead>
  32. <tbody>
  33. <% Dim ti, row
  34. For ti = 0 To toLog.Count - 1
  35. Set row = toLog(ti) %>
  36. <tr>
  37. <td><a href="/businesses/<%= row("id") %>" class="text-decoration-none"><%= H(row("name")) %></a></td>
  38. <td><%= H(row("email")) %></td>
  39. <td><%= H(row("city")) %></td>
  40. <td><span class="badge <%= Businesses_StatusClass(row("status")) %>"><%= H(Businesses_StatusLabel(row("status"))) %></span></td>
  41. <td><%= Date_Fmt(row("next_action_date")) %></td>
  42. </tr>
  43. <% Next %>
  44. </tbody>
  45. </table>
  46. </div>
  47. <% End If %>
  48. </div>
  49. </div>
  50. <% If skipped.Count > 0 Then %>
  51. <div class="alert alert-secondary">
  52. <strong>Skipped (removed from the list):</strong>
  53. <% Dim si
  54. For si = 0 To skipped.Count - 1 %>
  55. <div><%= H(skipped(si)("name")) %> &lt;<%= H(skipped(si)("email")) %>&gt;</div>
  56. <% Next %>
  57. </div>
  58. <% End If %>
  59. <% If missing.Count > 0 Or parsed("invalid").Count > 0 Then %>
  60. <div class="alert alert-warning">
  61. <% If missing.Count > 0 Then %>
  62. <strong>No business has these emails (<%= missing.Count %>):</strong>
  63. <div class="small"><% Dim mi
  64. For mi = 0 To missing.Count - 1
  65. If mi > 0 Then Response.Write ", "
  66. Response.Write H(missing(mi))
  67. Next %></div>
  68. <% End If %>
  69. <% If parsed("invalid").Count > 0 Then %>
  70. <div class="<% If missing.Count > 0 Then Response.Write "mt-2" %>"><strong>Not valid email addresses (ignored):</strong></div>
  71. <div class="small"><% Dim ii
  72. For ii = 0 To parsed("invalid").Count - 1
  73. If ii > 0 Then Response.Write ", "
  74. Response.Write H(parsed("invalid")(ii))
  75. Next %></div>
  76. <% End If %>
  77. </div>
  78. <% End If %>
  79. <form method="post" action="/bulk-log/run" class="d-flex gap-2">
  80. <input type="hidden" name="csrf" value="<%= H(csrf) %>" />
  81. <input type="hidden" name="emails" value="<%= H(emailsJoined) %>" />
  82. <input type="hidden" name="method" value="<%= H(v("method")) %>" />
  83. <input type="hidden" name="outcome" value="<%= H(v("outcome")) %>" />
  84. <input type="hidden" name="contacted_at" value="<%= H(v("contacted_at")) %>" />
  85. <input type="hidden" name="follow_up_date" value="<%= H(v("follow_up_date")) %>" />
  86. <input type="hidden" name="notes" value="<%= H(v("notes")) %>" />
  87. <% If toLog.Count > 0 Then %>
  88. <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>
  89. <% End If %>
  90. <a href="/bulk-log" class="btn btn-outline-secondary btn-sm">Back</a>
  91. </form>

Powered by TurnKey Linux.