From c0d86649a462e42c969aaf910aec2e2c28fd4c84 Mon Sep 17 00:00:00 2001 From: Jacob Herrington Date: Sun, 23 Aug 2020 09:15:27 -0500 Subject: [PATCH] Fix general accessibility warnings in admin (#9927) * Fix general accessibility warnings in admin * Update app/views/admin/webhook_endpoints/index.html.erb Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> * Update app/views/admin/organizations/show.html.erb Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> --- app/views/admin/comments/index.html.erb | 80 +++++---- app/views/admin/events/index.html.erb | 4 +- app/views/admin/growth/_results.html.erb | 6 +- app/views/admin/growth/index.html.erb | 8 +- app/views/admin/listings/index.html.erb | 168 +++++++++--------- .../admin/moderator_actions/index.html.erb | 70 ++++---- app/views/admin/mods/index.html.erb | 116 ++++++------ .../admin/organizations/_activity.html.erb | 4 +- app/views/admin/organizations/index.html.erb | 92 +++++----- app/views/admin/organizations/show.html.erb | 107 +++++------ app/views/admin/pages/edit.html.erb | 12 +- app/views/admin/pages/index.html.erb | 32 ++-- app/views/admin/pages/new.html.erb | 12 +- app/views/admin/permissions/index.html.erb | 60 +++---- app/views/admin/podcasts/index.html.erb | 92 +++++----- .../admin/privileged_reactions/index.html.erb | 99 ++++++----- app/views/admin/profile_fields/index.html.erb | 40 +++-- app/views/admin/secrets/index.html.erb | 54 +++--- app/views/admin/tags/index.html.erb | 104 +++++------ app/views/admin/tags/show.html.erb | 6 +- app/views/admin/tools/index.html.erb | 74 ++++---- .../admin/webhook_endpoints/index.html.erb | 48 ++--- app/views/admin/welcome/index.html.erb | 32 ++-- 23 files changed, 676 insertions(+), 644 deletions(-) diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb index f9f25ee6c..3ea635b98 100644 --- a/app/views/admin/comments/index.html.erb +++ b/app/views/admin/comments/index.html.erb @@ -1,34 +1,35 @@ -<%= paginate @comments %> +
+ <%= paginate @comments %> -<% @comments.each do |comment| %> -
-
-
-
- <% if comment.commentable %> - re: <%= comment.commentable.title %> (<%= comment.public_reactions_count %> ❤️) - <% end %> -
-
-

- <%= sanitize comment.processed_html, - tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote], - attributes: %w[href strong em ref rel src title alt class] %> + <% @comments.each do |comment| %> +

+
+
+
+ <% if comment.commentable %> + re: <%= comment.commentable.title %> (<%= comment.public_reactions_count %> ❤️) + <% end %> +
+
+

+ <%= sanitize comment.processed_html, + tags: %w[strong em p h1 h2 h3 h4 h5 h6 i u b code pre br ul ol li small sup img a span hr blockquote], + attributes: %w[href strong em ref rel src title alt class] %> -

-
- <% if comment.user %> - - <%= comment.user.username %> profile <%= comment.user.username %> - - <% end %> - <% if comment.user && comment.user.twitter_username.present? %> - | - - @<%= comment.user.twitter_username %> - - <% end %> -
+

+
+ <% if comment.user %> + + <%= comment.user.username %> profile <%= comment.user.username %> + + <% end %> + <% if comment.user && comment.user.twitter_username.present? %> + | + + @<%= comment.user.twitter_username %> + + <% end %> +
View <% if comment.reactions.where(user_id: current_user.id).empty? %> @@ -39,19 +40,20 @@ <% end %> <% end %>
+
-
-<% end %> + <% end %> -<%= paginate @comments %> + <%= paginate @comments %> - + +
diff --git a/app/views/admin/events/index.html.erb b/app/views/admin/events/index.html.erb index 0054a3ccf..0e0addae2 100644 --- a/app/views/admin/events/index.html.erb +++ b/app/views/admin/events/index.html.erb @@ -1,4 +1,4 @@ -
+

Create New Event

@@ -29,4 +29,4 @@ <% end %> <% end %>
- + diff --git a/app/views/admin/growth/_results.html.erb b/app/views/admin/growth/_results.html.erb index 5155c746f..e38d03ad5 100644 --- a/app/views/admin/growth/_results.html.erb +++ b/app/views/admin/growth/_results.html.erb @@ -1,6 +1,6 @@ -

Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)

-
+
+

Past <%= num_days %> day new users (<%= User.where("registered_at > ?", num_days.day.ago).count %>)

