Move admin/pubsubhubbub controller to admin/subscriptions (#3442)
This commit is contained in:
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
|
|
19
app/controllers/admin/subscriptions_controller.rb
Normal file
19
app/controllers/admin/subscriptions_controller.rb
Normal file
|
@ -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
|
|
15
app/views/admin/subscriptions/index.html.haml
Normal file
15
app/views/admin/subscriptions/index.html.haml
Normal file
|
@ -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
|
|
@ -134,7 +134,7 @@ ca:
|
||||||
account_count: Comptes coneguts
|
account_count: Comptes coneguts
|
||||||
domain_name: Domini
|
domain_name: Domini
|
||||||
title: Instàncies conegudes
|
title: Instàncies conegudes
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Confirmat
|
confirmed: Confirmat
|
||||||
expires_in: Expira en
|
expires_in: Expira en
|
||||||
|
|
|
@ -119,7 +119,7 @@ de:
|
||||||
account_count: Bekannte Konten
|
account_count: Bekannte Konten
|
||||||
domain_name: Domain
|
domain_name: Domain
|
||||||
title: Bekannte Instanzen
|
title: Bekannte Instanzen
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback-URL
|
callback_url: Callback-URL
|
||||||
confirmed: Bestätigt
|
confirmed: Bestätigt
|
||||||
expires_in: Verfällt in
|
expires_in: Verfällt in
|
||||||
|
|
|
@ -134,7 +134,7 @@ en:
|
||||||
account_count: Known accounts
|
account_count: Known accounts
|
||||||
domain_name: Domain
|
domain_name: Domain
|
||||||
title: Known Instances
|
title: Known Instances
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Confirmed
|
confirmed: Confirmed
|
||||||
expires_in: Expires in
|
expires_in: Expires in
|
||||||
|
|
|
@ -130,7 +130,7 @@ fa:
|
||||||
account_count: حسابهای شناختهشده
|
account_count: حسابهای شناختهشده
|
||||||
domain_name: دامین
|
domain_name: دامین
|
||||||
title: سرورهای شناختهشده
|
title: سرورهای شناختهشده
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: نشانی Callback
|
callback_url: نشانی Callback
|
||||||
confirmed: تأییدشده
|
confirmed: تأییدشده
|
||||||
expires_in: مهلت انقضا
|
expires_in: مهلت انقضا
|
||||||
|
|
|
@ -110,7 +110,7 @@ fr:
|
||||||
undo: Annuler
|
undo: Annuler
|
||||||
title: Blocage de domaines
|
title: Blocage de domaines
|
||||||
undo: Annuler
|
undo: Annuler
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: URL de rappel
|
callback_url: URL de rappel
|
||||||
confirmed: Confirmé
|
confirmed: Confirmé
|
||||||
expires_in: Expire dans
|
expires_in: Expire dans
|
||||||
|
|
|
@ -134,7 +134,7 @@ he:
|
||||||
account_count: חשבונות מוכרים
|
account_count: חשבונות מוכרים
|
||||||
domain_name: שם מתחם
|
domain_name: שם מתחם
|
||||||
title: שרתים מוכרים
|
title: שרתים מוכרים
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: קישורית Callback
|
callback_url: קישורית Callback
|
||||||
confirmed: מאושר
|
confirmed: מאושר
|
||||||
expires_in: פג תוקף ב-
|
expires_in: פג תוקף ב-
|
||||||
|
|
|
@ -129,7 +129,7 @@ id:
|
||||||
account_count: Akun yang diketahui
|
account_count: Akun yang diketahui
|
||||||
domain_name: Domain
|
domain_name: Domain
|
||||||
title: Server yang diketahui
|
title: Server yang diketahui
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Dikonfirmasi
|
confirmed: Dikonfirmasi
|
||||||
expires_in: Kadaluarsa dalam
|
expires_in: Kadaluarsa dalam
|
||||||
|
|
|
@ -118,7 +118,7 @@ io:
|
||||||
account_count: Known accounts
|
account_count: Known accounts
|
||||||
domain_name: Domain
|
domain_name: Domain
|
||||||
title: Known Instances
|
title: Known Instances
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Confirmed
|
confirmed: Confirmed
|
||||||
expires_in: Expires in
|
expires_in: Expires in
|
||||||
|
|
|
@ -134,7 +134,7 @@ ja:
|
||||||
account_count: 既知のアカウント数
|
account_count: 既知のアカウント数
|
||||||
domain_name: ドメイン名
|
domain_name: ドメイン名
|
||||||
title: 既知のインスタンス
|
title: 既知のインスタンス
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: コールバックURL
|
callback_url: コールバックURL
|
||||||
confirmed: 確認済み
|
confirmed: 確認済み
|
||||||
expires_in: 期限
|
expires_in: 期限
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
account_count: Kjente kontoer
|
account_count: Kjente kontoer
|
||||||
domain_name: Domene
|
domain_name: Domene
|
||||||
title: Kjente instanser
|
title: Kjente instanser
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback-URL
|
callback_url: Callback-URL
|
||||||
confirmed: Bekreftet
|
confirmed: Bekreftet
|
||||||
expires_in: Utløper om
|
expires_in: Utløper om
|
||||||
|
|
|
@ -134,7 +134,7 @@ oc:
|
||||||
account_count: Comptes coneguts
|
account_count: Comptes coneguts
|
||||||
domain_name: Domeni
|
domain_name: Domeni
|
||||||
title: Instàncias conegudas
|
title: Instàncias conegudas
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: URL de rapèl
|
callback_url: URL de rapèl
|
||||||
confirmed: Confirmat
|
confirmed: Confirmat
|
||||||
expires_in: S’acaba dins
|
expires_in: S’acaba dins
|
||||||
|
|
|
@ -134,7 +134,7 @@ pl:
|
||||||
account_count: Znane konta
|
account_count: Znane konta
|
||||||
domain_name: Domena
|
domain_name: Domena
|
||||||
title: Znane instancje
|
title: Znane instancje
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: URL zwrotny
|
callback_url: URL zwrotny
|
||||||
confirmed: Potwierdzono
|
confirmed: Potwierdzono
|
||||||
expires_in: Wygasa
|
expires_in: Wygasa
|
||||||
|
|
|
@ -130,7 +130,7 @@ pt-BR:
|
||||||
account_count: Contas conhecidas
|
account_count: Contas conhecidas
|
||||||
domain_name: Domínio
|
domain_name: Domínio
|
||||||
title: Instâncias conhecidas
|
title: Instâncias conhecidas
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: URL de Callback
|
callback_url: URL de Callback
|
||||||
confirmed: Confirmado
|
confirmed: Confirmado
|
||||||
expires_in: Expira em
|
expires_in: Expira em
|
||||||
|
|
|
@ -126,7 +126,7 @@ pt:
|
||||||
account_count: Contas conhecidas
|
account_count: Contas conhecidas
|
||||||
domain_name: Domínio
|
domain_name: Domínio
|
||||||
title: Instâncias conhecidas
|
title: Instâncias conhecidas
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: URL de Callback
|
callback_url: URL de Callback
|
||||||
confirmed: Confirmado
|
confirmed: Confirmado
|
||||||
expires_in: Expira em
|
expires_in: Expira em
|
||||||
|
|
|
@ -113,7 +113,7 @@ ru:
|
||||||
undo: Отменить
|
undo: Отменить
|
||||||
title: Доменные блокировки
|
title: Доменные блокировки
|
||||||
undo: Отемнить
|
undo: Отемнить
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Подтверждено
|
confirmed: Подтверждено
|
||||||
expires_in: Истекает через
|
expires_in: Истекает через
|
||||||
|
|
|
@ -131,7 +131,7 @@ th:
|
||||||
account_count: Known accounts
|
account_count: Known accounts
|
||||||
domain_name: ชื่อโดเมน
|
domain_name: ชื่อโดเมน
|
||||||
title: Known Instances
|
title: Known Instances
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: ยืนยัน
|
confirmed: ยืนยัน
|
||||||
expires_in: หมดอายุภายใน
|
expires_in: หมดอายุภายใน
|
||||||
|
|
|
@ -130,7 +130,7 @@ tr:
|
||||||
account_count: Bilinen hesaplar
|
account_count: Bilinen hesaplar
|
||||||
domain_name: Domain
|
domain_name: Domain
|
||||||
title: Bilinen Sunucular
|
title: Bilinen Sunucular
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback linki
|
callback_url: Callback linki
|
||||||
confirmed: Onaylandı
|
confirmed: Onaylandı
|
||||||
expires_in: Bitiş Tarihi
|
expires_in: Bitiş Tarihi
|
||||||
|
|
|
@ -113,7 +113,7 @@ uk:
|
||||||
undo: Відмінити
|
undo: Відмінити
|
||||||
title: Доменні блокування
|
title: Доменні блокування
|
||||||
undo: Відмінити
|
undo: Відмінити
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: Підтверджено
|
confirmed: Підтверджено
|
||||||
expires_in: Спливає через
|
expires_in: Спливає через
|
||||||
|
|
|
@ -134,7 +134,7 @@ zh-CN:
|
||||||
account_count: 已知帐号
|
account_count: 已知帐号
|
||||||
domain_name: 域名
|
domain_name: 域名
|
||||||
title: 已知实例
|
title: 已知实例
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: 回调 URL
|
callback_url: 回调 URL
|
||||||
confirmed: 确定
|
confirmed: 确定
|
||||||
expires_in: 期限
|
expires_in: 期限
|
||||||
|
|
|
@ -130,7 +130,7 @@ zh-HK:
|
||||||
account_count: 已知帳號
|
account_count: 已知帳號
|
||||||
domain_name: 域名
|
domain_name: 域名
|
||||||
title: 已知服務站
|
title: 已知服務站
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: 回傳 URL
|
callback_url: 回傳 URL
|
||||||
confirmed: 確定
|
confirmed: 確定
|
||||||
expires_in: 期限
|
expires_in: 期限
|
||||||
|
|
|
@ -92,7 +92,7 @@ zh-TW:
|
||||||
title: 新封鎖網域
|
title: 新封鎖網域
|
||||||
severity: 嚴重度
|
severity: 嚴重度
|
||||||
title: 網域封鎖
|
title: 網域封鎖
|
||||||
pubsubhubbub:
|
subscriptions:
|
||||||
callback_url: Callback URL
|
callback_url: Callback URL
|
||||||
confirmed: 已確認
|
confirmed: 已確認
|
||||||
expires_in: 期限
|
expires_in: 期限
|
||||||
|
|
|
@ -19,7 +19,7 @@ SimpleNavigation::Configuration.run do |navigation|
|
||||||
admin.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_url, highlights_on: %r{/admin/reports}
|
admin.item :reports, safe_join([fa_icon('flag fw'), t('admin.reports.title')]), admin_reports_url, highlights_on: %r{/admin/reports}
|
||||||
admin.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts}
|
admin.item :accounts, safe_join([fa_icon('users fw'), t('admin.accounts.title')]), admin_accounts_url, highlights_on: %r{/admin/accounts}
|
||||||
admin.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url, highlights_on: %r{/admin/instances}
|
admin.item :instances, safe_join([fa_icon('cloud fw'), t('admin.instances.title')]), admin_instances_url, highlights_on: %r{/admin/instances}
|
||||||
admin.item :pubsubhubbubs, safe_join([fa_icon('paper-plane-o fw'), t('admin.pubsubhubbub.title')]), admin_pubsubhubbub_index_url
|
admin.item :subscriptions, safe_join([fa_icon('paper-plane-o fw'), t('admin.subscriptions.title')]), admin_subscriptions_url
|
||||||
admin.item :domain_blocks, safe_join([fa_icon('lock fw'), t('admin.domain_blocks.title')]), admin_domain_blocks_url, highlights_on: %r{/admin/domain_blocks}
|
admin.item :domain_blocks, safe_join([fa_icon('lock fw'), t('admin.domain_blocks.title')]), admin_domain_blocks_url, highlights_on: %r{/admin/domain_blocks}
|
||||||
admin.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url, link_html: { target: 'sidekiq' }
|
admin.item :sidekiq, safe_join([fa_icon('diamond fw'), 'Sidekiq']), sidekiq_url, link_html: { target: 'sidekiq' }
|
||||||
admin.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url, link_html: { target: 'pghero' }
|
admin.item :pghero, safe_join([fa_icon('database fw'), 'PgHero']), pghero_url, link_html: { target: 'pghero' }
|
||||||
|
|
|
@ -74,7 +74,7 @@ Rails.application.routes.draw do
|
||||||
resource :authorize_follow, only: [:show, :create]
|
resource :authorize_follow, only: [:show, :create]
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :pubsubhubbub, only: [:index]
|
resources :subscriptions, only: [:index]
|
||||||
resources :domain_blocks, only: [:index, :new, :create, :show, :destroy]
|
resources :domain_blocks, only: [:index, :new, :create, :show, :destroy]
|
||||||
resource :settings, only: [:edit, :update]
|
resource :settings, only: [:edit, :update]
|
||||||
resources :instances, only: [:index]
|
resources :instances, only: [:index]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
RSpec.describe Admin::PubsubhubbubController, type: :controller do
|
RSpec.describe Admin::SubscriptionsController, type: :controller do
|
||||||
render_views
|
render_views
|
||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
Loading…
Reference in a new issue