about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-31 14:39:35 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-31 20:39:35 +0200
commitde4681b2be0b0efa1dede092445a53d4a593c140 (patch)
tree2b481f7ceef23f467dafaa4eba7e35db0559a42e /app
parenta132332b861f997540f30be1b90ade4648834b5b (diff)
Move admin/pubsubhubbub controller to admin/subscriptions (#3442)
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/pubsubhubbub_controller.rb9
-rw-r--r--app/controllers/admin/subscriptions_controller.rb19
-rw-r--r--app/views/admin/pubsubhubbub/index.html.haml15
-rw-r--r--app/views/admin/subscriptions/_subscription.html.haml (renamed from app/views/admin/pubsubhubbub/_subscription.html.haml)0
-rw-r--r--app/views/admin/subscriptions/index.html.haml15
5 files changed, 34 insertions, 24 deletions
diff --git a/app/controllers/admin/pubsubhubbub_controller.rb b/app/controllers/admin/pubsubhubbub_controller.rb
deleted file mode 100644
index 2677a59e4..000000000
--- a/app/controllers/admin/pubsubhubbub_controller.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-module Admin
-  class PubsubhubbubController < BaseController
-    def index
-      @subscriptions = Subscription.order(id: :desc).includes(:account).page(params[:page])
-    end
-  end
-end
diff --git a/app/controllers/admin/subscriptions_controller.rb b/app/controllers/admin/subscriptions_controller.rb
new file mode 100644
index 000000000..624a475a3
--- /dev/null
+++ b/app/controllers/admin/subscriptions_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Admin
+  class SubscriptionsController < BaseController
+    def index
+      @subscriptions = ordered_subscriptions.page(requested_page)
+    end
+
+    private
+
+    def ordered_subscriptions
+      Subscription.order(id: :desc).includes(:account)
+    end
+
+    def requested_page
+      params[:page].to_i
+    end
+  end
+end
diff --git a/app/views/admin/pubsubhubbub/index.html.haml b/app/views/admin/pubsubhubbub/index.html.haml
deleted file mode 100644
index 066d9e5c6..000000000
--- a/app/views/admin/pubsubhubbub/index.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-- content_for :page_title do
-  = t('admin.pubsubhubbub.title')
-
-%table.table
-  %thead
-    %tr
-      %th= t('admin.pubsubhubbub.topic')
-      %th= t('admin.pubsubhubbub.callback_url')
-      %th= t('admin.pubsubhubbub.confirmed')
-      %th= t('admin.pubsubhubbub.expires_in')
-      %th= t('admin.pubsubhubbub.last_delivery')
-  %tbody
-    = render partial: 'subscription', collection: @subscriptions
-
-= paginate @subscriptions
diff --git a/app/views/admin/pubsubhubbub/_subscription.html.haml b/app/views/admin/subscriptions/_subscription.html.haml
index 024788e13..024788e13 100644
--- a/app/views/admin/pubsubhubbub/_subscription.html.haml
+++ b/app/views/admin/subscriptions/_subscription.html.haml
diff --git a/app/views/admin/subscriptions/index.html.haml b/app/views/admin/subscriptions/index.html.haml
new file mode 100644
index 000000000..21b3238a6
--- /dev/null
+++ b/app/views/admin/subscriptions/index.html.haml
@@ -0,0 +1,15 @@
+- content_for :page_title do
+  = t('admin.subscriptions.title')
+
+%table.table
+  %thead
+    %tr
+      %th= t('admin.subscriptions.topic')
+      %th= t('admin.subscriptions.callback_url')
+      %th= t('admin.subscriptions.confirmed')
+      %th= t('admin.subscriptions.expires_in')
+      %th= t('admin.subscriptions.last_delivery')
+  %tbody
+    = render @subscriptions
+
+= paginate @subscriptions