Overall data: @@ -18,4 +18,4 @@
-
+
diff --git a/app/views/admin/growth/index.html.erb b/app/views/admin/growth/index.html.erb index d89a9627f..39de87181 100644 --- a/app/views/admin/growth/index.html.erb +++ b/app/views/admin/growth/index.html.erb @@ -1,3 +1,5 @@ -

Onboarding

-<%= render "results", num_days: 7 %> -<%= render "results", num_days: 1 %> +
+

Onboarding

+ <%= render "results", num_days: 7 %> + <%= render "results", num_days: 1 %> +
diff --git a/app/views/admin/listings/index.html.erb b/app/views/admin/listings/index.html.erb index 16e661125..f577302a9 100644 --- a/app/views/admin/listings/index.html.erb +++ b/app/views/admin/listings/index.html.erb @@ -1,86 +1,88 @@ -
-
- <%= form_tag(admin_listings_path, method: "get") do %> -
-
- <%= label_tag(:search, "Keyword") %> - <%= text_field_tag(:search, params[:search]) %> - <% if params[:state].present? %> - <%= hidden_field_tag(:state, params[:state]) %> - <% end %> -
-
- <%= label_tag(:filter, "Category") %> - <%= select_tag(:filter, options_for_select(categories_available.keys, params[:filter]), include_blank: true) %> -
-
- <%= label_tag(:include_unpublished, "Include unpublished listings") %> - <%= hidden_field_tag(:include_unpublished, 0) %> - <%= check_box_tag(:include_unpublished, 1, params[:include_unpublished] == "1") %> -
-
- <%= submit_tag("Filter") %> -
-
- <% end %> -
-
- -<%= paginate @listings %> - - - - - - - - - - - - - - - <% @listings.each do |listing| %> - - - - - - - - - - - - - <% end %> - -
Title LinkUserOrgCategoryCached TagsPublished?Last Bumped
<%= link_to listing.title, edit_admin_listing_path(listing.id), target: "_blank", rel: "noopener" %><%= link_to listing.user.username, edit_admin_user_path(listing.user.id) %><%= link_to listing.organization.name, admin_organization_path(listing.organization_id) if listing.organization_id.present? %><%= listing.category %><%= listing.cached_tag_list %><%= listing.published ? "Yes" : "No" %><%= listing.bumped_at ? time_ago_in_words(listing.bumped_at) + " ago" : "Draft" %>
- - - <% if listing.last_buffered.present? %> - - Last shared: <%= listing.last_buffered.strftime("%d %B %Y") %> - - <% end %> -
-

<%= listing.title %>

-

<%= listing.processed_html&.html_safe %>

- <%= form_with url: admin_buffer_updates_path, html: { data: { action: "submit->buffer#highlightElement" } } do %> - - - - +
+
+
+ <%= label_tag(:filter, "Category") %> + <%= select_tag(:filter, options_for_select(categories_available.keys, params[:filter]), include_blank: true) %> +
+
+ <%= label_tag(:include_unpublished, "Include unpublished listings") %> + <%= hidden_field_tag(:include_unpublished, 0) %> + <%= check_box_tag(:include_unpublished, 1, params[:include_unpublished] == "1") %> +
+
+ <%= submit_tag("Filter") %> +
+
+ <% end %> + + -<%= paginate @listings %> + <%= paginate @listings %> + + + + + + + + + + + + + + + <% @listings.each do |listing| %> + + + + + + + + + + + + + <% end %> + +
Title LinkUserOrgCategoryCached TagsPublished?Last Bumped
<%= link_to listing.title, edit_admin_listing_path(listing.id), target: "_blank", rel: "noopener" %><%= link_to listing.user.username, edit_admin_user_path(listing.user.id) %><%= link_to listing.organization.name, admin_organization_path(listing.organization_id) if listing.organization_id.present? %><%= listing.category %><%= listing.cached_tag_list %><%= listing.published ? "Yes" : "No" %><%= listing.bumped_at ? "#{time_ago_in_words(listing.bumped_at)} ago" : "Draft" %>
+ + + <% if listing.last_buffered.present? %> + + Last shared: <%= listing.last_buffered.strftime("%d %B %Y") %> + + <% end %> +
+

<%= listing.title %>

+

<%= listing.processed_html&.html_safe %>

