Move admin/pubsubhubbub controller to admin/subscriptions (#3442)
parent
a132332b86
commit
de4681b2be
29 changed files with 58 additions and 48 deletions
@ -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 |
@ -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 |
@ -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 |
@ -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 |
@ -1,7 +1,7 @@ |
||||
# frozen_string_literal: true |
||||
require 'rails_helper' |
||||
|
||||
RSpec.describe Admin::PubsubhubbubController, type: :controller do |
||||
RSpec.describe Admin::SubscriptionsController, type: :controller do |
||||
render_views |
||||
|
||||
describe 'GET #index' do |
Loading…
Reference in new issue