Add emails index page at https://danbooru.donmai.us/emails. Mods can use this page to view and search emails belonging to users below mod level.
33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
<div id="c-emails">
|
|
<div id="a-index">
|
|
<%= search_form_for(emails_path) do |f| %>
|
|
<%= f.simple_fields_for :user do |fa| %>
|
|
<%= fa.input :name, label: "User Name", input_html: { value: params.dig(:search, :user, :name), "data-autocomplete": "user" } %>
|
|
<% end %>
|
|
|
|
<%= f.input :address_ilike, label: "Address", input_html: { value: params[:search][:address] }, hint: "Use * for wildcard" %>
|
|
<%= f.input :is_verified, label: "Verified?", collection: %w[Yes No], selected: params[:search][:is_verified] %>
|
|
<%= f.submit "Search" %>
|
|
<% end %>
|
|
|
|
<%= table_for @email_addresses, class: "striped autofit" do |t| %>
|
|
<% t.column :user do |email| %>
|
|
<%= link_to_user email.user %>
|
|
<% end %>
|
|
<% t.column :address %>
|
|
<% t.column :is_verified, name: "Verified?" do |email| %>
|
|
<% if email.is_verified? %>
|
|
<%= link_to "Yes", emails_path(search: { is_verified: true }) %>
|
|
<% else %>
|
|
<%= link_to "No", emails_path(search: { is_verified: false }) %>
|
|
<% end %>
|
|
<% end %>
|
|
<% t.column :updated_at, name: "Updated" do |email| %>
|
|
<%= time_ago_in_words_tagged(email.updated_at) %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= numbered_paginator(@email_addresses) %>
|
|
</div>
|
|
</div>
|