+ <%= form_with url: admin_buffer_updates_path, html: { data: { action: "submit->buffer#highlightElement" } } do %> + + + + + <% end %> +
+
+ + <%= paginate @listings %> + diff --git a/app/views/admin/moderator_actions/index.html.erb b/app/views/admin/moderator_actions/index.html.erb index 16de9b059..8d9948202 100644 --- a/app/views/admin/moderator_actions/index.html.erb +++ b/app/views/admin/moderator_actions/index.html.erb @@ -1,42 +1,42 @@ -
-
-
-
- <%= search_form_for @q, url: admin_moderator_actions_path, class: "form-inline justify-content-end" do |f| %> +
+
+ <%= f.submit "Search", class: "btn btn-secondary" %> + <% end %> +
+ -<%= paginate @moderator_actions %> + <%= paginate @moderator_actions %> - - - - - - - - - - - - <% @moderator_actions.each do |action| %> +
IDUserActionData - <%= tag.span(sort_link(@q, :created_at, "Date"), class: "mx-2") %> -
+ - - - - - + + + + + - <% end %> - -
<%= action.id %><%= link_to(action.user.username, admin_user_path(action.user_id)) if action.user %><%= "#{action.data['action'].humanize} #{action.data['controller'].humanize.singularize.titleize}" if action.data.present? %><%= action.data %><%= action.created_at %>IDUserActionData + <%= tag.span(sort_link(@q, :created_at, "Date"), class: "mx-2") %> +
+ + + <% @moderator_actions.each do |action| %> + + <%= action.id %> + <%= link_to(action.user.username, admin_user_path(action.user_id)) if action.user %> + <%= "#{action.data['action'].humanize} #{action.data['controller'].humanize.singularize.titleize}" if action.data.present? %> + <%= action.data %> + <%= action.created_at %> + + <% end %> + + -<%= paginate @moderator_actions %> + <%= paginate @moderator_actions %> + diff --git a/app/views/admin/mods/index.html.erb b/app/views/admin/mods/index.html.erb index ce331fcbd..59dc3ca4d 100644 --- a/app/views/admin/mods/index.html.erb +++ b/app/views/admin/mods/index.html.erb @@ -1,61 +1,63 @@ -
-
- -
-
- <%= form_with url: admin_mods_path, method: :get, local: true, class: "form-inline justify-content-end" do |f| %> -
- <%= f.text_field :search, value: params[:search], class: "form-control" %> - <%= f.hidden_field :state, value: params[:state] if params[:state].present? %> -
- <%= f.submit "Search", class: "btn btn-light" %> - <% end %> -
-
- -<%= paginate @mods, theme: "internal" %> - - - - - - - - - - <% if params[:state] == "potential" %> - +
+
- - - <% @mods.each do |mod| %> - - - - - - - <% if params[:state] == "potential" %> - +
IDProfileCommentsBadgesLast CommentAction
<%= mod.id %><%= link_to mod.username, admin_user_path(mod.id) %><%= mod.comments_count %><%= mod.badge_achievements_count %><%= time_ago_in_words mod.last_comment_at %> ago - <%= form_with model: [:admin, mod], url: admin_mod_path(mod.id), method: :patch, local: true do |f| %> - <%= f.submit "Make Trusted Mod", class: "btn btn-light js-add-to-mod-channel" %> + + + + <%= paginate @mods, theme: "internal" %> + + + + + + + + + + <% if params[:state] == "potential" %> + + <% end %> + + + + <% @mods.each do |mod| %> + + + + + + + <% if params[:state] == "potential" %> + <% end %> - + <% end %> - - <% end %> - -
IDProfileCommentsBadgesLast CommentAction
<%= mod.id %><%= link_to mod.username, admin_user_path(mod.id) %><%= mod.comments_count %><%= mod.badge_achievements_count %><%= time_ago_in_words mod.last_comment_at %> ago + <%= form_with model: [:admin, mod], url: admin_mod_path(mod.id), method: :patch, local: true do |f| %> + <%= f.submit "Make Trusted Mod", class: "btn btn-light js-add-to-mod-channel" %> + <% end %> +
+
-<%= paginate @mods, theme: "internal" %> + <%= paginate @mods, theme: "internal" %> + diff --git a/app/views/admin/organizations/_activity.html.erb b/app/views/admin/organizations/_activity.html.erb index 592e2eb52..c2b0e92da 100644 --- a/app/views/admin/organizations/_activity.html.erb +++ b/app/views/admin/organizations/_activity.html.erb @@ -1,4 +1,4 @@ -
+

Activity

    @@ -6,4 +6,4 @@
  • <%= @organization.followers.size %> followers
