diff --git a/app/queries/admin/moderators_query.rb b/app/queries/admin/moderators_query.rb index b8b95d9ab..2de7bb2a9 100644 --- a/app/queries/admin/moderators_query.rb +++ b/app/queries/admin/moderators_query.rb @@ -24,7 +24,7 @@ module Admin end def self.role_id_for(role) - Role.find_by!(name: role).id + Role.find_by(name: role)&.id end def self.search_relation(relation, search) diff --git a/app/views/admin/mods/index.html.erb b/app/views/admin/mods/index.html.erb index 8790623a2..5163d61d9 100644 --- a/app/views/admin/mods/index.html.erb +++ b/app/views/admin/mods/index.html.erb @@ -19,40 +19,43 @@ <%= f.submit "Search", class: "btn btn-light" %> <% end %> +<% if @mods.empty? %> +
| ID | -Profile | -Comments | -Badges | -Last Comment | - <% if params[:state] == "potential" %> -Action | - <% end %> -
|---|
| <%= 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 | +ID | +Profile | +Comments | +Badges | +Last Comment | <% if params[:state] == "potential" %> -- <%= 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 %> - | +Action | <% end %>
|---|