2013-12-23 17:50:36 -06:00
|
|
|
require "sidekiq/web"
|
2018-07-31 16:12:55 -05:00
|
|
|
require "mini_scheduler/web"
|
2013-12-23 17:50:36 -06:00
|
|
|
require_dependency "admin_constraint"
|
|
|
|
require_dependency "staff_constraint"
|
|
|
|
require_dependency "homepage_constraint"
|
2014-08-29 10:28:16 -05:00
|
|
|
require_dependency "permalink_constraint"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2017-12-21 16:17:25 -06:00
|
|
|
# The following constants have been replaced with `RouteFormat` and are deprecated.
|
|
|
|
USERNAME_ROUTE_FORMAT = /[\w.\-]+?/ unless defined? USERNAME_ROUTE_FORMAT
|
|
|
|
BACKUP_ROUTE_FORMAT = /.+\.(sql\.gz|tar\.gz|tgz)/i unless defined? BACKUP_ROUTE_FORMAT
|
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
Discourse::Application.routes.draw do
|
2018-04-10 15:24:29 -05:00
|
|
|
relative_url_root = (defined?(Rails.configuration.relative_url_root) && Rails.configuration.relative_url_root) ? Rails.configuration.relative_url_root + '/' : '/'
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2013-07-01 13:00:06 -05:00
|
|
|
match "/404", to: "exceptions#not_found", via: [:get, :post]
|
2014-04-29 14:17:40 -05:00
|
|
|
get "/404-body" => "exceptions#not_found_body"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2016-06-06 12:47:45 -05:00
|
|
|
post "webhooks/mailgun" => "webhooks#mailgun"
|
2016-06-01 14:48:06 -05:00
|
|
|
post "webhooks/sendgrid" => "webhooks#sendgrid"
|
2016-06-06 12:47:45 -05:00
|
|
|
post "webhooks/mailjet" => "webhooks#mailjet"
|
2016-06-13 05:31:01 -05:00
|
|
|
post "webhooks/mandrill" => "webhooks#mandrill"
|
2016-09-27 00:13:34 -05:00
|
|
|
post "webhooks/sparkpost" => "webhooks#sparkpost"
|
2016-05-30 10:11:17 -05:00
|
|
|
|
2014-08-18 01:42:48 -05:00
|
|
|
if Rails.env.development?
|
2014-05-24 07:50:39 -05:00
|
|
|
mount Sidekiq::Web => "/sidekiq"
|
|
|
|
mount Logster::Web => "/logs"
|
|
|
|
else
|
2017-02-25 11:03:19 -06:00
|
|
|
# only allow sidekiq in master site
|
2016-03-16 08:26:07 -05:00
|
|
|
mount Sidekiq::Web => "/sidekiq", constraints: AdminConstraint.new(require_master: true)
|
2014-05-24 07:50:39 -05:00
|
|
|
mount Logster::Web => "/logs", constraints: AdminConstraint.new
|
2014-05-06 17:23:52 -05:00
|
|
|
end
|
|
|
|
|
2015-08-27 16:28:33 -05:00
|
|
|
resources :about do
|
|
|
|
collection do
|
|
|
|
get "live_post_counts"
|
|
|
|
end
|
|
|
|
end
|
2014-08-11 15:59:00 -05:00
|
|
|
|
2016-10-18 10:44:25 -05:00
|
|
|
get "finish-installation" => "finish_installation#index"
|
|
|
|
get "finish-installation/register" => "finish_installation#register"
|
|
|
|
post "finish-installation/register" => "finish_installation#register"
|
|
|
|
get "finish-installation/confirm-email" => "finish_installation#confirm_email"
|
2016-10-21 10:34:19 -05:00
|
|
|
put "finish-installation/resend-email" => "finish_installation#resend_email"
|
2016-10-18 10:44:25 -05:00
|
|
|
|
2015-03-16 14:14:33 -05:00
|
|
|
resources :directory_items
|
|
|
|
|
2015-03-04 22:49:03 -06:00
|
|
|
get "site" => "site#site"
|
|
|
|
namespace :site do
|
|
|
|
get "settings"
|
|
|
|
get "custom_html"
|
|
|
|
get "banner"
|
|
|
|
get "emoji"
|
|
|
|
end
|
2016-08-12 02:10:08 -05:00
|
|
|
|
|
|
|
get "site/basic-info" => 'site#basic_info'
|
2017-03-10 07:16:00 -06:00
|
|
|
get "site/statistics" => 'site#statistics'
|
2018-07-18 05:57:43 -05:00
|
|
|
get "site/selectable-avatars" => "site#selectable_avatars"
|
2016-08-12 02:10:08 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "srv/status" => "forums#status"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2016-08-25 12:14:56 -05:00
|
|
|
get "wizard" => "wizard#index"
|
|
|
|
get "wizard/qunit" => "wizard#qunit"
|
|
|
|
get 'wizard/steps' => 'steps#index'
|
2016-09-07 17:04:01 -05:00
|
|
|
get 'wizard/steps/:id' => "wizard#index"
|
2016-08-25 12:14:56 -05:00
|
|
|
put 'wizard/steps/:id' => "steps#update"
|
2016-08-24 13:35:07 -05:00
|
|
|
|
2013-05-02 02:22:27 -05:00
|
|
|
namespace :admin, constraints: StaffConstraint.new do
|
2013-12-23 17:50:36 -06:00
|
|
|
get "" => "admin#index"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2015-02-06 16:32:59 -06:00
|
|
|
get 'plugins' => 'plugins#index'
|
|
|
|
|
2013-11-13 13:02:47 -06:00
|
|
|
resources :site_settings, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
get "category/:id" => "site_settings#index"
|
2013-11-13 13:02:47 -06:00
|
|
|
end
|
|
|
|
end
|
2013-05-02 00:15:17 -05:00
|
|
|
|
2018-06-18 05:31:56 -05:00
|
|
|
get "reports" => "reports#index"
|
2018-08-24 08:28:01 -05:00
|
|
|
get "reports/bulk" => "reports#bulk"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "reports/:type" => "reports#show"
|
2013-02-27 21:39:42 -06:00
|
|
|
|
2013-05-08 00:20:38 -05:00
|
|
|
resources :groups, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
2015-10-26 14:56:59 -05:00
|
|
|
get 'bulk'
|
|
|
|
get 'bulk-complete' => 'groups#bulk'
|
|
|
|
put 'bulk' => 'groups#bulk_perform'
|
2013-05-08 00:20:38 -05:00
|
|
|
end
|
2015-01-21 13:52:48 -06:00
|
|
|
member do
|
2015-11-09 07:52:04 -06:00
|
|
|
put "owners" => "groups#add_owners"
|
|
|
|
delete "owners" => "groups#remove_owner"
|
2015-01-21 13:52:48 -06:00
|
|
|
end
|
2013-05-08 00:20:38 -05:00
|
|
|
end
|
|
|
|
|
2015-01-21 13:52:48 -06:00
|
|
|
get "groups/:type" => "groups#show", constraints: AdminConstraint.new
|
|
|
|
get "groups/:type/:id" => "groups#show", constraints: AdminConstraint.new
|
|
|
|
|
2017-12-04 11:14:43 -06:00
|
|
|
get "moderation_history" => "moderation_history#index"
|
|
|
|
|
2017-12-21 14:30:32 -06:00
|
|
|
resources :users, id: RouteFormat.username, except: [:show] do
|
2013-02-05 13:16:51 -06:00
|
|
|
collection do
|
2017-04-26 22:02:59 -05:00
|
|
|
get "list" => "users#index"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "list/:query" => "users#index"
|
2014-07-07 15:18:18 -05:00
|
|
|
get "ip-info" => "users#ip_info"
|
2014-11-20 12:59:20 -06:00
|
|
|
delete "delete-others-with-same-ip" => "users#delete_other_accounts_with_same_ip"
|
2014-11-24 12:34:04 -06:00
|
|
|
get "total-others-with-same-ip" => "users#total_other_accounts_with_same_ip"
|
2013-12-23 17:50:36 -06:00
|
|
|
put "approve-bulk" => "users#approve_bulk"
|
|
|
|
delete "reject-bulk" => "users#reject_bulk"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
2018-05-25 10:45:42 -05:00
|
|
|
delete "penalty_history", constraints: AdminConstraint.new
|
2013-12-23 17:50:36 -06:00
|
|
|
put "suspend"
|
|
|
|
put "delete_all_posts"
|
|
|
|
put "unsuspend"
|
|
|
|
put "revoke_admin", constraints: AdminConstraint.new
|
|
|
|
put "grant_admin", constraints: AdminConstraint.new
|
|
|
|
post "generate_api_key", constraints: AdminConstraint.new
|
|
|
|
delete "revoke_api_key", constraints: AdminConstraint.new
|
|
|
|
put "revoke_moderation", constraints: AdminConstraint.new
|
|
|
|
put "grant_moderation", constraints: AdminConstraint.new
|
|
|
|
put "approve"
|
|
|
|
post "refresh_browsers", constraints: AdminConstraint.new
|
2014-06-05 22:02:52 -05:00
|
|
|
post "log_out", constraints: AdminConstraint.new
|
2013-12-23 17:50:36 -06:00
|
|
|
put "activate"
|
|
|
|
put "deactivate"
|
2017-11-10 11:18:08 -06:00
|
|
|
put "silence"
|
|
|
|
put "unsilence"
|
2013-12-23 17:50:36 -06:00
|
|
|
put "trust_level"
|
2014-09-13 15:55:26 -05:00
|
|
|
put "trust_level_lock"
|
2014-02-10 15:59:36 -06:00
|
|
|
put "primary_group"
|
2014-07-13 13:11:38 -05:00
|
|
|
post "groups" => "users#add_group", constraints: AdminConstraint.new
|
|
|
|
delete "groups/:group_id" => "users#remove_group", constraints: AdminConstraint.new
|
2014-03-19 09:27:21 -05:00
|
|
|
get "badges"
|
2014-09-24 19:19:26 -05:00
|
|
|
get "leader_requirements" => "users#tl3_requirements"
|
|
|
|
get "tl3_requirements"
|
2015-03-06 15:44:54 -06:00
|
|
|
put "anonymize"
|
2016-05-06 12:34:33 -05:00
|
|
|
post "reset_bounce_score"
|
2017-12-21 19:18:12 -06:00
|
|
|
put "disable_second_factor"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
2017-07-27 20:20:09 -05:00
|
|
|
get "users/:id.json" => 'users#show', defaults: { format: 'json' }
|
2017-12-21 14:30:32 -06:00
|
|
|
get 'users/:id/:username' => 'users#show', constraints: { username: RouteFormat.username }
|
2016-03-28 15:58:45 -05:00
|
|
|
get 'users/:id/:username/badges' => 'users#show'
|
2017-03-16 10:05:28 -05:00
|
|
|
get 'users/:id/:username/tl3_requirements' => 'users#show'
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2014-10-27 19:25:02 -05:00
|
|
|
post "users/sync_sso" => "users#sync_sso", constraints: AdminConstraint.new
|
2014-11-23 22:42:39 -06:00
|
|
|
post "users/invite_admin" => "users#invite_admin", constraints: AdminConstraint.new
|
2014-10-27 19:25:02 -05:00
|
|
|
|
2013-05-02 00:15:17 -05:00
|
|
|
resources :impersonate, constraints: AdminConstraint.new
|
2013-06-03 15:12:24 -05:00
|
|
|
|
2015-09-29 11:37:46 -05:00
|
|
|
resources :email, constraints: AdminConstraint.new do
|
2013-02-05 13:16:51 -06:00
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
post "test"
|
2014-02-14 17:50:08 -06:00
|
|
|
get "sent"
|
2014-02-14 12:06:21 -06:00
|
|
|
get "skipped"
|
2016-05-02 16:15:32 -05:00
|
|
|
get "bounced"
|
2016-01-18 17:57:55 -06:00
|
|
|
get "received"
|
|
|
|
get "rejected"
|
2016-02-01 14:41:49 -06:00
|
|
|
get "/incoming/:id/raw" => "email#raw_email"
|
2016-02-10 15:00:27 -06:00
|
|
|
get "/incoming/:id" => "email#incoming"
|
2017-02-22 11:51:33 -06:00
|
|
|
get "/incoming_from_bounced/:id" => "email#incoming_from_bounced"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "preview-digest" => "email#preview_digest"
|
2016-11-23 16:46:57 -06:00
|
|
|
get "send-digest" => "email#send_digest"
|
2017-04-05 01:32:50 -05:00
|
|
|
get "smtp_should_reject"
|
2015-10-18 16:33:24 -05:00
|
|
|
post "handle_mail"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
2013-06-03 15:12:24 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
scope "/logs" do
|
2013-10-21 13:49:51 -05:00
|
|
|
resources :staff_action_logs, only: [:index]
|
2017-04-12 09:52:52 -05:00
|
|
|
get 'staff_action_logs/:id/diff' => 'staff_action_logs#diff'
|
2014-06-02 01:52:43 -05:00
|
|
|
resources :screened_emails, only: [:index, :destroy]
|
2014-11-24 10:25:48 -06:00
|
|
|
resources :screened_ip_addresses, only: [:index, :create, :update, :destroy] do
|
|
|
|
collection do
|
|
|
|
post "roll_up"
|
|
|
|
end
|
|
|
|
end
|
2013-10-21 13:49:51 -05:00
|
|
|
resources :screened_urls, only: [:index]
|
2017-07-31 16:06:26 -05:00
|
|
|
resources :watched_words, only: [:index, :create, :update, :destroy] do
|
|
|
|
collection do
|
|
|
|
get "action/:id" => "watched_words#index"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
post "watched_words/upload" => "watched_words#upload"
|
2017-11-14 18:13:50 -06:00
|
|
|
resources :search_logs, only: [:index]
|
2017-12-19 20:41:31 -06:00
|
|
|
get 'search_logs/term/:term' => 'search_logs#term'
|
2013-08-01 20:30:13 -05:00
|
|
|
end
|
|
|
|
|
2014-07-13 22:21:29 -05:00
|
|
|
get "/logs" => "staff_action_logs#index"
|
|
|
|
|
2014-04-16 08:49:06 -05:00
|
|
|
get "customize" => "color_schemes#index", constraints: AdminConstraint.new
|
2017-04-12 09:52:52 -05:00
|
|
|
get "customize/themes" => "themes#index", constraints: AdminConstraint.new
|
2014-04-16 08:49:06 -05:00
|
|
|
get "customize/colors" => "color_schemes#index", constraints: AdminConstraint.new
|
2017-04-12 09:52:52 -05:00
|
|
|
get "customize/colors/:id" => "color_schemes#index", constraints: AdminConstraint.new
|
2015-07-15 07:54:28 -05:00
|
|
|
get "customize/permalinks" => "permalinks#index", constraints: AdminConstraint.new
|
2015-08-18 16:15:46 -05:00
|
|
|
get "customize/embedding" => "embedding#show", constraints: AdminConstraint.new
|
|
|
|
put "customize/embedding" => "embedding#update", constraints: AdminConstraint.new
|
2016-08-25 15:33:29 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "flags" => "flags#index"
|
2017-09-12 12:04:53 -05:00
|
|
|
get "flags/:filter" => "flags#index", as: 'flags_filtered'
|
2017-09-06 09:21:07 -05:00
|
|
|
get "flags/topics/:topic_id" => "flags#index"
|
2013-12-23 17:50:36 -06:00
|
|
|
post "flags/agree/:id" => "flags#agree"
|
|
|
|
post "flags/disagree/:id" => "flags#disagree"
|
|
|
|
post "flags/defer/:id" => "flags#defer"
|
2017-04-12 09:52:52 -05:00
|
|
|
|
2017-10-05 13:12:07 -05:00
|
|
|
resources :flagged_topics, constraints: StaffConstraint.new
|
2017-04-12 09:52:52 -05:00
|
|
|
resources :themes, constraints: AdminConstraint.new
|
2017-09-06 09:21:07 -05:00
|
|
|
|
2017-04-12 09:52:52 -05:00
|
|
|
post "themes/import" => "themes#import"
|
2017-05-09 16:20:28 -05:00
|
|
|
post "themes/upload_asset" => "themes#upload_asset"
|
2018-03-08 23:14:21 -06:00
|
|
|
post "themes/generate_key_pair" => "themes#generate_key_pair"
|
2017-04-14 12:35:12 -05:00
|
|
|
get "themes/:id/preview" => "themes#preview"
|
2017-01-06 13:42:36 -06:00
|
|
|
|
|
|
|
scope "/customize", constraints: AdminConstraint.new do
|
2014-09-25 10:32:08 -05:00
|
|
|
resources :user_fields, constraints: AdminConstraint.new
|
2014-12-22 18:12:26 -06:00
|
|
|
resources :emojis, constraints: AdminConstraint.new
|
2015-11-12 15:08:19 -06:00
|
|
|
|
2017-04-12 09:52:52 -05:00
|
|
|
get 'themes/:id/:target/:field_name/edit' => 'themes#index'
|
|
|
|
get 'themes/:id' => 'themes#index'
|
|
|
|
|
2015-11-12 15:08:19 -06:00
|
|
|
# They have periods in their URLs often:
|
2018-06-10 23:59:21 -05:00
|
|
|
get 'site_texts' => 'site_texts#index'
|
|
|
|
get 'site_texts/:id.json' => 'site_texts#show', constraints: { id: /[\w.\-\+]+/i }
|
|
|
|
get 'site_texts/:id' => 'site_texts#show', constraints: { id: /[\w.\-\+]+/i }
|
|
|
|
put 'site_texts/:id.json' => 'site_texts#update', constraints: { id: /[\w.\-\+]+/i }
|
|
|
|
put 'site_texts/:id' => 'site_texts#update', constraints: { id: /[\w.\-\+]+/i }
|
|
|
|
delete 'site_texts/:id.json' => 'site_texts#revert', constraints: { id: /[\w.\-\+]+/i }
|
|
|
|
delete 'site_texts/:id' => 'site_texts#revert', constraints: { id: /[\w.\-\+]+/i }
|
2016-04-06 14:57:54 -05:00
|
|
|
|
|
|
|
get 'email_templates' => 'email_templates#index'
|
|
|
|
get 'email_templates/(:id)' => 'email_templates#show', constraints: { id: /[0-9a-z_.]+/ }
|
|
|
|
put 'email_templates/(:id)' => 'email_templates#update', constraints: { id: /[0-9a-z_.]+/ }
|
|
|
|
delete 'email_templates/(:id)' => 'email_templates#revert', constraints: { id: /[0-9a-z_.]+/ }
|
2014-09-23 16:12:01 -05:00
|
|
|
end
|
|
|
|
|
2015-08-18 16:15:46 -05:00
|
|
|
resources :embeddable_hosts, constraints: AdminConstraint.new
|
2014-04-16 08:49:06 -05:00
|
|
|
resources :color_schemes, constraints: AdminConstraint.new
|
2014-02-12 22:33:40 -06:00
|
|
|
|
2015-07-15 07:54:28 -05:00
|
|
|
resources :permalinks, constraints: AdminConstraint.new
|
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "version_check" => "versions#show"
|
2014-02-12 22:33:40 -06:00
|
|
|
|
2018-07-26 13:59:28 -05:00
|
|
|
get "dashboard" => "dashboard_next#index"
|
2018-07-19 13:33:11 -05:00
|
|
|
get "dashboard/general" => "dashboard_next#general"
|
2018-07-26 13:59:28 -05:00
|
|
|
get "dashboard/moderation" => "dashboard_next#moderation"
|
|
|
|
|
|
|
|
get "dashboard-old" => "dashboard#index"
|
2018-04-16 03:42:06 -05:00
|
|
|
|
2013-03-29 14:48:26 -05:00
|
|
|
resources :dashboard, only: [:index] do
|
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
get "problems"
|
2013-03-29 14:48:26 -05:00
|
|
|
end
|
|
|
|
end
|
2014-02-12 22:33:40 -06:00
|
|
|
|
2013-05-02 00:15:17 -05:00
|
|
|
resources :api, only: [:index], constraints: AdminConstraint.new do
|
2013-03-25 20:04:28 -05:00
|
|
|
collection do
|
2016-09-19 03:43:06 -05:00
|
|
|
get "keys" => "api#index"
|
2013-12-23 17:50:36 -06:00
|
|
|
post "key" => "api#create_master_key"
|
|
|
|
put "key" => "api#regenerate_key"
|
|
|
|
delete "key" => "api#revoke_key"
|
2016-09-19 03:43:06 -05:00
|
|
|
|
|
|
|
resources :web_hooks
|
|
|
|
get 'web_hook_events/:id' => 'web_hooks#list_events', as: :web_hook_events
|
|
|
|
get 'web_hooks/:id/events' => 'web_hooks#list_events'
|
|
|
|
get 'web_hooks/:id/events/bulk' => 'web_hooks#bulk_events'
|
|
|
|
post 'web_hooks/:web_hook_id/events/:event_id/redeliver' => 'web_hooks#redeliver_event'
|
|
|
|
post 'web_hooks/:id/ping' => 'web_hooks#ping'
|
2013-03-25 20:04:28 -05:00
|
|
|
end
|
|
|
|
end
|
2014-02-12 22:33:40 -06:00
|
|
|
|
|
|
|
resources :backups, only: [:index, :create], constraints: AdminConstraint.new do
|
|
|
|
member do
|
2017-12-21 14:30:32 -06:00
|
|
|
get "" => "backups#show", constraints: { id: RouteFormat.backup }
|
|
|
|
put "" => "backups#email", constraints: { id: RouteFormat.backup }
|
|
|
|
delete "" => "backups#destroy", constraints: { id: RouteFormat.backup }
|
|
|
|
post "restore" => "backups#restore", constraints: { id: RouteFormat.backup }
|
2014-02-12 22:33:40 -06:00
|
|
|
end
|
|
|
|
collection do
|
|
|
|
get "logs" => "backups#logs"
|
|
|
|
get "status" => "backups#status"
|
2017-03-22 21:29:35 -05:00
|
|
|
delete "cancel" => "backups#cancel"
|
|
|
|
post "rollback" => "backups#rollback"
|
2014-02-12 22:33:40 -06:00
|
|
|
put "readonly" => "backups#readonly"
|
2014-05-27 15:14:37 -05:00
|
|
|
get "upload" => "backups#check_backup_chunk"
|
|
|
|
post "upload" => "backups#upload_backup_chunk"
|
2018-09-10 09:48:34 -05:00
|
|
|
get "upload_url" => "backups#create_upload_url"
|
2014-02-12 22:33:40 -06:00
|
|
|
end
|
|
|
|
end
|
2014-02-14 17:50:08 -06:00
|
|
|
|
2014-03-05 06:52:20 -06:00
|
|
|
resources :badges, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
|
|
|
get "types" => "badges#badge_types"
|
2014-07-27 03:22:01 -05:00
|
|
|
post "badge_groupings" => "badges#save_badge_groupings"
|
2014-07-24 03:28:09 -05:00
|
|
|
post "preview" => "badges#preview"
|
2014-03-05 06:52:20 -06:00
|
|
|
end
|
|
|
|
end
|
2013-11-11 23:42:35 -06:00
|
|
|
end # admin namespace
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "email_preferences" => "email#preferences_redirect", :as => "email_preferences_redirect"
|
2016-06-16 20:27:52 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "email/unsubscribe/:key" => "email#unsubscribe", as: "email_unsubscribe"
|
2016-06-16 20:27:52 -05:00
|
|
|
get "email/unsubscribed" => "email#unsubscribed", as: "email_unsubscribed"
|
|
|
|
post "email/unsubscribe/:key" => "email#perform_unsubscribe", as: "email_perform_unsubscribe"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2016-08-25 15:33:29 -05:00
|
|
|
get "extra-locales/:bundle" => "extra_locales#show"
|
|
|
|
|
2017-12-21 14:30:32 -06:00
|
|
|
resources :session, id: RouteFormat.username, only: [:create, :destroy, :become] do
|
2018-03-27 22:31:43 -05:00
|
|
|
if !Rails.env.production?
|
2018-03-27 22:22:43 -05:00
|
|
|
get 'become'
|
|
|
|
end
|
|
|
|
|
2013-02-14 13:11:13 -06:00
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
post "forgot_password"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
2013-02-14 13:11:13 -06:00
|
|
|
end
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2014-02-24 21:30:49 -06:00
|
|
|
get "session/sso" => "session#sso"
|
|
|
|
get "session/sso_login" => "session#sso_login"
|
2014-11-26 00:25:54 -06:00
|
|
|
get "session/sso_provider" => "session#sso_provider"
|
2014-02-05 12:46:24 -06:00
|
|
|
get "session/current" => "session#current"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "session/csrf" => "session#csrf"
|
2017-04-20 10:17:24 -05:00
|
|
|
get "session/email-login/:token" => "session#email_login"
|
2017-12-21 19:18:12 -06:00
|
|
|
post "session/email-login/:token" => "session#email_login"
|
2016-06-06 12:52:24 -05:00
|
|
|
get "composer_messages" => "composer_messages#index"
|
2017-12-05 11:23:39 -06:00
|
|
|
post "composer/parse_html" => "composer#parse_html"
|
2013-07-29 00:13:13 -05:00
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
resources :static
|
2016-03-24 12:21:57 -05:00
|
|
|
post "login" => "static#enter", constraints: { format: /(json|html)/ }
|
|
|
|
get "login" => "static#show", id: "login", constraints: { format: /(json|html)/ }
|
|
|
|
get "password-reset" => "static#show", id: "password_reset", constraints: { format: /(json|html)/ }
|
|
|
|
get "faq" => "static#show", id: "faq", constraints: { format: /(json|html)/ }
|
|
|
|
get "guidelines" => "static#show", id: "guidelines", as: 'guidelines', constraints: { format: /(json|html)/ }
|
2018-07-26 14:37:56 -05:00
|
|
|
get "rules" => "static#show", id: "rules", as: 'rules', constraints: { format: /(json|html)/ }
|
2016-03-24 12:21:57 -05:00
|
|
|
get "tos" => "static#show", id: "tos", as: 'tos', constraints: { format: /(json|html)/ }
|
|
|
|
get "privacy" => "static#show", id: "privacy", as: 'privacy', constraints: { format: /(json|html)/ }
|
|
|
|
get "signup" => "static#show", id: "signup", constraints: { format: /(json|html)/ }
|
|
|
|
get "login-preferences" => "static#show", id: "login", constraints: { format: /(json|html)/ }
|
2013-12-23 17:50:36 -06:00
|
|
|
|
2017-03-27 14:34:54 -05:00
|
|
|
get "my/*path", to: 'users#my_redirect'
|
|
|
|
get "user_preferences" => "users#user_preferences_redirect"
|
|
|
|
|
2017-03-30 21:04:00 -05:00
|
|
|
%w{users u}.each_with_index do |root_path, index|
|
2017-06-26 20:03:00 -05:00
|
|
|
get "#{root_path}" => "users#index", constraints: { format: 'html' }
|
|
|
|
|
|
|
|
resources :users, except: [:index, :new, :show, :update, :destroy], path: root_path do
|
2017-03-30 21:04:00 -05:00
|
|
|
collection do
|
|
|
|
get "check_username"
|
|
|
|
get "is_local_username"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-02-20 00:44:51 -06:00
|
|
|
post "#{root_path}/second_factors" => "users#create_second_factor"
|
|
|
|
put "#{root_path}/second_factor" => "users#update_second_factor"
|
|
|
|
|
2018-06-28 03:12:32 -05:00
|
|
|
put "#{root_path}/second_factors_backup" => "users#create_second_factor_backup"
|
|
|
|
|
2017-04-05 15:14:22 -05:00
|
|
|
put "#{root_path}/update-activation-email" => "users#update_activation_email"
|
2017-03-30 21:04:00 -05:00
|
|
|
get "#{root_path}/hp" => "users#get_honeypot_value"
|
2017-04-20 10:17:24 -05:00
|
|
|
post "#{root_path}/email-login" => "users#email_login"
|
2017-03-30 21:04:00 -05:00
|
|
|
get "#{root_path}/admin-login" => "users#admin_login"
|
|
|
|
put "#{root_path}/admin-login" => "users#admin_login"
|
|
|
|
get "#{root_path}/admin-login/:token" => "users#admin_login"
|
2017-12-21 19:18:12 -06:00
|
|
|
put "#{root_path}/admin-login/:token" => "users#admin_login"
|
2017-03-30 21:04:00 -05:00
|
|
|
post "#{root_path}/toggle-anon" => "users#toggle_anon"
|
|
|
|
post "#{root_path}/read-faq" => "users#read_faq"
|
|
|
|
get "#{root_path}/search/users" => "users#search_users"
|
2017-05-11 10:18:06 -05:00
|
|
|
|
2017-07-27 20:20:09 -05:00
|
|
|
get({ "#{root_path}/account-created/" => "users#account_created" }.merge(index == 1 ? { as: :users_account_created } : { as: :old_account_created }))
|
2017-05-11 10:18:06 -05:00
|
|
|
|
2017-05-02 14:57:55 -05:00
|
|
|
get "#{root_path}/account-created/resent" => "users#account_created"
|
|
|
|
get "#{root_path}/account-created/edit-email" => "users#account_created"
|
2017-03-30 21:04:00 -05:00
|
|
|
get({ "#{root_path}/password-reset/:token" => "users#password_reset" }.merge(index == 1 ? { as: :password_reset_token } : {}))
|
|
|
|
get "#{root_path}/confirm-email-token/:token" => "users#confirm_email_token", constraints: { format: 'json' }
|
|
|
|
put "#{root_path}/password-reset/:token" => "users#password_reset"
|
|
|
|
get "#{root_path}/activate-account/:token" => "users#activate_account"
|
|
|
|
put({ "#{root_path}/activate-account/:token" => "users#perform_account_activation" }.merge(index == 1 ? { as: 'perform_activate_account' } : {}))
|
|
|
|
get "#{root_path}/authorize-email/:token" => "users_email#confirm"
|
2017-12-21 19:18:12 -06:00
|
|
|
put "#{root_path}/authorize-email/:token" => "users_email#confirm"
|
2017-04-04 12:59:22 -05:00
|
|
|
get({
|
|
|
|
"#{root_path}/confirm-admin/:token" => "users#confirm_admin",
|
|
|
|
constraints: { token: /[0-9a-f]+/ }
|
|
|
|
}.merge(index == 1 ? { as: 'confirm_admin' } : {}))
|
|
|
|
post "#{root_path}/confirm-admin/:token" => "users#confirm_admin", constraints: { token: /[0-9a-f]+/ }
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username/private-messages" => "user_actions#private_messages", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/private-messages/:filter" => "user_actions#private_messages", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/messages" => "user_actions#private_messages", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/messages/:filter" => "user_actions#private_messages", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/messages/group/:group_name" => "user_actions#private_messages", constraints: { username: RouteFormat.username, group_name: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/messages/group/:group_name/archive" => "user_actions#private_messages", constraints: { username: RouteFormat.username, group_name: RouteFormat.username }
|
2018-03-10 23:29:34 -06:00
|
|
|
get "#{root_path}/:username/messages/tags/:tag_id" => "user_actions#private_messages", constraints: StaffConstraint.new
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username.json" => "users#show", constraints: { username: RouteFormat.username }, defaults: { format: :json }
|
|
|
|
get({ "#{root_path}/:username" => "users#show", constraints: { username: RouteFormat.username, format: /(json|html)/ } }.merge(index == 1 ? { as: 'user' } : {}))
|
|
|
|
put "#{root_path}/:username" => "users#update", constraints: { username: RouteFormat.username }, defaults: { format: :json }
|
|
|
|
get "#{root_path}/:username/emails" => "users#check_emails", constraints: { username: RouteFormat.username }
|
|
|
|
get({ "#{root_path}/:username/preferences" => "users#preferences", constraints: { username: RouteFormat.username } }.merge(index == 1 ? { as: :email_preferences } : {}))
|
|
|
|
get "#{root_path}/:username/preferences/email" => "users_email#index", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/account" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/profile" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/emails" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/notifications" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/categories" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/tags" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/interface" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/apps" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
put "#{root_path}/:username/preferences/email" => "users_email#update", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/about-me" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/badge_title" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
put "#{root_path}/:username/preferences/badge_title" => "users#badge_title", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/preferences/username" => "users#preferences", constraints: { username: RouteFormat.username }
|
|
|
|
put "#{root_path}/:username/preferences/username" => "users#username", constraints: { username: RouteFormat.username }
|
2017-12-21 19:18:12 -06:00
|
|
|
get "#{root_path}/:username/preferences/second-factor" => "users#preferences", constraints: { username: RouteFormat.username }
|
2018-06-28 03:12:32 -05:00
|
|
|
get "#{root_path}/:username/preferences/second-factor-backup" => "users#preferences", constraints: { username: RouteFormat.username }
|
2017-12-21 14:30:32 -06:00
|
|
|
delete "#{root_path}/:username/preferences/user_image" => "users#destroy_user_image", constraints: { username: RouteFormat.username }
|
|
|
|
put "#{root_path}/:username/preferences/avatar/pick" => "users#pick_avatar", constraints: { username: RouteFormat.username }
|
2018-07-18 05:57:43 -05:00
|
|
|
put "#{root_path}/:username/preferences/avatar/select" => "users#select_avatar", constraints: { username: RouteFormat.username }
|
2018-07-23 10:51:57 -05:00
|
|
|
post "#{root_path}/:username/preferences/revoke-account" => "users#revoke_account", constraints: { username: RouteFormat.username }
|
2018-08-31 03:18:06 -05:00
|
|
|
post "#{root_path}/:username/preferences/revoke-auth-token" => "users#revoke_auth_token", constraints: { username: RouteFormat.username }
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username/staff-info" => "users#staff_info", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/summary" => "users#summary", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/invited" => "users#invited", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/invited_count" => "users#invited_count", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/invited/:filter" => "users#invited", constraints: { username: RouteFormat.username }
|
2017-03-30 21:04:00 -05:00
|
|
|
post "#{root_path}/action/send_activation_email" => "users#send_activation_email"
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username/summary" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/activity/topics.rss" => "list#user_topics_feed", format: :rss, constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/activity.rss" => "posts#user_posts_feed", format: :rss, constraints: { username: RouteFormat.username }
|
2018-10-09 09:21:41 -05:00
|
|
|
get "#{root_path}/:username/activity.json" => "posts#user_posts_feed", format: :json, constraints: { username: RouteFormat.username }
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username/activity" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/activity/:filter" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/badges" => "users#badges", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/notifications" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/notifications/:filter" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/activity/pending" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
delete "#{root_path}/:username" => "users#destroy", constraints: { username: RouteFormat.username }
|
2017-07-27 20:20:09 -05:00
|
|
|
get "#{root_path}/by-external/:external_id" => "users#show", constraints: { external_id: /[^\/]+/ }
|
2017-12-21 14:30:32 -06:00
|
|
|
get "#{root_path}/:username/flagged-posts" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/deleted-posts" => "users#show", constraints: { username: RouteFormat.username }
|
|
|
|
get "#{root_path}/:username/topic-tracking-state" => "users#topic_tracking_state", constraints: { username: RouteFormat.username }
|
2018-10-10 12:00:08 -05:00
|
|
|
get "#{root_path}/:username/profile-hidden" => "users#profile_hidden"
|
2017-03-30 21:04:00 -05:00
|
|
|
end
|
2016-08-12 01:35:10 -05:00
|
|
|
|
2017-12-21 14:30:32 -06:00
|
|
|
get "user-badges/:username.json" => "user_badges#username", constraints: { username: RouteFormat.username }, defaults: { format: :json }
|
|
|
|
get "user-badges/:username" => "user_badges#username", constraints: { username: RouteFormat.username }
|
2013-12-23 17:50:36 -06:00
|
|
|
|
2017-12-21 14:30:32 -06:00
|
|
|
post "user_avatar/:username/refresh_gravatar" => "user_avatars#refresh_gravatar", constraints: { username: RouteFormat.username }
|
|
|
|
get "letter_avatar/:username/:size/:version.png" => "user_avatars#show_letter", format: false, constraints: { hostname: /[\w\.-]+/, size: /\d+/, username: RouteFormat.username }
|
|
|
|
get "user_avatar/:hostname/:username/:size/:version.png" => "user_avatars#show", format: false, constraints: { hostname: /[\w\.-]+/, size: /\d+/, username: RouteFormat.username }
|
2014-05-26 04:46:43 -05:00
|
|
|
|
2015-11-24 21:42:46 -06:00
|
|
|
# in most production settings this is bypassed
|
|
|
|
get "letter_avatar_proxy/:version/letter/:letter/:color/:size.png" => "user_avatars#show_proxy_letter"
|
|
|
|
|
2015-03-13 00:15:13 -05:00
|
|
|
get "highlight-js/:hostname/:version.js" => "highlight_js#show", format: false, constraints: { hostname: /[\w\.-]+/ }
|
|
|
|
|
2017-04-12 09:52:52 -05:00
|
|
|
get "stylesheets/:name.css.map" => "stylesheets#show_source_map", constraints: { name: /[-a-z0-9_]+/ }
|
|
|
|
get "stylesheets/:name.css" => "stylesheets#show", constraints: { name: /[-a-z0-9_]+/ }
|
2015-05-05 00:50:13 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
post "uploads" => "uploads#create"
|
2017-08-22 15:40:01 -05:00
|
|
|
post "uploads/lookup-urls" => "uploads#lookup_urls"
|
2013-12-23 17:50:36 -06:00
|
|
|
|
2015-05-19 17:04:03 -05:00
|
|
|
# used to download original images
|
2016-12-19 03:35:25 -06:00
|
|
|
get "uploads/:site/:sha(.:extension)" => "uploads#show", constraints: { site: /\w+/, sha: /\h{40}/, extension: /[a-z0-9\.]+/i }
|
2015-12-24 14:22:14 -06:00
|
|
|
# used to download attachments
|
2016-12-19 03:35:25 -06:00
|
|
|
get "uploads/:site/original/:tree:sha(.:extension)" => "uploads#show", constraints: { site: /\w+/, tree: /([a-z0-9]+\/)+/i, sha: /\h{40}/, extension: /[a-z0-9\.]+/i }
|
2015-05-20 07:55:42 -05:00
|
|
|
# used to download attachments (old route)
|
2016-12-15 16:21:44 -06:00
|
|
|
get "uploads/:site/:id/:sha" => "uploads#show", constraints: { site: /\w+/, id: /\d+/, sha: /\h{16}/ }
|
2015-05-19 17:04:03 -05:00
|
|
|
|
2016-03-21 05:22:36 -05:00
|
|
|
get "posts" => "posts#latest", id: "latest_posts"
|
|
|
|
get "private-posts" => "posts#latest", id: "private_posts"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "posts/by_number/:topic_id/:post_number" => "posts#by_number"
|
2018-07-19 09:00:13 -05:00
|
|
|
get "posts/by-date/:topic_id/:date" => "posts#by_date"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "posts/:id/reply-history" => "posts#reply_history"
|
2017-12-13 15:12:06 -06:00
|
|
|
get "posts/:id/reply-ids" => "posts#reply_ids"
|
2018-04-20 16:05:51 -05:00
|
|
|
get "posts/:id/reply-ids/all" => "posts#all_reply_ids"
|
2017-12-21 14:30:32 -06:00
|
|
|
get "posts/:username/deleted" => "posts#deleted_posts", constraints: { username: RouteFormat.username }
|
|
|
|
get "posts/:username/flagged" => "posts#flagged_posts", constraints: { username: RouteFormat.username }
|
2013-12-23 17:50:36 -06:00
|
|
|
|
2017-12-21 14:30:32 -06:00
|
|
|
resources :groups, id: RouteFormat.username do
|
2016-03-18 11:19:45 -05:00
|
|
|
get "posts.rss" => "groups#posts_feed", format: :rss
|
|
|
|
get "mentions.rss" => "groups#mentions_feed", format: :rss
|
|
|
|
|
2014-02-06 12:06:19 -06:00
|
|
|
get 'members'
|
2014-02-07 09:44:03 -06:00
|
|
|
get 'posts'
|
2015-11-30 23:52:43 -06:00
|
|
|
get 'mentions'
|
2014-02-18 15:17:04 -06:00
|
|
|
get 'counts'
|
2016-11-25 02:45:15 -06:00
|
|
|
get 'mentionable'
|
2017-08-28 11:32:08 -05:00
|
|
|
get 'messageable'
|
2016-12-11 09:36:15 -06:00
|
|
|
get 'logs' => 'groups#histories'
|
2015-01-08 17:35:52 -06:00
|
|
|
|
2017-07-21 01:12:24 -05:00
|
|
|
collection do
|
2018-07-31 22:08:45 -05:00
|
|
|
get "check-name" => 'groups#check_name'
|
2018-03-27 03:45:21 -05:00
|
|
|
get 'custom/new' => 'groups#new', constraints: AdminConstraint.new
|
2017-07-21 01:12:24 -05:00
|
|
|
get "search" => "groups#search"
|
|
|
|
end
|
|
|
|
|
2015-11-09 07:52:04 -06:00
|
|
|
member do
|
2018-03-15 03:01:40 -05:00
|
|
|
%w{
|
|
|
|
activity
|
|
|
|
activity/:filter
|
|
|
|
messages
|
|
|
|
messages/inbox
|
|
|
|
messages/archive
|
2018-03-26 23:18:03 -05:00
|
|
|
manage
|
|
|
|
manage/profile
|
|
|
|
manage/members
|
2018-04-05 22:36:57 -05:00
|
|
|
manage/membership
|
|
|
|
manage/interaction
|
2018-03-26 23:18:03 -05:00
|
|
|
manage/logs
|
2018-03-15 03:01:40 -05:00
|
|
|
}.each do |path|
|
|
|
|
get path => 'groups#show'
|
|
|
|
end
|
|
|
|
|
2015-11-09 07:52:04 -06:00
|
|
|
put "members" => "groups#add_members"
|
|
|
|
delete "members" => "groups#remove_member"
|
2017-06-13 03:10:14 -05:00
|
|
|
post "request_membership" => "groups#request_membership"
|
2015-12-14 16:17:09 -06:00
|
|
|
post "notifications" => "groups#set_notifications"
|
2015-11-09 07:52:04 -06:00
|
|
|
end
|
2014-02-06 12:06:19 -06:00
|
|
|
end
|
2014-01-30 16:10:36 -06:00
|
|
|
|
2015-11-09 07:52:04 -06:00
|
|
|
# aliases so old API code works
|
|
|
|
delete "admin/groups/:id/members" => "groups#remove_member", constraints: AdminConstraint.new
|
|
|
|
put "admin/groups/:id/members" => "groups#add_members", constraints: AdminConstraint.new
|
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
resources :posts do
|
2013-12-23 17:50:36 -06:00
|
|
|
put "bookmark"
|
2014-05-13 07:53:11 -05:00
|
|
|
put "wiki"
|
2014-09-10 16:08:33 -05:00
|
|
|
put "post_type"
|
2014-09-11 09:04:40 -05:00
|
|
|
put "rebake"
|
2014-09-22 11:55:13 -05:00
|
|
|
put "unhide"
|
2018-01-25 14:38:40 -06:00
|
|
|
put "locked"
|
2013-12-23 17:50:36 -06:00
|
|
|
get "replies"
|
2014-10-27 16:06:43 -05:00
|
|
|
get "revisions/latest" => "posts#latest_revision"
|
|
|
|
get "revisions/:revision" => "posts#revisions", constraints: { revision: /\d+/ }
|
|
|
|
put "revisions/:revision/hide" => "posts#hide_revision", constraints: { revision: /\d+/ }
|
|
|
|
put "revisions/:revision/show" => "posts#show_revision", constraints: { revision: /\d+/ }
|
2016-03-09 09:40:49 -06:00
|
|
|
put "revisions/:revision/revert" => "posts#revert", constraints: { revision: /\d+/ }
|
2013-12-23 17:50:36 -06:00
|
|
|
put "recover"
|
2013-02-05 13:16:51 -06:00
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
delete "destroy_many"
|
2016-03-21 18:31:56 -05:00
|
|
|
put "merge_posts"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-02-13 00:38:26 -06:00
|
|
|
resources :notifications, except: :show do
|
|
|
|
collection do
|
|
|
|
put 'mark-read' => 'notifications#mark_read'
|
|
|
|
# creating an alias cause the api was extended to mark a single notification
|
|
|
|
# this allows us to cleanly target it
|
|
|
|
put 'read' => 'notifications#mark_read'
|
|
|
|
end
|
|
|
|
end
|
2013-02-12 00:51:44 -06:00
|
|
|
|
2013-07-01 13:00:06 -05:00
|
|
|
match "/auth/:provider/callback", to: "users/omniauth_callbacks#complete", via: [:get, :post]
|
|
|
|
match "/auth/failure", to: "users/omniauth_callbacks#failure", via: [:get, :post]
|
2013-02-05 13:16:51 -06:00
|
|
|
|
|
|
|
resources :clicks do
|
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
get "track"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "excerpt" => "excerpt#show"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2015-09-30 11:28:13 -05:00
|
|
|
resources :post_action_users
|
2013-02-05 13:16:51 -06:00
|
|
|
resources :post_actions do
|
|
|
|
collection do
|
2013-12-23 17:50:36 -06:00
|
|
|
get "users"
|
2014-07-28 12:17:37 -05:00
|
|
|
post "defer_flags"
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
resources :user_actions
|
|
|
|
|
2014-04-16 08:12:06 -05:00
|
|
|
resources :badges, only: [:index]
|
2014-04-16 09:56:11 -05:00
|
|
|
get "/badges/:id(/:slug)" => "badges#show"
|
2014-03-05 06:52:20 -06:00
|
|
|
resources :user_badges, only: [:index, :create, :destroy]
|
|
|
|
|
2018-04-10 15:24:29 -05:00
|
|
|
get '/c', to: redirect(relative_url_root + 'categories')
|
2015-03-30 11:15:02 -05:00
|
|
|
|
2017-07-27 20:20:09 -05:00
|
|
|
resources :categories, except: :show
|
2014-01-17 16:52:06 -06:00
|
|
|
post "category/:category_id/move" => "categories#move"
|
2015-08-27 12:14:59 -05:00
|
|
|
post "categories/reorder" => "categories#reorder"
|
2014-04-17 04:17:39 -05:00
|
|
|
post "category/:category_id/notifications" => "categories#set_notifications"
|
2014-12-20 08:07:29 -06:00
|
|
|
put "category/:category_id/slug" => "categories#update_slug"
|
2014-01-17 16:52:06 -06:00
|
|
|
|
2016-08-29 15:47:44 -05:00
|
|
|
get "categories_and_latest" => "categories#categories_and_latest"
|
2018-03-02 20:53:29 -06:00
|
|
|
get "categories_and_top" => "categories#categories_and_top"
|
2016-08-29 15:47:44 -05:00
|
|
|
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:id/show" => "categories#show"
|
2016-03-14 11:38:29 -05:00
|
|
|
get "c/:category_slug/find_by_slug" => "categories#find_by_slug"
|
|
|
|
get "c/:parent_category_slug/:category_slug/find_by_slug" => "categories#find_by_slug"
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:category.rss" => "list#category_feed", format: :rss
|
|
|
|
get "c/:parent_category/:category.rss" => "list#category_feed", format: :rss
|
2017-03-02 09:56:04 -06:00
|
|
|
get "c/:category" => "list#category_default", as: "category_default"
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:category/none" => "list#category_none_latest"
|
2015-12-28 00:28:16 -06:00
|
|
|
get "c/:parent_category/:category/(:id)" => "list#parent_category_category_latest", constraints: { id: /\d+/ }
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:category/l/top" => "list#category_top", as: "category_top"
|
|
|
|
get "c/:category/none/l/top" => "list#category_none_top", as: "category_none_top"
|
|
|
|
get "c/:parent_category/:category/l/top" => "list#parent_category_category_top", as: "parent_category_category_top"
|
|
|
|
|
2015-12-28 00:28:16 -06:00
|
|
|
get "category_hashtags/check" => "category_hashtags#check"
|
2014-01-13 18:02:14 -06:00
|
|
|
|
|
|
|
TopTopic.periods.each do |period|
|
2017-03-13 03:54:10 -05:00
|
|
|
get "top/#{period}.rss" => "list#top_#{period}_feed", format: :rss
|
2014-01-13 18:02:14 -06:00
|
|
|
get "top/#{period}" => "list#top_#{period}"
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:category/l/top/#{period}" => "list#category_top_#{period}", as: "category_top_#{period}"
|
|
|
|
get "c/:category/none/l/top/#{period}" => "list#category_none_top_#{period}", as: "category_none_top_#{period}"
|
|
|
|
get "c/:parent_category/:category/l/top/#{period}" => "list#parent_category_category_top_#{period}", as: "parent_category_category_top_#{period}"
|
2013-07-05 15:49:06 -05:00
|
|
|
end
|
|
|
|
|
2014-10-15 22:52:21 -05:00
|
|
|
Discourse.anonymous_filters.each do |filter|
|
|
|
|
get "#{filter}.rss" => "list##{filter}_feed", format: :rss
|
|
|
|
end
|
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
Discourse.filters.each do |filter|
|
2015-09-10 13:46:37 -05:00
|
|
|
get "#{filter}" => "list##{filter}", constraints: { format: /(json|html)/ }
|
2014-10-16 11:15:31 -05:00
|
|
|
get "c/:category/l/#{filter}" => "list#category_#{filter}", as: "category_#{filter}"
|
|
|
|
get "c/:category/none/l/#{filter}" => "list#category_none_#{filter}", as: "category_none_#{filter}"
|
|
|
|
get "c/:parent_category/:category/l/#{filter}" => "list#parent_category_category_#{filter}", as: "parent_category_category_#{filter}"
|
2013-03-28 08:01:13 -05:00
|
|
|
end
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2014-10-16 11:15:31 -05:00
|
|
|
get "category/*path" => "categories#redirect"
|
|
|
|
|
|
|
|
get "top" => "list#top"
|
2015-04-03 15:55:32 -05:00
|
|
|
get "search/query" => "search#query"
|
2015-07-27 01:46:50 -05:00
|
|
|
get "search" => "search#show"
|
2017-07-17 14:42:32 -05:00
|
|
|
post "search/click" => "search#click"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
|
|
|
# Topics resource
|
2013-12-23 17:50:36 -06:00
|
|
|
get "t/:id" => "topics#show"
|
2014-01-13 18:02:14 -06:00
|
|
|
put "t/:id" => "topics#update"
|
|
|
|
delete "t/:id" => "topics#destroy"
|
2015-12-29 20:26:21 -06:00
|
|
|
put "t/:id/archive-message" => "topics#archive_message"
|
|
|
|
put "t/:id/move-to-inbox" => "topics#move_to_inbox"
|
2016-05-01 06:48:43 -05:00
|
|
|
put "t/:id/convert-topic/:type" => "topics#convert_topic"
|
2018-03-13 14:59:12 -05:00
|
|
|
put "t/:id/publish" => "topics#publish"
|
2018-03-23 10:12:22 -05:00
|
|
|
put "t/:id/shared-draft" => "topics#update_shared_draft"
|
2018-08-09 19:51:03 -05:00
|
|
|
put "t/:id/reset-bump-date" => "topics#reset_bump_date"
|
2014-01-29 14:48:52 -06:00
|
|
|
put "topics/bulk"
|
2014-03-03 14:46:38 -06:00
|
|
|
put "topics/reset-new" => 'topics#reset_new'
|
2013-12-23 17:50:36 -06:00
|
|
|
post "topics/timings"
|
2015-06-24 14:08:22 -05:00
|
|
|
|
|
|
|
get 'topics/similar_to' => 'similar_topics#index'
|
|
|
|
resources :similar_topics
|
|
|
|
|
2015-03-13 19:18:05 -05:00
|
|
|
get "topics/feature_stats"
|
2018-02-13 14:46:25 -06:00
|
|
|
|
|
|
|
scope "/topics", username: RouteFormat.username do
|
|
|
|
get "created-by/:username" => "list#topics_by", as: "topics_by"
|
|
|
|
get "private-messages/:username" => "list#private_messages", as: "topics_private_messages"
|
|
|
|
get "private-messages-sent/:username" => "list#private_messages_sent", as: "topics_private_messages_sent"
|
|
|
|
get "private-messages-archive/:username" => "list#private_messages_archive", as: "topics_private_messages_archive"
|
|
|
|
get "private-messages-unread/:username" => "list#private_messages_unread", as: "topics_private_messages_unread"
|
2018-03-10 23:29:34 -06:00
|
|
|
get "private-messages-tags/:username/:tag_id.json" => "list#private_messages_tag", as: "topics_private_messages_tag", constraints: StaffConstraint.new
|
2018-04-12 04:10:53 -05:00
|
|
|
get "groups/:group_name" => "list#group_topics", as: "group_topics", group_name: RouteFormat.username
|
2018-02-13 14:46:25 -06:00
|
|
|
|
|
|
|
scope "/private-messages-group/:username", group_name: RouteFormat.username do
|
|
|
|
get ":group_name.json" => "list#private_messages_group", as: "topics_private_messages_group"
|
|
|
|
get ":group_name/archive.json" => "list#private_messages_group_archive", as: "topics_private_messages_group_archive"
|
|
|
|
end
|
|
|
|
end
|
2015-12-22 18:09:17 -06:00
|
|
|
|
2014-01-03 11:52:24 -06:00
|
|
|
get 'embed/comments' => 'embed#comments'
|
2014-01-13 11:47:24 -06:00
|
|
|
get 'embed/count' => 'embed#count'
|
2015-05-05 20:00:31 -05:00
|
|
|
get 'embed/info' => 'embed#info'
|
2013-12-31 13:37:43 -06:00
|
|
|
|
2015-04-27 13:36:02 -05:00
|
|
|
get "new-topic" => "list#latest"
|
2015-11-24 06:46:42 -06:00
|
|
|
get "new-message" => "list#latest"
|
2015-04-27 13:36:02 -05:00
|
|
|
|
2013-02-14 13:11:13 -06:00
|
|
|
# Topic routes
|
2014-09-17 10:18:41 -05:00
|
|
|
get "t/id_for/:slug" => "topics#id_for_slug"
|
2017-07-27 20:20:09 -05:00
|
|
|
get "t/:slug/:topic_id/print" => "topics#show", format: :html, print: true, constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id/wordpress" => "topics#wordpress", constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:topic_id/wordpress" => "topics#wordpress", constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id/moderator-liked" => "topics#moderator_liked", constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id/summary" => "topics#show", defaults: { summary: true }, constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:topic_id/summary" => "topics#show", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:slug/:topic_id" => "topics#update", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:slug/:topic_id/star" => "topics#star", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/star" => "topics#star", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:slug/:topic_id/status" => "topics#status", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/status" => "topics#status", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/clear-pin" => "topics#clear_pin", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/re-pin" => "topics#re_pin", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/mute" => "topics#mute", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/unmute" => "topics#unmute", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/timer" => "topics#timer", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/make-banner" => "topics#make_banner", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/remove-banner" => "topics#remove_banner", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/remove-allowed-user" => "topics#remove_allowed_user", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/remove-allowed-group" => "topics#remove_allowed_group", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/recover" => "topics#recover", constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:topic_id/:post_number" => "topics#show", constraints: { topic_id: /\d+/, post_number: /\d+/ }
|
|
|
|
get "t/:topic_id/last" => "topics#show", post_number: 99999999, constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id.rss" => "topics#feed", format: :rss, constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id" => "topics#show", constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id/:post_number" => "topics#show", constraints: { topic_id: /\d+/, post_number: /\d+/ }
|
|
|
|
get "t/:slug/:topic_id/last" => "topics#show", post_number: 99999999, constraints: { topic_id: /\d+/ }
|
|
|
|
get "t/:topic_id/posts" => "topics#posts", constraints: { topic_id: /\d+/ }, format: :json
|
2018-06-28 01:54:54 -05:00
|
|
|
get "t/:topic_id/post_ids" => "topics#post_ids", constraints: { topic_id: /\d+/ }, format: :json
|
2017-07-27 20:20:09 -05:00
|
|
|
get "t/:topic_id/excerpts" => "topics#excerpts", constraints: { topic_id: /\d+/ }, format: :json
|
|
|
|
post "t/:topic_id/timings" => "topics#timings", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/invite" => "topics#invite", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/invite-group" => "topics#invite_group", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/move-posts" => "topics#move_posts", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/merge-topic" => "topics#merge_topic", constraints: { topic_id: /\d+/ }
|
|
|
|
post "t/:topic_id/change-owner" => "topics#change_post_owners", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/change-timestamp" => "topics#change_timestamps", constraints: { topic_id: /\d+/ }
|
|
|
|
delete "t/:topic_id/timings" => "topics#destroy_timings", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/bookmark" => "topics#bookmark", constraints: { topic_id: /\d+/ }
|
|
|
|
put "t/:topic_id/remove_bookmarks" => "topics#remove_bookmarks", constraints: { topic_id: /\d+/ }
|
|
|
|
|
|
|
|
post "t/:topic_id/notifications" => "topics#set_notifications" , constraints: { topic_id: /\d+/ }
|
2013-12-23 17:50:36 -06:00
|
|
|
|
2014-07-11 16:34:26 -05:00
|
|
|
get "p/:post_id(/:user_id)" => "posts#short_link"
|
2014-06-20 16:06:44 -05:00
|
|
|
get "/posts/:id/cooked" => "posts#cooked"
|
2014-04-01 16:45:16 -05:00
|
|
|
get "/posts/:id/expand-embed" => "posts#expand_embed"
|
2014-07-11 16:34:26 -05:00
|
|
|
get "/posts/:id/raw" => "posts#markdown_id"
|
2014-10-17 14:18:29 -05:00
|
|
|
get "/posts/:id/raw-email" => "posts#raw_email"
|
2014-07-11 16:34:26 -05:00
|
|
|
get "raw/:topic_id(/:post_number)" => "posts#markdown_num"
|
2013-04-30 01:29:57 -05:00
|
|
|
|
2015-04-10 16:00:50 -05:00
|
|
|
resources :queued_posts, constraints: StaffConstraint.new
|
|
|
|
get 'queued-posts' => 'queued_posts#index'
|
|
|
|
|
2016-12-04 10:06:35 -06:00
|
|
|
resources :invites
|
|
|
|
post "invites/upload_csv" => "invites#upload_csv"
|
2017-06-29 09:32:07 -05:00
|
|
|
post "invites/rescind-all" => "invites#rescind_all_invites"
|
2014-10-06 13:48:56 -05:00
|
|
|
post "invites/reinvite" => "invites#resend_invite"
|
2016-06-02 14:09:02 -05:00
|
|
|
post "invites/reinvite-all" => "invites#resend_all_invites"
|
2015-08-25 20:41:52 -05:00
|
|
|
post "invites/link" => "invites#create_invite_link"
|
2013-12-23 17:50:36 -06:00
|
|
|
delete "invites" => "invites#destroy"
|
2017-01-24 14:15:29 -06:00
|
|
|
put "invites/show/:id" => "invites#perform_accept_invitation", as: 'perform_accept_invite'
|
2013-02-14 13:11:13 -06:00
|
|
|
|
2014-12-22 10:17:04 -06:00
|
|
|
resources :export_csv do
|
|
|
|
collection do
|
2015-07-24 11:33:53 -05:00
|
|
|
post "export_entity" => "export_csv#export_entity"
|
2014-12-22 10:17:04 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "onebox" => "onebox#show"
|
2017-07-19 14:08:54 -05:00
|
|
|
get "inline-onebox" => "inline_onebox#show"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2014-06-16 13:25:33 -05:00
|
|
|
get "exception" => "list#latest"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "message-bus/poll" => "message_bus#poll"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
FEATURE: Drafts view in user profile
* add drafts.json endpoint, user profile tab with drafts stream
* improve drafts stream display in user profile
* truncate excerpts in drafts list, better handling for resume draft action
* improve draft stream SQL query, add rspec tests
* if composer is open, quietly close it when user opens another draft from drafts stream; load PM draft only when user is in /u/username/messages (instead of /u/username)
* cleanup
* linting fixes
* apply prettier styling to modified files
* add client tests for drafts, includes a fixture for drafts.json
* improvements to code following review
* refresh drafts route when user deletes a draft open in the composer while being in the drafts route; minor prettier scss fix
* added more spec tests, deleted an acceptance test for removing drafts that was too finicky, formatting and code style fixes, added appEvent for draft:destroyed
* prettier, eslint fixes
* use "username_lower" from users table, added error handling for rejected promises
* adds guardian spec for can_see_drafts, adds improvements following code review
* move DraftsController spec to its own file
* fix failing drafts qunit test, use getOwner instead of deprecated this.container
* limit test fixture for draft.json testing to new_topic request only
2018-08-01 01:34:54 -05:00
|
|
|
resources :drafts, only: [:index]
|
2013-12-23 17:50:36 -06:00
|
|
|
get "draft" => "draft#show"
|
|
|
|
post "draft" => "draft#update"
|
|
|
|
delete "draft" => "draft#destroy"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2018-02-14 20:24:39 -06:00
|
|
|
if service_worker_asset = Rails.application.assets_manifest.assets['service-worker.js']
|
2018-02-18 18:04:15 -06:00
|
|
|
# https://developers.google.com/web/fundamentals/codelabs/debugging-service-workers/
|
|
|
|
# Normally the browser will wait until a user closes all tabs that contain the
|
|
|
|
# current site before updating to a new Service Worker.
|
|
|
|
# Support the old Service Worker path to avoid routing error filling up the
|
|
|
|
# logs.
|
2018-05-08 12:39:02 -05:00
|
|
|
get "/service-worker.js" => redirect(relative_url_root + service_worker_asset, status: 302), format: :js
|
2018-02-14 20:24:39 -06:00
|
|
|
get service_worker_asset => "static#service_worker_asset", format: :js
|
2018-04-05 15:10:36 -05:00
|
|
|
elsif Rails.env.development?
|
|
|
|
get "/service-worker.js" => "static#service_worker_asset", format: :js
|
2018-02-14 20:24:39 -06:00
|
|
|
end
|
2017-11-22 19:02:01 -06:00
|
|
|
|
2014-05-18 17:46:09 -05:00
|
|
|
get "cdn_asset/:site/*path" => "static#cdn_asset", format: false
|
2016-12-04 20:57:09 -06:00
|
|
|
get "brotli_asset/*path" => "static#brotli_asset", format: false
|
2014-05-18 17:46:09 -05:00
|
|
|
|
2015-08-24 20:54:23 -05:00
|
|
|
get "favicon/proxied" => "static#favicon", format: false
|
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
get "robots.txt" => "robots_txt#index"
|
2018-04-16 14:43:20 -05:00
|
|
|
get "robots-builder.json" => "robots_txt#builder"
|
2017-10-30 18:46:48 -05:00
|
|
|
get "offline.html" => "offline#index"
|
2018-06-13 22:13:28 -05:00
|
|
|
get "manifest.webmanifest" => "metadata#manifest", as: :manifest
|
|
|
|
get "manifest.json" => "metadata#manifest"
|
2016-02-13 12:29:53 -06:00
|
|
|
get "opensearch" => "metadata#opensearch", format: :xml
|
2013-02-10 18:02:57 -06:00
|
|
|
|
2016-04-25 14:55:15 -05:00
|
|
|
scope "/tags" do
|
|
|
|
get '/' => 'tags#index'
|
|
|
|
get '/filter/list' => 'tags#index'
|
|
|
|
get '/filter/search' => 'tags#search'
|
|
|
|
get '/check' => 'tags#check_hashtag'
|
2018-03-15 07:33:08 -05:00
|
|
|
get '/personal_messages/:username' => 'tags#personal_messages'
|
2016-04-25 14:55:15 -05:00
|
|
|
constraints(tag_id: /[^\/]+?/, format: /json|rss/) do
|
|
|
|
get '/:tag_id.rss' => 'tags#tag_feed'
|
2016-07-25 15:01:07 -05:00
|
|
|
get '/:tag_id' => 'tags#show', as: 'tag_show'
|
|
|
|
get '/c/:category/:tag_id' => 'tags#show', as: 'tag_category_show'
|
|
|
|
get '/c/:parent_category/:category/:tag_id' => 'tags#show', as: 'tag_parent_category_category_show'
|
2016-08-15 14:30:17 -05:00
|
|
|
get '/intersection/:tag_id/*additional_tag_ids' => 'tags#show', as: 'tag_intersection'
|
2016-04-25 14:55:15 -05:00
|
|
|
get '/:tag_id/notifications' => 'tags#notifications'
|
|
|
|
put '/:tag_id/notifications' => 'tags#update_notifications'
|
|
|
|
put '/:tag_id' => 'tags#update'
|
|
|
|
delete '/:tag_id' => 'tags#destroy'
|
|
|
|
|
|
|
|
Discourse.filters.each do |filter|
|
2016-07-25 15:01:07 -05:00
|
|
|
get "/:tag_id/l/#{filter}" => "tags#show_#{filter}", as: "tag_show_#{filter}"
|
|
|
|
get "/c/:category/:tag_id/l/#{filter}" => "tags#show_#{filter}", as: "tag_category_show_#{filter}"
|
|
|
|
get "/c/:parent_category/:category/:tag_id/l/#{filter}" => "tags#show_#{filter}", as: "tag_parent_category_category_show_#{filter}"
|
2016-04-25 14:55:15 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-06-07 12:08:59 -05:00
|
|
|
|
2018-09-17 10:40:15 -05:00
|
|
|
resources :tag_groups, constraints: StaffConstraint.new, except: [:new, :edit] do
|
2016-06-07 12:08:59 -05:00
|
|
|
collection do
|
|
|
|
get '/filter/search' => 'tag_groups#search'
|
|
|
|
end
|
|
|
|
end
|
2016-04-25 14:55:15 -05:00
|
|
|
|
2013-12-23 17:50:36 -06:00
|
|
|
Discourse.filters.each do |filter|
|
2017-07-27 20:20:09 -05:00
|
|
|
root to: "list##{filter}", constraints: HomePageConstraint.new("#{filter}"), as: "list_#{filter}"
|
2013-03-28 08:01:13 -05:00
|
|
|
end
|
|
|
|
# special case for categories
|
2017-07-27 20:20:09 -05:00
|
|
|
root to: "categories#index", constraints: HomePageConstraint.new("categories"), as: "categories_index"
|
2014-01-03 12:36:49 -06:00
|
|
|
# special case for top
|
2017-07-27 20:20:09 -05:00
|
|
|
root to: "list#top", constraints: HomePageConstraint.new("top"), as: "top_lists"
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2016-10-18 10:44:25 -05:00
|
|
|
root to: 'finish_installation#index', constraints: HomePageConstraint.new("finish_installation"), as: 'installation_redirect'
|
|
|
|
|
2016-08-15 02:58:33 -05:00
|
|
|
get "/user-api-key/new" => "user_api_keys#new"
|
2016-08-16 00:10:32 -05:00
|
|
|
post "/user-api-key" => "user_api_keys#create"
|
2016-08-16 02:06:33 -05:00
|
|
|
post "/user-api-key/revoke" => "user_api_keys#revoke"
|
|
|
|
post "/user-api-key/undo-revoke" => "user_api_keys#undo_revoke"
|
2016-08-15 02:58:33 -05:00
|
|
|
|
2016-11-20 23:46:02 -06:00
|
|
|
get "/safe-mode" => "safe_mode#index"
|
|
|
|
post "/safe-mode" => "safe_mode#enter", as: "safe_mode_enter"
|
|
|
|
|
2018-08-07 23:46:34 -05:00
|
|
|
get "/themes/assets/:ids" => "themes#assets"
|
2017-04-12 09:52:52 -05:00
|
|
|
|
2018-04-23 01:42:25 -05:00
|
|
|
if Rails.env == "test" || Rails.env == "development"
|
|
|
|
get "/qunit" => "qunit#index"
|
|
|
|
end
|
|
|
|
|
2018-05-04 17:31:48 -05:00
|
|
|
post "/push_notifications/subscribe" => "push_notification#subscribe"
|
|
|
|
post "/push_notifications/unsubscribe" => "push_notification#unsubscribe"
|
|
|
|
|
2018-06-06 01:55:22 -05:00
|
|
|
get "*url", to: 'permalinks#show', constraints: PermalinkConstraint.new
|
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|