-
+ diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index 89d8c21b6..c09a234f6 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -1,51 +1,53 @@ -
-
- <%= form_tag(admin_organizations_path, method: "get") do %> -
-
- <%= text_field_tag(:search, params[:search]) %> - <%= submit_tag("Search") %> +
+
-
+ <% end %> +
+ -<%= paginate @organizations %> + <%= paginate @organizations %> - - - - - - - - - - - - <% @organizations.each do |organization| %> +
NameIDTwitterGitHubURL
+ - - - <% if organization.twitter_username %> - - <% else %> - - <% end %> - <% if organization.github_username %> - - <% else %> - - <% end %> - <% if organization.url %> - - <% else %> - - <% end %> + + + + + - <% end %> - -
<%= link_to "@#{organization.name}", admin_organization_path(organization.id) %><%= organization.id %><%= link_to organization.twitter_username, "https://twitter.com/#{organization.twitter_username}" %>N/A<%= link_to organization.github_username, "https://github.com/#{organization.github_username}" %>N/A<%= link_to organization.url, organization.url %>N/ANameIDTwitterGitHubURL
+ + + <% @organizations.each do |organization| %> + + <%= link_to "@#{organization.name}", admin_organization_path(organization.id) %> + <%= organization.id %> + <% if organization.twitter_username %> + <%= link_to organization.twitter_username, "https://twitter.com/#{organization.twitter_username}" %> + <% else %> + N/A + <% end %> + <% if organization.github_username %> + <%= link_to organization.github_username, "https://github.com/#{organization.github_username}" %> + <% else %> + N/A + <% end %> + <% if organization.url %> + <%= link_to organization.url, organization.url %> + <% else %> + N/A + <% end %> + + <% end %> + + -<%= paginate @organizations %> + <%= paginate @organizations %> + diff --git a/app/views/admin/organizations/show.html.erb b/app/views/admin/organizations/show.html.erb index acaaf57c3..bf90ddcec 100644 --- a/app/views/admin/organizations/show.html.erb +++ b/app/views/admin/organizations/show.html.erb @@ -1,57 +1,58 @@ -
-
-

- <%= @organization.name %><%= link_to "@#{@organization.name}", "/#{@organization.slug}", class: "ml-2", target: "_blank", rel: "noopener" %> -

-

Created <%= @organization.created_at.strftime("%b %e '%y") %>

-
-
-

General Info

-
-
ID:
-
<%= @organization.id %>
-
name:
-
<%= @organization.name %>
-
Membership Count:
-
<%= @organization.organization_memberships.size %>
-
Email:
-
<%= @organization.email || "N/A" %>
-
Twitter:
- <% if @organization.twitter_username %> -
<%= link_to @organization.twitter_username, "https://twitter.com/#{@organization.twitter_username}" %>
- <% else %> -
N/A
- <% end %> -
GitHub:
- <% if @organization.github_username %> -
<%= link_to @organization.github_username, "https://github.com/#{@organization.github_username}" %>
- <% else %> -
N/A
- <% end %> -
-
-
- <% current_credits = @organization.unspent_credits_count %> -

Credits (currrent: <%= current_credits %>)

- <%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %> -
- <%= hidden_field_tag :credit_action, :add %> - <%= number_field_tag :credits, nil, in: 1...100_000, required: true, class: "form-control mr-3", size: 5 %> - <%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3" %> -
- <%= submit_tag "Add Org Credits", class: "btn btn-primary" %> - <% end %> - <% if current_credits.positive? %> +
+
+
+

+ <%= @organization.name %><%= link_to "@#{@organization.name}", "/#{@organization.slug}", class: "ml-2", target: "_blank", rel: "noopener" %> +

+

Created <%= @organization.created_at.strftime("%b %e '%y") %>

+
+
+

General Info

+
+
ID:
+
<%= @organization.id %>
+
Name:
+
<%= @organization.name %>
+
Membership Count:
+
<%= @organization.organization_memberships.size %>
+
Email:
+
<%= @organization.email || "N/A" %>
+
Twitter:
+ <% if @organization.twitter_username %> +
<%= link_to @organization.twitter_username, "https://twitter.com/#{@organization.twitter_username}" %>
+ <% else %> +
N/A
+ <% end %> +
GitHub:
+ <% if @organization.github_username %> +
<%= link_to @organization.github_username, "https://github.com/#{@organization.github_username}" %>
+ <% else %> +
N/A
+ <% end %> +
+
+
+ <% current_credits = @organization.unspent_credits_count %> +

Credits (currrent: <%= current_credits %>)

