Add simple admin overview of PuSH subscriptions
This commit is contained in:
11
app/controllers/admin/pubsubhubbub_controller.rb
Normal file
11
app/controllers/admin/pubsubhubbub_controller.rb
Normal file
@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::PubsubhubbubController < ApplicationController
|
||||
before_action :require_admin!
|
||||
|
||||
layout 'public'
|
||||
|
||||
def index
|
||||
@subscriptions = Subscription.includes(:account).paginate(page: params[:page], per_page: 40)
|
||||
end
|
||||
end
|
@ -31,6 +31,10 @@ class ApplicationController < ActionController::Base
|
||||
I18n.locale = I18n.default_locale
|
||||
end
|
||||
|
||||
def require_admin!
|
||||
redirect_to root_path unless current_user&.admin?
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def not_found
|
||||
|
Reference in New Issue
Block a user