admin.rb 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # frozen_string_literal: true
  2. namespace :admin do
  3. get '/dashboard', to: 'dashboard#index'
  4. resources :domain_allows, only: [:new, :create, :destroy]
  5. resources :domain_blocks, only: [:new, :create, :destroy, :update, :edit] do
  6. collection do
  7. post :batch
  8. end
  9. end
  10. resources :export_domain_allows, only: [:new] do
  11. collection do
  12. get :export, constraints: { format: :csv }
  13. post :import
  14. end
  15. end
  16. resources :export_domain_blocks, only: [:new] do
  17. collection do
  18. get :export, constraints: { format: :csv }
  19. post :import
  20. end
  21. end
  22. resources :email_domain_blocks, only: [:index, :new, :create] do
  23. collection do
  24. post :batch
  25. end
  26. end
  27. resources :action_logs, only: [:index]
  28. resources :warning_presets, except: [:new, :show]
  29. resources :announcements, except: [:show] do
  30. member do
  31. post :publish
  32. post :unpublish
  33. end
  34. end
  35. get '/settings', to: redirect('/admin/settings/branding')
  36. get '/settings/edit', to: redirect('/admin/settings/branding')
  37. namespace :settings do
  38. resource :branding, only: [:show, :update], controller: 'branding'
  39. resource :registrations, only: [:show, :update], controller: 'registrations'
  40. resource :content_retention, only: [:show, :update], controller: 'content_retention'
  41. resource :about, only: [:show, :update], controller: 'about'
  42. resource :appearance, only: [:show, :update], controller: 'appearance'
  43. resource :discovery, only: [:show, :update], controller: 'discovery'
  44. end
  45. resources :site_uploads, only: [:destroy]
  46. resources :invites, only: [:index, :create, :destroy] do
  47. collection do
  48. post :deactivate_all
  49. end
  50. end
  51. resources :relays, only: [:index, :new, :create, :destroy] do
  52. member do
  53. post :enable
  54. post :disable
  55. end
  56. end
  57. resources :instances, only: [:index, :show, :destroy], constraints: { id: %r{[^/]+} }, format: 'html' do
  58. member do
  59. post :clear_delivery_errors
  60. post :restart_delivery
  61. post :stop_delivery
  62. end
  63. end
  64. resources :rules, only: [:index, :create, :edit, :update, :destroy]
  65. resources :webhooks do
  66. member do
  67. post :enable
  68. post :disable
  69. end
  70. resource :secret, only: [], controller: 'webhooks/secrets' do
  71. post :rotate
  72. end
  73. end
  74. resources :reports, only: [:index, :show] do
  75. resources :actions, only: [:create], controller: 'reports/actions' do
  76. collection do
  77. post :preview
  78. end
  79. end
  80. member do
  81. post :assign_to_self
  82. post :unassign
  83. post :reopen
  84. post :resolve
  85. end
  86. end
  87. resources :report_notes, only: [:create, :destroy]
  88. resources :accounts, only: [:index, :show, :destroy] do
  89. member do
  90. post :enable
  91. post :unsensitive
  92. post :unsilence
  93. post :unsuspend
  94. post :redownload
  95. post :remove_avatar
  96. post :remove_header
  97. post :memorialize
  98. post :approve
  99. post :reject
  100. post :unblock_email
  101. end
  102. collection do
  103. post :batch
  104. end
  105. resource :change_email, only: [:show, :update]
  106. resource :reset, only: [:create]
  107. resource :action, only: [:new, :create], controller: 'account_actions'
  108. resources :statuses, only: [:index, :show] do
  109. collection do
  110. post :batch
  111. end
  112. end
  113. resources :relationships, only: [:index]
  114. resource :confirmation, only: [:create] do
  115. collection do
  116. post :resend
  117. end
  118. end
  119. end
  120. resources :users, only: [] do
  121. resource :two_factor_authentication, only: [:destroy], controller: 'users/two_factor_authentications'
  122. resource :role, only: [:show, :update], controller: 'users/roles'
  123. end
  124. resources :custom_emojis, only: [:index, :new, :create] do
  125. collection do
  126. post :batch
  127. end
  128. end
  129. resources :ip_blocks, only: [:index, :new, :create] do
  130. collection do
  131. post :batch
  132. end
  133. end
  134. resources :roles, except: [:show]
  135. resources :account_moderation_notes, only: [:create, :destroy]
  136. resource :follow_recommendations, only: [:show, :update]
  137. resources :tags, only: [:show, :update]
  138. namespace :trends do
  139. resources :links, only: [:index] do
  140. collection do
  141. post :batch
  142. end
  143. end
  144. resources :tags, only: [:index] do
  145. collection do
  146. post :batch
  147. end
  148. end
  149. resources :statuses, only: [:index] do
  150. collection do
  151. post :batch
  152. end
  153. end
  154. namespace :links do
  155. resources :preview_card_providers, only: [:index], path: :publishers do
  156. collection do
  157. post :batch
  158. end
  159. end
  160. end
  161. end
  162. namespace :disputes do
  163. resources :appeals, only: [:index] do
  164. member do
  165. post :approve
  166. post :reject
  167. end
  168. end
  169. end
  170. resources :software_updates, only: [:index]
  171. end