<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
- <%= hidden_field_tag :credit_action, :remove %> - <%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5 %> - <%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3" %> + <%= hidden_field_tag :credit_action, :add %> + <%= number_field_tag :credits, nil, in: 1...100_000, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %> + <%= text_field_tag :note, "", placeholder: "Why are you adding these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %>
- <%= submit_tag "Remove Org Credits", class: "btn btn-danger" %> + <%= submit_tag "Add Org Credits", class: "btn btn-primary" %> <% end %> - <% end %> -
-
- -<%= render "activity" %> + <% if current_credits.positive? %> + <%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %> +
+ <%= hidden_field_tag :credit_action, :remove %> + <%= number_field_tag :credits, nil, in: 1..current_credits, required: true, class: "form-control mr-3", size: 5, aria: { label: "Credits" } %> + <%= text_field_tag :note, "", placeholder: "Why are you removing these credits?", size: 50, required: true, class: "form-control mr-3", aria: { label: "Reason" } %> +
+ <%= submit_tag "Remove Org Credits", class: "btn btn-danger" %> + <% end %> + <% end %> +
+ + <%= render "activity" %> + diff --git a/app/views/admin/pages/edit.html.erb b/app/views/admin/pages/edit.html.erb index b60af7eab..1a534cd08 100644 --- a/app/views/admin/pages/edit.html.erb +++ b/app/views/admin/pages/edit.html.erb @@ -1,7 +1,9 @@ -
-
-

Edit <%= @page.title %>

+
+
+
+

Edit <%= @page.title %>

+
-
-<%= render "form" %> + <%= render "form" %> + diff --git a/app/views/admin/pages/index.html.erb b/app/views/admin/pages/index.html.erb index 32908853a..2964afb24 100644 --- a/app/views/admin/pages/index.html.erb +++ b/app/views/admin/pages/index.html.erb @@ -1,18 +1,20 @@ <%= csrf_meta_tags %> -
- <%= link_to "New Page", new_admin_page_path, class: "btn btn-primary" %> -
- -
- -
-
- <% @pages.each do |page| %> -
- <%= link_to page.title, edit_admin_page_path(page.id) %> - <%= link_to "View", page.path %> -
- <% end %> +
+
+ <%= link_to "New Page", new_admin_page_path, class: "btn btn-primary" %>
-
+ +
+ +
+
+ <% @pages.each do |page| %> +
+ <%= link_to page.title, edit_admin_page_path(page.id) %> + <%= link_to "View", page.path %> +
+ <% end %> +
+
+ diff --git a/app/views/admin/pages/new.html.erb b/app/views/admin/pages/new.html.erb index 97663e73d..b96ead9c0 100644 --- a/app/views/admin/pages/new.html.erb +++ b/app/views/admin/pages/new.html.erb @@ -1,7 +1,9 @@ -
-
-

New Page

+
+
+
+

New Page

+
-
-<%= render "form" %> + <%= render "form" %> + diff --git a/app/views/admin/permissions/index.html.erb b/app/views/admin/permissions/index.html.erb index 359594c81..09d435b52 100644 --- a/app/views/admin/permissions/index.html.erb +++ b/app/views/admin/permissions/index.html.erb @@ -1,36 +1,36 @@ -

Admin Roles

+
+
+
+

Admin Roles

+ <%= paginate @users %> -
-
- - <%= paginate @users %> - - - - - - - - - - - <% @users.each do |user| %> +
IDProfileRoles
+ - - - + + + - <% end %> - -
<%= user.id %><%= link_to "@#{user.username}", user.path %> -
    - <% user.roles.pluck(:name, :resource_type, :resource_id).each do |role| %> -
  • <%= role[0] %><%= ": #{role[1]}" if role[1] %><%= "/#{role[2]}" if role[2] %>
  • - <% end %> -
-
IDProfileRoles
+ + + <% @users.each do |user| %> + + <%= user.id %> + <%= link_to "@#{user.username}", user.path %> + +
    + <% user.roles.pluck(:name, :resource_type, :resource_id).each do |role| %> +
  • <%= role[0] %><%= ": #{role[1]}" if role[1] %><%= "/#{role[2]}" if role[2] %>
  • + <% end %> +
