forked from otwcode/otwarchive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bulk_search.html.erb
46 lines (40 loc) · 1.82 KB
/
bulk_search.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<div class="admin">
<!--Descriptive page name, messages and instructions-->
<h2 class="heading"><%= ts("Bulk Email Search") %></h2>
<!--/descriptions-->
<!--main content-->
<div>
<p class="notice"><%= ts("Please enter a list of email addresses to search below. This form will search for <strong>exact</strong> matches.").html_safe %></p>
</div>
<%= form_tag url_for(controller: "admin/admin_users", action: :bulk_search, method: :post), class: "search", role: "search" do %>
<fieldset>
<legend><%= ts("Email addresses") %></legend>
<dl>
<dt class="required"><%= label_tag "emails", ts("Email addresses *") %></dt>
<dd class="required"><%= text_area_tag "emails", @emails ? @emails.join("\n") : "", rows: 10, cols: 70, "aria-describedby" => "email-field-description" %>
<p class="footnote" id="email-field-description">
<%= ts("Email addresses to find; <strong>one per line.</strong>").html_safe %>
</p>
</dd>
</dl>
</fieldset>
<fieldset>
<legend><%= ts("Find") %></legend>
<p class="submit actions">
<%= submit_tag ts("Download CSV"), name: "download_button" %>
<%= submit_tag ts("Find") %>
</p>
</fieldset>
<% end %>
<% if @results[:not_found_emails] || @results[:users] %>
<p><%= ts("#{pluralize(@results[:total], "email")} entered. #{@results[:searched]} searched. " +
"#{@results[:found_users].size} found. #{@results[:not_found_emails].size} not found. #{pluralize(@results[:duplicates], "duplicate")}.") %></p>
<% if @results[:not_found_emails]&.any? %>
<h3 class="heading"><%= ts("Not found") %></h3>
<p><%= @results[:not_found_emails].join(", ") %></p>
<% end %>
<% if @users %>
<%= render "user_table", users: @users %>
<% end %>
<% end %>
</div>