People using screen readers usually expect links to take them somewhere else in the page on to a different page, while they expect buttons to change something on the page. Since we're in the latter scenario, using a button is more accessible. It's also more natural; with a button, we don't need to provide `#` as the URL or stop the default event when the button is clicked. And, unlike links, buttons can be activated with either the space or the enter key. Finally, clicking a link pointing to `#` with the middle mouse button opens a useless new tab, while buttons do nothing in this case. Now that we only have one "All" link on the page, we no longer need to specify which "All" link we're clicking or which "All" link we are checking, so we're simplifying the code doing so.
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
<%= header %>
|
|
|
|
<%= render "shared/filter_subnav", i18n_namespace: "moderation.#{i18n_namespace}.index" %>
|
|
|
|
<h3 class="inline-block"><%= page_entries_info records %></h3>
|
|
|
|
<% if records.any? %>
|
|
<%= render "shared/order_links", i18n_namespace: "moderation.#{i18n_namespace}.index" %>
|
|
<% end %>
|
|
|
|
<%= form_tag form_path, method: :put do %>
|
|
<p class="check-all-none">
|
|
<%= t("shared.check") %>:
|
|
<%= button_tag t("shared.check_all"), type: "button", data: { check_all: field_name } %>
|
|
|
|
|
<%= button_tag t("shared.check_none"), type: "button", data: { check_none: field_name } %>
|
|
</p>
|
|
|
|
<%= content %>
|
|
|
|
<%= submit_tag t("moderation.#{i18n_namespace}.index.block_authors"),
|
|
name: "block_authors",
|
|
class: "button hollow alert",
|
|
data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.block_authors")) } %>
|
|
|
|
<div class="float-right">
|
|
<%= submit_tag t("moderation.#{i18n_namespace}.index.hide"),
|
|
name: "hide_#{table_name}",
|
|
class: "button hollow alert",
|
|
data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.hide")) } %>
|
|
|
|
<%= submit_tag t("moderation.#{i18n_namespace}.index.ignore_flags"),
|
|
name: "ignore_flags",
|
|
class: "button hollow",
|
|
data: { confirm: t("moderation.actions.confirm_action", action: t("moderation.#{i18n_namespace}.index.ignore_flags")) } %>
|
|
</div>
|
|
|
|
<%= paginate records %>
|
|
<% end %>
|