+ + + <% end %> + + - <%= paginate @users %> + <%= paginate @users %> +
-
+
diff --git a/app/views/admin/podcasts/index.html.erb b/app/views/admin/podcasts/index.html.erb index 69bfe7bd9..56a961bf2 100644 --- a/app/views/admin/podcasts/index.html.erb +++ b/app/views/admin/podcasts/index.html.erb @@ -1,49 +1,51 @@ -
-
- <%= form_tag("/admin/podcasts", method: "get") do %> -
-
- <%= text_field_tag(:search, params[:search]) %> - <%= submit_tag("Search") %> +
+
-
+ <% end %> +
+ -<%= paginate @podcasts %> + <%= paginate @podcasts %> - - - - - - - - - - - - - - - <% @podcasts.each do |podcast| %> - - - - - - - - - - - <% end %> - -
IDTitleFeed URLEpsReachPubStatus NoticeAdmin
<%= podcast.id %><%= link_to podcast.title, edit_admin_podcast_path(podcast) %><%= link_to podcast.feed_url, podcast.feed_url %><%= podcast.episodes_count %><%= podcast.reachable %><%= podcast.published %><%= podcast.status_notice %> - <% podcast.admins.pluck(:username).each do |username| %> - <%= link_to "@#{username}", "/#{username}" %> - <% end %> -
+ + + + + + + + + + + + + + + <% @podcasts.each do |podcast| %> + + + + + + + + + + + <% end %> + +
IDTitleFeed URLEpsReachPubStatus NoticeAdmin
<%= podcast.id %><%= link_to podcast.title, edit_admin_podcast_path(podcast) %><%= link_to podcast.feed_url, podcast.feed_url %><%= podcast.episodes_count %><%= podcast.reachable %><%= podcast.published %><%= podcast.status_notice %> + <% podcast.admins.pluck(:username).each do |username| %> + <%= link_to "@#{username}", "/#{username}" %> + <% end %> +
-<%= paginate @podcasts %> + <%= paginate @podcasts %> + diff --git a/app/views/admin/privileged_reactions/index.html.erb b/app/views/admin/privileged_reactions/index.html.erb index 0c8620413..bb29e1799 100644 --- a/app/views/admin/privileged_reactions/index.html.erb +++ b/app/views/admin/privileged_reactions/index.html.erb @@ -1,57 +1,58 @@ -
-
-
-
- <%= search_form_for @q, url: admin_privileged_reactions_path, class: "form-inline justify-content-end" do |f| %> +
+
+ <%= f.submit "Search", class: "btn btn-secondary" %> + <% end %> +
+ -<%= paginate @privileged_reactions %> + <%= paginate @privileged_reactions %> - - - - - - - - - - - - - <% @privileged_reactions.each do |reaction| %> +
IDUserTypeActionContentDate
+ - - - - - - + + + + + + - <% end %> - -
<%= reaction.id %><%= link_to reaction.user.username, admin_user_path(reaction.user_id) %><%= reaction.reactable_type %><%= reaction.category %> - <% if reaction.reactable_type == "Article" %> - <%= link_to reaction.reactable.title, reaction.reactable.path %> - <% elsif reaction.reactable_type == "User" %> - <%= link_to reaction.reactable.username, reaction.reactable.path %> - <% elsif reaction.reactable_type == "Comment" %> - <%= link_to "#{reaction.reactable.user.username}'s Comment", reaction.reactable.path %> - <% end %> - <%= reaction.created_at %>IDUserTypeActionContentDate
+ + + <% @privileged_reactions.each do |reaction| %> + + <%= reaction.id %> + <%= link_to reaction.user.username, admin_user_path(reaction.user_id) %> + <%= reaction.reactable_type %> + <%= reaction.category %> + + <% if reaction.reactable_type == "Article" %> + <%= link_to reaction.reactable.title, reaction.reactable.path %> + <% elsif reaction.reactable_type == "User" %> + <%= link_to reaction.reactable.username, reaction.reactable.path %> + <% elsif reaction.reactable_type == "Comment" %> + <%= link_to "#{reaction.reactable.user.username}'s Comment", reaction.reactable.path %> + <% end %> + + <%= reaction.created_at %> + + <% end %> + + -<%= paginate @privileged_reactions %> + <%= paginate @privileged_reactions %> + diff --git a/app/views/admin/profile_fields/index.html.erb b/app/views/admin/profile_fields/index.html.erb index cff2b3e3f..2c36ea342 100644 --- a/app/views/admin/profile_fields/index.html.erb +++ b/app/views/admin/profile_fields/index.html.erb @@ -1,22 +1,24 @@ -
- <%= form_for [:admin, ProfileField.new], html: { class: "inline-form" } do |form| %> -
- <%= render "form", form: form %> - <%= form.submit class: "btn btn-primary" %> -
- <% end %> -
- -<% @profile_fields.each do |group, fields| %> -

Group: <%= group %>

