From 32dd14f4616c1acee31b23643bfd40b7b1135f0c Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 16 Jan 2021 03:23:57 -0600 Subject: [PATCH] Remove /admin/dashboard page. This page was just a combination of the forum listing and the bulk update requests listing. It got zero hits in the last week. --- .../admin/dashboards_controller.rb | 7 ----- app/logical/admin_dashboard.rb | 17 ------------ app/views/admin/dashboards/_aliases.html.erb | 0 app/views/admin/dashboards/show.html.erb | 27 ------------------- app/views/static/site_map.html.erb | 4 --- config/routes.rb | 1 - .../admin/dashboards_controller_test.rb | 16 ----------- 7 files changed, 72 deletions(-) delete mode 100644 app/controllers/admin/dashboards_controller.rb delete mode 100644 app/logical/admin_dashboard.rb delete mode 100644 app/views/admin/dashboards/_aliases.html.erb delete mode 100644 app/views/admin/dashboards/show.html.erb delete mode 100644 test/functional/admin/dashboards_controller_test.rb diff --git a/app/controllers/admin/dashboards_controller.rb b/app/controllers/admin/dashboards_controller.rb deleted file mode 100644 index c6ec0a31a..000000000 --- a/app/controllers/admin/dashboards_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Admin - class DashboardsController < ApplicationController - def show - @dashboard = AdminDashboard.new - end - end -end diff --git a/app/logical/admin_dashboard.rb b/app/logical/admin_dashboard.rb deleted file mode 100644 index b15b039ff..000000000 --- a/app/logical/admin_dashboard.rb +++ /dev/null @@ -1,17 +0,0 @@ -class AdminDashboard - def tag_aliases - TagAlias.where(status: "pending").order("id desc") - end - - def tag_implications - TagImplication.where(status: "pending").order("id desc") - end - - def update_requests - BulkUpdateRequest.where(status: "pending").order("id desc") - end - - def forum_topics - ForumTopic.search(category_id: 1).order("id desc").limit(20) - end -end diff --git a/app/views/admin/dashboards/_aliases.html.erb b/app/views/admin/dashboards/_aliases.html.erb deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/admin/dashboards/show.html.erb b/app/views/admin/dashboards/show.html.erb deleted file mode 100644 index 682cc1f03..000000000 --- a/app/views/admin/dashboards/show.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<% page_title "Admin Dashboard" %> - -
-
-

Admin Dashboard

- -
-

Aliases

- <%= render "tag_aliases/listing", :tag_aliases => @dashboard.tag_aliases %> -
- -
-

Implications

- <%= render "tag_implications/listing", :tag_implications => @dashboard.tag_implications %> -
- -
-

Bulk Update Requests

- <%= render "bulk_update_requests/listing", :bulk_update_requests => @dashboard.update_requests %> -
- -
-

Forum Topics

- <%= render "forum_topics/listing", forum_topics: @dashboard.forum_topics, read_forum_topics: @dashboard.forum_topics.read_by_user(CurrentUser.user) %> -
-
-
diff --git a/app/views/static/site_map.html.erb b/app/views/static/site_map.html.erb index d6a93fdfe..752d5d9c6 100644 --- a/app/views/static/site_map.html.erb +++ b/app/views/static/site_map.html.erb @@ -167,10 +167,6 @@ <% if policy(NewsUpdate).index? %>
  • <%= link_to("News Updates", news_updates_path) %>
  • <% end %> - - <% if CurrentUser.is_admin? %> -
  • <%= link_to("Admin Dashboard", admin_dashboard_path) %>
  • - <% end %> diff --git a/config/routes.rb b/config/routes.rb index 5457e8719..f17174cb0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,6 @@ Rails.application.routes.draw do namespace :admin do resources :users, :only => [:edit, :update] - resource :dashboard, :only => [:show] end namespace :moderator do resource :dashboard, :only => [:show] diff --git a/test/functional/admin/dashboards_controller_test.rb b/test/functional/admin/dashboards_controller_test.rb deleted file mode 100644 index 853081138..000000000 --- a/test/functional/admin/dashboards_controller_test.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'test_helper' - -class Admin::DashboardsControllerTest < ActionDispatch::IntegrationTest - context "The admin dashboard controller" do - setup do - @admin = create(:admin_user) - end - - context "show action" do - should "render" do - get_auth admin_dashboard_path, @admin - assert_response :success - end - end - end -end