diff --git a/app/controllers/admin/pubsubhubbub_controller.rb b/app/controllers/admin/pubsubhubbub_controller.rb deleted file mode 100644 index 2677a59e46bb8d40ce70acdf9fb48692f989ce34..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..624a475a3d2f4e1e29e9da1820f8c953385811e7 --- /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 066d9e5c68118c46bacf5b1a8f24c8a44261720f..0000000000000000000000000000000000000000 --- 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 similarity index 100% rename from app/views/admin/pubsubhubbub/_subscription.html.haml rename to 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 0000000000000000000000000000000000000000..21b3238a6baac02b03bf27cb0c0300f1ecd09ff7 --- /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 diff --git a/config/locales/ca.yml b/config/locales/ca.yml index e3b3a91f93a30d5c1fedc471d0835430e420832f..1917441d70b5f59609f285e6ab854838b9ada62f 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -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 diff --git a/config/locales/de.yml b/config/locales/de.yml index a7d86e28498b2b9dd6389d19dcdd09aa19542168..0a11e04225edb88453863e00c2077a7948f47856 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index c27dfb0e507d2384ab2b7ca686252d42a45f396e..2ff2f7eec6fdcb386e8625c82d3812b8fb47bbbb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 458d03db544c00fc5be7f9eb40db0c973b80e588..de59e4f3fe1f29dcbb298ea7ed5aba51457f7867 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -130,7 +130,7 @@ fa: account_count: Øساب‌های شناخته‌شده domain_name: دامین title: سرورهای شناخته‌شده - pubsubhubbub: + subscriptions: callback_url: نشانی Callback confirmed: تأییدشده expires_in: مهلت انقضا diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4d9af2bc33dfad1b1ff79a73c4c8dd75e5805b1c..8cd8fdd080e1863649aceb7efaee6035d67ad24e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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 diff --git a/config/locales/he.yml b/config/locales/he.yml index 88b082b30e21fe3f4652543028958a57344adf0f..f38981f68377251f3e8aa866734385ce345564b9 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -134,7 +134,7 @@ he: account_count: ×—×©×‘×•× ×•×ª ×ž×•×›×¨×™× domain_name: ×©× ×ž×ª×—× title: ×©×¨×ª×™× ×ž×•×›×¨×™× - pubsubhubbub: + subscriptions: callback_url: קישורית Callback confirmed: מ×ושר expires_in: פג תוקף ב- diff --git a/config/locales/id.yml b/config/locales/id.yml index f174cdacba3a0a257b0ea5cd2f1d9168951763e2..48fe466e557c8bf9450107397441f70332190990 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -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 diff --git a/config/locales/io.yml b/config/locales/io.yml index 240de6422be5b6436ec83e22d265819d947de3f2..42351502b9315820cc4d6cb654f0a5af30858d1b 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -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 diff --git a/config/locales/ja.yml b/config/locales/ja.yml index cc5430c473666dfc3db1ff63f9ca40dd9871620b..e8bf9e61a50657923663497c94d76d358cd124ba 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -134,7 +134,7 @@ ja: account_count: 既知ã®ã‚¢ã‚«ã‚¦ãƒ³ãƒˆæ•° domain_name: ドメインå title: 既知ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ - pubsubhubbub: + subscriptions: callback_url: コールãƒãƒƒã‚¯URL confirmed: 確èªæ¸ˆã¿ expires_in: æœŸé™ diff --git a/config/locales/no.yml b/config/locales/no.yml index 0ed9aea5e33e047656d98df11611916366f54996..295293b09bfc4e6a1e9beaf922cdb254fc2e8414 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -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 diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 7f6e3daf0f9a0e918d085ed339a969f10700d539..2a2680a907fc0dfe4f79778c388b10120f4eccd4 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -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 diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 247e6c4ff6aef400d571161a4fae9f47bf9fa26a..e3b4c64e93eb9dc742364389c9b4ab1b39e49e8a 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -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 diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 5eab5d6938eb975cbb50a37d936b87252d390ed5..1ec10f8d0b940c2683fddecd9d4a316d9a24c1bd 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -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 diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 43659c91e55809a99541afd6ced2f5b356c39a26..f628e59f2bec1a95ec1298831cdfd71ceff4331b 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -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 diff --git a/config/locales/ru.yml b/config/locales/ru.yml index d26b235ed2708685ceb2c4b80eb0f033f2791c08..f7a022f1148620aab8cf2d77b317447f44234c19 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -113,7 +113,7 @@ ru: undo: Отменить title: Доменные блокировки undo: Отемнить - pubsubhubbub: + subscriptions: callback_url: Callback URL confirmed: Подтверждено expires_in: ИÑтекает через diff --git a/config/locales/th.yml b/config/locales/th.yml index dd330cc2b637ed7eb543017a5b8aae3e646a2e8b..ab98adf737786f3e9038ffc69c48bc0c6657d098 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -131,7 +131,7 @@ th: account_count: Known accounts domain_name: ชื่à¸à¹‚ดเมน title: Known Instances - pubsubhubbub: + subscriptions: callback_url: Callback URL confirmed: ยืนยัน expires_in: หมดà¸à¸²à¸¢à¸¸à¸ ายใน diff --git a/config/locales/tr.yml b/config/locales/tr.yml index b225883c75127b297d86a310376adcff36c49a9c..ea525e0c05181ec0281af48d9767dff22be18760 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -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 diff --git a/config/locales/uk.yml b/config/locales/uk.yml index a06609ff05133a5cc91e3d18f00a7077071b5bc6..227356f86f120b4437bdcf99e34233f3ae0efdbb 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -113,7 +113,7 @@ uk: undo: Відмінити title: Доменні Ð±Ð»Ð¾ÐºÑƒÐ²Ð°Ð½Ð½Ñ undo: Відмінити - pubsubhubbub: + subscriptions: callback_url: Callback URL confirmed: Підтверджено expires_in: Спливає через diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index edfc381db0a19f980ff0e9bec00bb5c9749747a9..2dc6f813f1d90cdc48751f2e44eb10d804342ebc 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -134,7 +134,7 @@ zh-CN: account_count: 已知å¸å· domain_name: 域å title: 已知实例 - pubsubhubbub: + subscriptions: callback_url: 回调 URL confirmed: 确定 expires_in: æœŸé™ diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index e6223917ea183ee5a7c7d8b30b8e944cc05bf0f1..b886af8de6a1767e1b58afdfb583554b3f409596 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -130,7 +130,7 @@ zh-HK: account_count: 已知帳號 domain_name: 域å title: 已知æœå‹™ç«™ - pubsubhubbub: + subscriptions: callback_url: 回傳 URL confirmed: 確定 expires_in: æœŸé™ diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 82b07be34fbaa0889eb2472b3066d6231df4e522..cb96f654392a3819ede30abf7442153eb7b4f66d 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -92,7 +92,7 @@ zh-TW: title: æ–°å°éŽ–網域 severity: åš´é‡åº¦ title: 網域å°éŽ– - pubsubhubbub: + subscriptions: callback_url: Callback URL confirmed: å·²ç¢ºèª expires_in: æœŸé™ diff --git a/config/navigation.rb b/config/navigation.rb index 38dee91b244276b84d1a7fd9466494119b0f8027..85ed62118a1d95db6d288277e9c4c626c4e95c54 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -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' } diff --git a/config/routes.rb b/config/routes.rb index 7db3c74b13ec0f0437f2e4952dacdd75ed9e7b53..b1590f9291df9b6872d2a81af41a6b964e2e0e6b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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] diff --git a/spec/controllers/admin/pubsubhubbub_controller_spec.rb b/spec/controllers/admin/subscriptions_controller_spec.rb similarity index 91% rename from spec/controllers/admin/pubsubhubbub_controller_spec.rb rename to spec/controllers/admin/subscriptions_controller_spec.rb index c8e8e7a8424320a4f10bbc045f680e5c43cbf94c..eb6f12b16e1a5a4a354a7cf61f0b3a3f0ae57d61 100644 --- a/spec/controllers/admin/pubsubhubbub_controller_spec.rb +++ b/spec/controllers/admin/subscriptions_controller_spec.rb @@ -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