Browse Source

Move admin/pubsubhubbub controller to admin/subscriptions (#3442)

closed-social-v3
Matt Jankowski 7 years ago
committed by Eugen Rochko
parent
commit
de4681b2be
29 changed files with 58 additions and 48 deletions
  1. +0
    -9
      app/controllers/admin/pubsubhubbub_controller.rb
  2. +19
    -0
      app/controllers/admin/subscriptions_controller.rb
  3. +0
    -15
      app/views/admin/pubsubhubbub/index.html.haml
  4. +0
    -0
      app/views/admin/subscriptions/_subscription.html.haml
  5. +15
    -0
      app/views/admin/subscriptions/index.html.haml
  6. +1
    -1
      config/locales/ca.yml
  7. +1
    -1
      config/locales/de.yml
  8. +1
    -1
      config/locales/en.yml
  9. +1
    -1
      config/locales/fa.yml
  10. +1
    -1
      config/locales/fr.yml
  11. +1
    -1
      config/locales/he.yml
  12. +1
    -1
      config/locales/id.yml
  13. +1
    -1
      config/locales/io.yml
  14. +1
    -1
      config/locales/ja.yml
  15. +1
    -1
      config/locales/no.yml
  16. +1
    -1
      config/locales/oc.yml
  17. +1
    -1
      config/locales/pl.yml
  18. +1
    -1
      config/locales/pt-BR.yml
  19. +1
    -1
      config/locales/pt.yml
  20. +1
    -1
      config/locales/ru.yml
  21. +1
    -1
      config/locales/th.yml
  22. +1
    -1
      config/locales/tr.yml
  23. +1
    -1
      config/locales/uk.yml
  24. +1
    -1
      config/locales/zh-CN.yml
  25. +1
    -1
      config/locales/zh-HK.yml
  26. +1
    -1
      config/locales/zh-TW.yml
  27. +1
    -1
      config/navigation.rb
  28. +1
    -1
      config/routes.rb
  29. +1
    -1
      spec/controllers/admin/subscriptions_controller_spec.rb

+ 0
- 9
app/controllers/admin/pubsubhubbub_controller.rb View File

@ -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
- 0
app/controllers/admin/subscriptions_controller.rb View 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

+ 0
- 15
app/views/admin/pubsubhubbub/index.html.haml View File

@ -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

app/views/admin/pubsubhubbub/_subscription.html.haml → app/views/admin/subscriptions/_subscription.html.haml View File


+ 15
- 0
app/views/admin/subscriptions/index.html.haml View 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

+ 1
- 1
config/locales/ca.yml View File

@ -134,7 +134,7 @@ ca:
account_count: Comptes coneguts
domain_name: Domini
title: Instàncies conegudes
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Confirmat
expires_in: Expira en

+ 1
- 1
config/locales/de.yml View File

@ -119,7 +119,7 @@ de:
account_count: Bekannte Konten
domain_name: Domain
title: Bekannte Instanzen
pubsubhubbub:
subscriptions:
callback_url: Callback-URL
confirmed: Bestätigt
expires_in: Verfällt in

+ 1
- 1
config/locales/en.yml View File

@ -134,7 +134,7 @@ en:
account_count: Known accounts
domain_name: Domain
title: Known Instances
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Confirmed
expires_in: Expires in

+ 1
- 1
config/locales/fa.yml View File

@ -130,7 +130,7 @@ fa:
account_count: حساب‌های شناخته‌شده
domain_name: دامین
title: سرورهای شناخته‌شده
pubsubhubbub:
subscriptions:
callback_url: نشانی Callback
confirmed: تأییدشده
expires_in: مهلت انقضا

+ 1
- 1
config/locales/fr.yml View File

@ -110,7 +110,7 @@ fr:
undo: Annuler
title: Blocage de domaines
undo: Annuler
pubsubhubbub:
subscriptions:
callback_url: URL de rappel
confirmed: Confirmé
expires_in: Expire dans

+ 1
- 1
config/locales/he.yml View File

@ -134,7 +134,7 @@ he:
account_count: חשבונות מוכרים
domain_name: שם מתחם
title: שרתים מוכרים
pubsubhubbub:
subscriptions:
callback_url: קישורית Callback
confirmed: מאושר
expires_in: פג תוקף ב-

+ 1
- 1
config/locales/id.yml View File

@ -129,7 +129,7 @@ id:
account_count: Akun yang diketahui
domain_name: Domain
title: Server yang diketahui
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Dikonfirmasi
expires_in: Kadaluarsa dalam

+ 1
- 1
config/locales/io.yml View File

@ -118,7 +118,7 @@ io:
account_count: Known accounts
domain_name: Domain
title: Known Instances
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Confirmed
expires_in: Expires in

+ 1
- 1
config/locales/ja.yml View File

@ -134,7 +134,7 @@ ja:
account_count: 既知のアカウント数
domain_name: ドメイン名
title: 既知のインスタンス
pubsubhubbub:
subscriptions:
callback_url: コールバックURL
confirmed: 確認済み
expires_in: 期限

+ 1
- 1
config/locales/no.yml View File

@ -131,7 +131,7 @@
account_count: Kjente kontoer
domain_name: Domene
title: Kjente instanser
pubsubhubbub:
subscriptions:
callback_url: Callback-URL
confirmed: Bekreftet
expires_in: Utløper om

+ 1
- 1
config/locales/oc.yml View File

@ -134,7 +134,7 @@ oc:
account_count: Comptes coneguts
domain_name: Domeni
title: Instàncias conegudas
pubsubhubbub:
subscriptions:
callback_url: URL de rapèl
confirmed: Confirmat
expires_in: S’acaba dins

+ 1
- 1
config/locales/pl.yml View File

@ -134,7 +134,7 @@ pl:
account_count: Znane konta
domain_name: Domena
title: Znane instancje
pubsubhubbub:
subscriptions:
callback_url: URL zwrotny
confirmed: Potwierdzono
expires_in: Wygasa

+ 1
- 1
config/locales/pt-BR.yml View File

@ -130,7 +130,7 @@ pt-BR:
account_count: Contas conhecidas
domain_name: Domínio
title: Instâncias conhecidas
pubsubhubbub:
subscriptions:
callback_url: URL de Callback
confirmed: Confirmado
expires_in: Expira em

+ 1
- 1
config/locales/pt.yml View File

@ -126,7 +126,7 @@ pt:
account_count: Contas conhecidas
domain_name: Domínio
title: Instâncias conhecidas
pubsubhubbub:
subscriptions:
callback_url: URL de Callback
confirmed: Confirmado
expires_in: Expira em

+ 1
- 1
config/locales/ru.yml View File

@ -113,7 +113,7 @@ ru:
undo: Отменить
title: Доменные блокировки
undo: Отемнить
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Подтверждено
expires_in: Истекает через

+ 1
- 1
config/locales/th.yml View File

@ -131,7 +131,7 @@ th:
account_count: Known accounts
domain_name: ชื่อโดเมน
title: Known Instances
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: ยืนยัน
expires_in: หมดอายุภายใน

+ 1
- 1
config/locales/tr.yml View File

@ -130,7 +130,7 @@ tr:
account_count: Bilinen hesaplar
domain_name: Domain
title: Bilinen Sunucular
pubsubhubbub:
subscriptions:
callback_url: Callback linki
confirmed: Onaylandı
expires_in: Bitiş Tarihi

+ 1
- 1
config/locales/uk.yml View File

@ -113,7 +113,7 @@ uk:
undo: Відмінити
title: Доменні блокування
undo: Відмінити
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: Підтверджено
expires_in: Спливає через

+ 1
- 1
config/locales/zh-CN.yml View File

@ -134,7 +134,7 @@ zh-CN:
account_count: 已知帐号
domain_name: 域名
title: 已知实例
pubsubhubbub:
subscriptions:
callback_url: 回调 URL
confirmed: 确定
expires_in: 期限

+ 1
- 1
config/locales/zh-HK.yml View File

@ -130,7 +130,7 @@ zh-HK:
account_count: 已知帳號
domain_name: 域名
title: 已知服務站
pubsubhubbub:
subscriptions:
callback_url: 回傳 URL
confirmed: 確定
expires_in: 期限

+ 1
- 1
config/locales/zh-TW.yml View File

@ -92,7 +92,7 @@ zh-TW:
title: 新封鎖網域
severity: 嚴重度
title: 網域封鎖
pubsubhubbub:
subscriptions:
callback_url: Callback URL
confirmed: 已確認
expires_in: 期限

+ 1
- 1
config/navigation.rb View File

@ -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 :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 :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 :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' }

+ 1
- 1
config/routes.rb View File

@ -74,7 +74,7 @@ Rails.application.routes.draw do
resource :authorize_follow, only: [:show, :create]
namespace :admin do
resources :pubsubhubbub, only: [:index]
resources :subscriptions, only: [:index]
resources :domain_blocks, only: [:index, :new, :create, :show, :destroy]
resource :settings, only: [:edit, :update]
resources :instances, only: [:index]

spec/controllers/admin/pubsubhubbub_controller_spec.rb → spec/controllers/admin/subscriptions_controller_spec.rb View File

@ -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…
Cancel
Save