|
- <% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
-
- <div class="d-flex justify-content-between align-items-center mb-3">
- <h1 class="h3 mb-0">Bulk log a contact</h1>
- </div>
-
- <form method="post" action="/bulk-log/preview" class="card shadow-sm" id="bulkForm">
- <div class="card-body">
- <input type="hidden" name="csrf" value="<%= H(csrf) %>" />
-
- <div class="mb-3">
- <label for="emails" class="form-label small mb-1">Email addresses</label>
- <textarea class="form-control" id="emails" name="emails" rows="4" required
- placeholder="jlkj@jkh.com;hjjkh@yoi.com"><%= H(emailsText) %></textarea>
- <div class="form-text">Separate addresses with semicolons, commas, spaces or new lines. Businesses with a matching email are updated; you review the matches before anything is saved.</div>
- </div>
-
- <div class="mb-3">
- <div class="btn-group" role="group" aria-label="How">
- <% Dim mth, oc
- For Each mth In Businesses_Methods() %>
- <input type="radio" class="btn-check" name="method" id="m_<%= mth(0) %>" value="<%= mth(0) %>" autocomplete="off"<% If mth(0) = method Then Response.Write " checked" %> />
- <label class="btn btn-outline-primary btn-sm" for="m_<%= mth(0) %>"><%= H(mth(1)) %></label>
- <% Next %>
- </div>
- </div>
-
- <div class="row g-2 mb-2">
- <div class="col-md-5">
- <label for="outcome" class="form-label small mb-1">Outcome</label>
- <select class="form-select form-select-sm" id="outcome" name="outcome">
- <option value="">—</option>
- <% For Each oc In Businesses_Outcomes()
- If oc(0) <> "remove" Then %>
- <option value="<%= oc(0) %>"<% If oc(0) = outcome Then Response.Write " selected" %>><%= H(oc(1)) %></option>
- <% End If
- Next %>
- </select>
- </div>
- <div class="col-6 col-md-3">
- <label for="contacted_at" class="form-label small mb-1">Date contacted</label>
- <input type="date" class="form-control form-control-sm" id="contacted_at" name="contacted_at" value="<%= H(contactedAt) %>" max="<%= Date_Iso(Date + 1) %>" required />
- </div>
- <div class="col-6 col-md-4">
- <label for="follow_up_date" class="form-label small mb-1">Contact again on</label>
- <input type="date" class="form-control form-control-sm" id="follow_up_date" name="follow_up_date" value="<%= H(followUp) %>" />
- </div>
- </div>
-
- <div class="mb-2 small">
- <span class="text-muted">Quick:</span>
- <button type="button" class="btn btn-link btn-sm p-0 me-2" data-days="3">3 days</button>
- <button type="button" class="btn btn-link btn-sm p-0 me-2" data-days="7">1 week</button>
- <button type="button" class="btn btn-link btn-sm p-0 me-2" data-days="14">2 weeks</button>
- <button type="button" class="btn btn-link btn-sm p-0 me-2" data-days="30">1 month</button>
- <button type="button" class="btn btn-link btn-sm p-0 text-secondary" data-days="0">clear</button>
- </div>
-
- <div class="mb-3">
- <label for="notes" class="form-label small mb-1">Notes (added to each business's history)</label>
- <textarea class="form-control form-control-sm" id="notes" name="notes" rows="3" maxlength="10000"><%= H(notes) %></textarea>
- </div>
-
- <button type="submit" class="btn btn-primary btn-sm"><i class="bi bi-search"></i> Find matches</button>
- </div>
- </form>
-
- <script>
- (function () {
- var contacted = document.getElementById('contacted_at');
- var followUp = document.getElementById('follow_up_date');
- function iso(d) {
- return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2);
- }
- document.querySelectorAll('[data-days]').forEach(function (b) {
- b.addEventListener('click', function () {
- var days = parseInt(b.getAttribute('data-days'), 10);
- if (!days) { followUp.value = ''; return; }
- var base = contacted.value ? new Date(contacted.value + 'T00:00:00') : new Date();
- base.setDate(base.getDate() + days);
- followUp.value = iso(base);
- });
- });
- })();
- </script>
|