- - <% fields.each do |field| %> -
- <%= form_for [:admin, field] do |form| %> +
+
+ <%= form_for [:admin, ProfileField.new], html: { class: "inline-form" } do |form| %> +
<%= render "form", form: form %> <%= form.submit class: "btn btn-primary" %> - <% end %> - <%= button_to "Delete", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %> -
+
+ <% end %> + + + <% @profile_fields.each do |group, fields| %> +

Group: <%= group %>

+ + <% fields.each do |field| %> +
+ <%= form_for [:admin, field] do |form| %> + <%= render "form", form: form %> + <%= form.submit class: "btn btn-primary" %> + <% end %> + <%= button_to "Delete", admin_profile_field_path(field), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-secondary" %> +
+ <% end %> <% end %> -<% end %> + diff --git a/app/views/admin/secrets/index.html.erb b/app/views/admin/secrets/index.html.erb index e76e1676a..15acd78d9 100644 --- a/app/views/admin/secrets/index.html.erb +++ b/app/views/admin/secrets/index.html.erb @@ -1,29 +1,31 @@ -<% if !@vault_enabled %> - -<% end %> +
+ <% if !@vault_enabled %> + + <% end %> - - - - - - - - - - <% @secrets.each do |key, partial_value| %> +
Secret NameSecret ValueAction
+ - <%= form_with(url: "/admin/secrets", method: "PUT", local: true) do %> - - - - <% end %> + + + - <% end %> - -
<%= label_tag key, key %><%= text_field_tag key, partial_value %> - <%= submit_tag("Update", data: { confirm: "My username is @#{current_user.username} and I want to update this Vault Secret." }, disabled: !@vault_enabled) %>Secret NameSecret ValueAction
+ + + <% @secrets.each do |key, partial_value| %> + + <%= form_with(url: "/admin/secrets", method: "PUT", local: true) do %> + <%= label_tag key, key %> + <%= text_field_tag key, partial_value %> + + <%= submit_tag("Update", data: { confirm: "My username is @#{current_user.username} and I want to update this Vault Secret." }, disabled: !@vault_enabled) %> + <% end %> + + <% end %> + + +
-
- -
-
- <%= form_tag(admin_tags_path, method: "get") do %> -
-
- <%= text_field_tag(:search, params[:search]) %> - <% if params[:state].present? %> - <%= hidden_field_tag(:state, params[:state]) %> - <% end %> - <%= submit_tag("Search") %> +
+
-
+ <% end %> +
+ -<%= paginate @tags %> + <%= paginate @tags %> - - - - - - - - - - - - - <% @tags.each do |tag| %> +
TagIDAlias ForTaggings CountCategoryIs Moderated?
+ - - - - - - + + + + + + - <% end %> - -
<%= link_to tag.name, admin_tag_path(tag.id) %><%= tag.id %><%= tag.alias_for %><%= tag.taggings_count %><%= tag.category %><%= tag.tag_moderator_ids.any? %>TagIDAlias ForTaggings CountCategoryIs Moderated?
+ + + <% @tags.each do |tag| %> + + <%= link_to tag.name, admin_tag_path(tag.id) %> + <%= tag.id %> + <%= tag.alias_for %> + <%= tag.taggings_count %> + <%= tag.category %> + <%= tag.tag_moderator_ids.any? %> + + <% end %> + + -<%= paginate @tags %> + <%= paginate @tags %> + diff --git a/app/views/admin/tags/show.html.erb b/app/views/admin/tags/show.html.erb index 0dcbc566f..531f40773 100644 --- a/app/views/admin/tags/show.html.erb +++ b/app/views/admin/tags/show.html.erb @@ -1,4 +1,4 @@ -
+

#<%= @tag.name %>, tagged <%= @tag.taggings_count %> times. @@ -23,7 +23,7 @@ <% end %> <%= form_for [:admin, @tag], html: { class: "form-inline justify-content-between" } do |f| %>
- <%= f.label "Add Moderator (id):", class: "mr-3" %> + <%= f.label :tag_moderator_id, "Add Moderator (id):", class: "mr-3" %> <%= f.text_field :tag_moderator_id, class: "form-control" %>
@@ -84,4 +84,4 @@ <%= f.submit class: "btn btn-primary float-right" %> <% end %>
-

+
diff --git a/app/views/admin/tools/index.html.erb b/app/views/admin/tools/index.html.erb index f471c9d5e..48c0bbf20 100644 --- a/app/views/admin/tools/index.html.erb +++ b/app/views/admin/tools/index.html.erb @@ -1,41 +1,43 @@ -

General Purpose URL Purge

-

For a page that should 404. This will purge the page via Fastly.

-

Use the full path (<%= app_url("xyz") %>) or the relative path: (/xyz)

-
- <%= form_tag bust_cache_admin_tools_path do %> -
-
- <%= label_tag("Link:") %> - <%= text_field_tag :dead_link, nil, placeholder: "/xyz" %> - <%= submit_tag("Clear Cache") %> +
+

General Purpose URL Purge

+

For a page that should 404. This will purge the page via Fastly.

+

Use the full path (<%= app_url("xyz") %>) or the relative path: (/xyz)

+
+ <%= form_tag bust_cache_admin_tools_path do %> +
+
+ <%= label_tag :dead_link, "Link:" %> + <%= text_field_tag :dead_link, nil, placeholder: "/xyz" %> + <%= submit_tag("Clear Cache") %> +
-
- <% end %> -
+ <% end %> +
-
+
-

Bust Cache For Specific Content

-

This clears both the Rails cache & the Fastly cache.

-
- <%= form_tag bust_cache_admin_tools_path do %> -
-
- <%= label_tag("Article ID: ") %> - <%= text_field_tag :bust_article, nil, placeholder: "12345" %> - <%= submit_tag("Clear Article Cache") %> +

Bust Cache For Specific Content

+

This clears both the Rails cache & the Fastly cache.

+
+ <%= form_tag bust_cache_admin_tools_path do %> +
+
+ <%= label_tag :bust_article, "Article ID:" %> + <%= text_field_tag :bust_article, nil, placeholder: "12345" %> + <%= submit_tag("Clear Article Cache") %> +
-
- <% end %> -
-
- <%= form_tag bust_cache_admin_tools_path do %> -
-
- <%= label_tag("User ID: ") %> - <%= text_field_tag :bust_user, nil, placeholder: "12345" %> - <%= submit_tag("Clear User Cache") %> + <% end %> +
+
+ <%= form_tag bust_cache_admin_tools_path do %> +
+
+ <%= label_tag :bust_user, "User ID:" %> + <%= text_field_tag :bust_user, nil, placeholder: "12345" %> + <%= submit_tag("Clear User Cache") %> +
-
- <% end %> -
+ <% end %> +
+ diff --git a/app/views/admin/webhook_endpoints/index.html.erb b/app/views/admin/webhook_endpoints/index.html.erb index 15581f861..b564be59d 100644 --- a/app/views/admin/webhook_endpoints/index.html.erb +++ b/app/views/admin/webhook_endpoints/index.html.erb @@ -1,28 +1,30 @@ -<%= paginate @endpoints %> +
+ <%= paginate @endpoints %> - - - - - - - - - - - - - <% @endpoints.each do |endpoint| %> +
Target URLIDEventsSourceUserCreated at
+ - - - - - - + + + + + + + + + <% @endpoints.each do |endpoint| %> + + + + + + + + <% end %> - -
<%= link_to endpoint.target_url, endpoint.target_url %><%= endpoint.id %><%= endpoint.events.join(", ") %><%= endpoint.source %><%= link_to endpoint.user.username, endpoint.user.path %><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %>Target URLIDEventsSourceUserCreated At
<%= link_to endpoint.target_url, endpoint.target_url %><%= endpoint.id %><%= endpoint.events.join(", ") %><%= endpoint.source %><%= link_to endpoint.user.username, endpoint.user.path %><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %>
+ + -<%= paginate @endpoints %> + <%= paginate @endpoints %> +
diff --git a/app/views/admin/welcome/index.html.erb b/app/views/admin/welcome/index.html.erb index 993c095da..e0619f66c 100644 --- a/app/views/admin/welcome/index.html.erb +++ b/app/views/admin/welcome/index.html.erb @@ -1,17 +1,19 @@ -
<%= flash[:notice] %>
-<%= csrf_meta_tags %> +
+
<%= flash[:notice] %>
+ <%= csrf_meta_tags %> -
- <%= link_to "Create A New Welcome Thread", admin_welcome_index_path, method: :post, class: "btn btn-primary" %> -
- -

All Welcome Threads

-
- -
-
- <% @daily_threads.each do |thread| %> - <%= thread.title %> - <% end %> +
+ <%= link_to "Create A New Welcome Thread", admin_welcome_index_path, method: :post, class: "btn btn-primary" %>
-
+ +

All Welcome Threads

+
+ +
+
+ <% @daily_threads.each do |thread| %> + <%= thread.title %> + <% end %> +
+
+