2013-12-24 07:50:36 +08:00
|
|
|
require "sidekiq/web"
|
2014-02-06 07:14:41 +08:00
|
|
|
require_dependency "scheduler/web"
|
2013-12-24 07:50:36 +08:00
|
|
|
require_dependency "admin_constraint"
|
|
|
|
require_dependency "staff_constraint"
|
|
|
|
require_dependency "homepage_constraint"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
# This used to be User#username_format, but that causes a preload of the User object
|
2013-02-15 03:11:13 +08:00
|
|
|
# and makes Guard not work properly.
|
2013-03-26 09:08:23 +08:00
|
|
|
USERNAME_ROUTE_FORMAT = /[A-Za-z0-9\_]+/ unless defined? USERNAME_ROUTE_FORMAT
|
2014-03-07 12:59:10 +08:00
|
|
|
BACKUP_ROUTE_FORMAT = /[a-zA-Z0-9\-_]*\d{4}(-\d{2}){2}-\d{6}\.tar\.gz/i unless defined? BACKUP_ROUTE_FORMAT
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
Discourse::Application.routes.draw do
|
|
|
|
|
2013-07-02 02:00:06 +08:00
|
|
|
match "/404", to: "exceptions#not_found", via: [:get, :post]
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
mount Sidekiq::Web => "/sidekiq", constraints: AdminConstraint.new
|
2014-02-19 06:18:42 +08:00
|
|
|
|
2014-02-17 09:26:25 +08:00
|
|
|
get "site" => "site#index"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-06-26 03:05:16 +08:00
|
|
|
resources :forums
|
2013-12-24 07:50:36 +08:00
|
|
|
get "srv/status" => "forums#status"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-05-02 15:22:27 +08:00
|
|
|
namespace :admin, constraints: StaffConstraint.new do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "" => "admin#index"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-11-14 03:02:47 +08:00
|
|
|
resources :site_settings, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "category/:id" => "site_settings#index"
|
2013-11-14 03:02:47 +08:00
|
|
|
end
|
|
|
|
end
|
2013-05-02 13:15:17 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "reports/:type" => "reports#show"
|
2013-02-28 11:39:42 +08:00
|
|
|
|
2013-05-08 13:20:38 +08:00
|
|
|
resources :groups, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
post "refresh_automatic_groups" => "groups#refresh_automatic_groups"
|
2013-05-08 13:20:38 +08:00
|
|
|
end
|
2013-12-24 07:50:36 +08:00
|
|
|
get "users"
|
2013-05-08 13:20:38 +08:00
|
|
|
end
|
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
resources :users, id: USERNAME_ROUTE_FORMAT do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "list/:query" => "users#index"
|
|
|
|
put "approve-bulk" => "users#approve_bulk"
|
|
|
|
delete "reject-bulk" => "users#reject_bulk"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
2013-12-24 07:50:36 +08: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
|
|
|
|
put "activate"
|
|
|
|
put "deactivate"
|
|
|
|
put "block"
|
|
|
|
put "unblock"
|
|
|
|
put "trust_level"
|
2014-02-11 05:59:36 +08:00
|
|
|
put "primary_group"
|
2014-03-19 22:27:21 +08:00
|
|
|
get "badges"
|
2014-01-24 05:40:10 +08:00
|
|
|
get "leader_requirements"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
|
2013-05-02 13:15:17 +08:00
|
|
|
resources :impersonate, constraints: AdminConstraint.new
|
2013-06-04 04:12:24 +08:00
|
|
|
|
|
|
|
resources :email do
|
2013-02-06 03:16:51 +08:00
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
post "test"
|
2014-02-15 08:17:13 +08:00
|
|
|
get "all"
|
2014-02-15 07:50:08 +08:00
|
|
|
get "sent"
|
2014-02-15 02:06:21 +08:00
|
|
|
get "skipped"
|
2013-12-24 07:50:36 +08:00
|
|
|
get "preview-digest" => "email#preview_digest"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
2013-06-04 04:12:24 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
scope "/logs" do
|
2013-10-22 02:49:51 +08:00
|
|
|
resources :staff_action_logs, only: [:index]
|
|
|
|
resources :screened_emails, only: [:index]
|
2013-10-25 05:18:10 +08:00
|
|
|
resources :screened_ip_addresses, only: [:index, :create, :update, :destroy]
|
2013-10-22 02:49:51 +08:00
|
|
|
resources :screened_urls, only: [:index]
|
2013-08-02 09:30:13 +08:00
|
|
|
end
|
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "customize" => "site_customizations#index", constraints: AdminConstraint.new
|
|
|
|
get "flags" => "flags#index"
|
|
|
|
get "flags/:filter" => "flags#index"
|
|
|
|
post "flags/agree/:id" => "flags#agree"
|
|
|
|
post "flags/disagree/:id" => "flags#disagree"
|
|
|
|
post "flags/defer/:id" => "flags#defer"
|
2013-05-02 13:15:17 +08:00
|
|
|
resources :site_customizations, constraints: AdminConstraint.new
|
|
|
|
resources :site_contents, constraints: AdminConstraint.new
|
|
|
|
resources :site_content_types, constraints: AdminConstraint.new
|
2014-02-13 12:33:40 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "version_check" => "versions#show"
|
2014-02-13 12:33:40 +08:00
|
|
|
|
2013-03-30 03:48:26 +08:00
|
|
|
resources :dashboard, only: [:index] do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "problems"
|
2013-03-30 03:48:26 +08:00
|
|
|
end
|
|
|
|
end
|
2014-02-13 12:33:40 +08:00
|
|
|
|
2013-05-02 13:15:17 +08:00
|
|
|
resources :api, only: [:index], constraints: AdminConstraint.new do
|
2013-03-26 09:04:28 +08:00
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
post "key" => "api#create_master_key"
|
|
|
|
put "key" => "api#regenerate_key"
|
|
|
|
delete "key" => "api#revoke_key"
|
2013-03-26 09:04:28 +08:00
|
|
|
end
|
|
|
|
end
|
2014-02-13 12:33:40 +08:00
|
|
|
|
|
|
|
resources :backups, only: [:index, :create], constraints: AdminConstraint.new do
|
|
|
|
member do
|
|
|
|
get "" => "backups#show", constraints: { id: BACKUP_ROUTE_FORMAT }
|
|
|
|
delete "" => "backups#destroy", constraints: { id: BACKUP_ROUTE_FORMAT }
|
|
|
|
post "restore" => "backups#restore", constraints: { id: BACKUP_ROUTE_FORMAT }
|
|
|
|
end
|
|
|
|
collection do
|
|
|
|
get "logs" => "backups#logs"
|
|
|
|
get "status" => "backups#status"
|
|
|
|
get "cancel" => "backups#cancel"
|
|
|
|
get "rollback" => "backups#rollback"
|
|
|
|
put "readonly" => "backups#readonly"
|
2014-02-22 08:41:01 +08:00
|
|
|
get "upload" => "backups#check_chunk"
|
|
|
|
post "upload" => "backups#upload_chunk"
|
2014-02-13 12:33:40 +08:00
|
|
|
end
|
|
|
|
end
|
2014-02-15 07:50:08 +08:00
|
|
|
|
2014-03-05 20:52:20 +08:00
|
|
|
resources :badges, constraints: AdminConstraint.new do
|
|
|
|
collection do
|
|
|
|
get "types" => "badges#badge_types"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-02-14 12:43:08 +08:00
|
|
|
get "memory_stats"=> "diagnostics#memory_stats", constraints: AdminConstraint.new
|
2014-02-13 12:33:40 +08:00
|
|
|
|
2013-11-12 13:42:35 +08:00
|
|
|
end # admin namespace
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "email_preferences" => "email#preferences_redirect", :as => "email_preferences_redirect"
|
|
|
|
get "email/unsubscribe/:key" => "email#unsubscribe", as: "email_unsubscribe"
|
|
|
|
post "email/resubscribe/:key" => "email#resubscribe", as: "email_resubscribe"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-03-23 23:02:59 +08:00
|
|
|
resources :session, id: USERNAME_ROUTE_FORMAT, only: [:create, :destroy] do
|
2013-02-15 03:11:13 +08:00
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
post "forgot_password"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
2013-02-15 03:11:13 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2014-02-25 11:30:49 +08:00
|
|
|
get "session/sso" => "session#sso"
|
|
|
|
get "session/sso_login" => "session#sso_login"
|
2014-02-06 02:46:24 +08:00
|
|
|
get "session/current" => "session#current"
|
2013-12-24 07:50:36 +08:00
|
|
|
get "session/csrf" => "session#csrf"
|
|
|
|
get "composer-messages" => "composer_messages#index"
|
2013-07-29 13:13:13 +08:00
|
|
|
|
2014-02-14 00:42:35 +08:00
|
|
|
resources :users, except: [:show, :update, :destroy] do
|
2013-02-15 03:11:13 +08:00
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "check_username"
|
|
|
|
get "is_local_username"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
resources :static
|
2013-12-24 07:50:36 +08:00
|
|
|
post "login" => "static#enter"
|
|
|
|
get "login" => "static#show", id: "login"
|
|
|
|
get "faq" => "static#show", id: "faq"
|
|
|
|
get "tos" => "static#show", id: "tos"
|
|
|
|
get "privacy" => "static#show", id: "privacy"
|
2014-02-19 06:18:42 +08:00
|
|
|
get "signup" => "list#latest"
|
2013-12-24 07:50:36 +08:00
|
|
|
|
|
|
|
get "users/search/users" => "users#search_users"
|
|
|
|
get "users/password-reset/:token" => "users#password_reset"
|
|
|
|
put "users/password-reset/:token" => "users#password_reset"
|
|
|
|
get "users/activate-account/:token" => "users#activate_account"
|
|
|
|
get "users/authorize-email/:token" => "users#authorize_email"
|
|
|
|
get "users/hp" => "users#get_honeypot_value"
|
|
|
|
|
|
|
|
get "user_preferences" => "users#user_preferences_redirect"
|
|
|
|
get "users/:username/private-messages" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/private-messages/:filter" => "user_actions#private_messages", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username" => "users#show", as: 'userpage', constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
put "users/:username" => "users#update", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/preferences" => "users#preferences", constraints: {username: USERNAME_ROUTE_FORMAT}, as: :email_preferences
|
|
|
|
get "users/:username/preferences/email" => "users#preferences", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
put "users/:username/preferences/email" => "users#change_email", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/preferences/about-me" => "users#preferences", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/preferences/username" => "users#preferences", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
put "users/:username/preferences/username" => "users#username", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/avatar(/:size)" => "users#avatar", constraints: {username: USERNAME_ROUTE_FORMAT} # LEGACY ROUTE
|
|
|
|
post "users/:username/preferences/avatar" => "users#upload_avatar", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2014-03-01 04:12:51 +08:00
|
|
|
post "users/:username/preferences/user_image" => "users#upload_user_image", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2013-12-24 07:50:36 +08:00
|
|
|
put "users/:username/preferences/avatar/toggle" => "users#toggle_avatar", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2014-03-01 04:12:51 +08:00
|
|
|
put "users/:username/preferences/profile_background/clear" => "users#clear_profile_background", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2013-12-24 07:50:36 +08:00
|
|
|
get "users/:username/invited" => "users#invited", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
post "users/:username/send_activation_email" => "users#send_activation_email", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/activity" => "users#show", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "users/:username/activity/:filter" => "users#show", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2014-02-14 00:42:35 +08:00
|
|
|
delete "users/:username" => "users#destroy", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2013-12-24 07:50:36 +08:00
|
|
|
|
|
|
|
get "uploads/:site/:id/:sha.:extension" => "uploads#show", constraints: {site: /\w+/, id: /\d+/, sha: /[a-z0-9]{15,16}/i, extension: /\w{2,}/}
|
|
|
|
post "uploads" => "uploads#create"
|
|
|
|
|
|
|
|
get "posts/by_number/:topic_id/:post_number" => "posts#by_number"
|
|
|
|
get "posts/:id/reply-history" => "posts#reply_history"
|
|
|
|
|
2014-02-07 02:06:19 +08:00
|
|
|
resources :groups do
|
|
|
|
get 'members'
|
2014-02-07 23:44:03 +08:00
|
|
|
get 'posts'
|
2014-02-19 05:17:04 +08:00
|
|
|
get 'counts'
|
2014-02-07 02:06:19 +08:00
|
|
|
end
|
2014-01-31 06:10:36 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
resources :posts do
|
2013-12-24 07:50:36 +08:00
|
|
|
put "bookmark"
|
|
|
|
get "replies"
|
|
|
|
get "revisions/:revision" => "posts#revisions"
|
|
|
|
put "recover"
|
2013-02-06 03:16:51 +08:00
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
delete "destroy_many"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "p/:post_id/:user_id" => "posts#short_link"
|
2013-04-24 16:05:35 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
resources :notifications
|
2013-02-12 14:51:44 +08:00
|
|
|
|
2013-07-02 02:00:06 +08: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-06 03:16:51 +08:00
|
|
|
|
|
|
|
resources :clicks do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "track"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "excerpt" => "excerpt#show"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
resources :post_actions do
|
|
|
|
collection do
|
2013-12-24 07:50:36 +08:00
|
|
|
get "users"
|
|
|
|
post "clear_flags"
|
2013-02-06 03:16:51 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
resources :user_actions
|
|
|
|
|
2014-03-05 20:52:20 +08:00
|
|
|
resources :user_badges, only: [:index, :create, :destroy]
|
|
|
|
|
2014-01-14 08:02:14 +08:00
|
|
|
# We've renamed popular to latest. If people access it we want a permanent redirect.
|
|
|
|
get "popular" => "list#popular_redirect"
|
|
|
|
get "popular/more" => "list#popular_redirect"
|
|
|
|
|
2013-07-02 13:21:26 +08:00
|
|
|
resources :categories, :except => :show
|
2013-12-24 07:50:36 +08:00
|
|
|
get "category/:id/show" => "categories#show"
|
2014-01-18 06:52:06 +08:00
|
|
|
post "category/:category_id/move" => "categories#move"
|
|
|
|
get "category/:category.rss" => "list#category_feed", format: :rss
|
|
|
|
get "category/:parent_category/:category.rss" => "list#category_feed", format: :rss
|
2014-02-03 23:08:00 +08:00
|
|
|
get "category/:category" => "list#category_latest"
|
|
|
|
get "category/:category/none" => "list#category_none_latest"
|
|
|
|
get "category/:parent_category/:category" => "list#parent_category_category_latest"
|
2014-01-18 06:52:06 +08:00
|
|
|
|
|
|
|
get "top" => "list#top"
|
2014-02-03 23:08:00 +08:00
|
|
|
get "category/:category/l/top" => "list#category_top", as: "category_top"
|
|
|
|
get "category/:category/none/l/top" => "list#category_none_top", as: "category_none_top"
|
|
|
|
get "category/:parent_category/:category/l/top" => "list#parent_category_category_top", as: "parent_category_category_top"
|
2014-01-14 08:02:14 +08:00
|
|
|
|
|
|
|
TopTopic.periods.each do |period|
|
|
|
|
get "top/#{period}" => "list#top_#{period}"
|
2014-02-03 23:08:00 +08:00
|
|
|
get "category/:category/l/top/#{period}" => "list#category_top_#{period}", as: "category_top_#{period}"
|
|
|
|
get "category/:category/none/l/top/#{period}" => "list#category_none_top_#{period}", as: "category_none_top_#{period}"
|
|
|
|
get "category/:parent_category/:category/l/top/#{period}" => "list#parent_category_category_top_#{period}", as: "parent_category_category_top_#{period}"
|
2014-01-14 08:02:14 +08:00
|
|
|
end
|
2013-03-28 04:17:49 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
Discourse.anonymous_filters.each do |filter|
|
2013-10-12 00:35:12 +08:00
|
|
|
get "#{filter}.rss" => "list##{filter}_feed", format: :rss
|
2013-07-06 04:49:06 +08:00
|
|
|
end
|
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
Discourse.filters.each do |filter|
|
2013-03-28 21:01:13 +08:00
|
|
|
get "#{filter}" => "list##{filter}"
|
|
|
|
get "#{filter}/more" => "list##{filter}"
|
2014-02-03 23:08:00 +08:00
|
|
|
get "category/:category/l/#{filter}" => "list#category_#{filter}", as: "category_#{filter}"
|
|
|
|
get "category/:category/l/#{filter}/more" => "list#category_#{filter}"
|
|
|
|
get "category/:category/none/l/#{filter}" => "list#category_none_#{filter}", as: "category_none_#{filter}"
|
|
|
|
get "category/:category/none/l/#{filter}/more" => "list#category_none_#{filter}"
|
|
|
|
get "category/:parent_category/:category/l/#{filter}" => "list#parent_category_category_#{filter}", as: "parent_category_category_#{filter}"
|
|
|
|
get "category/:parent_category/:category/l/#{filter}/more" => "list#parent_category_category_#{filter}"
|
2013-03-28 21:01:13 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "search" => "search#query"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
# Topics resource
|
2013-12-24 07:50:36 +08:00
|
|
|
get "t/:id" => "topics#show"
|
|
|
|
post "t" => "topics#create"
|
2014-01-14 08:02:14 +08:00
|
|
|
put "t/:id" => "topics#update"
|
|
|
|
delete "t/:id" => "topics#destroy"
|
2014-01-30 04:48:52 +08:00
|
|
|
put "topics/bulk"
|
2014-03-04 04:46:38 +08:00
|
|
|
put "topics/reset-new" => 'topics#reset_new'
|
2013-12-24 07:50:36 +08:00
|
|
|
post "topics/timings"
|
|
|
|
get "topics/similar_to"
|
|
|
|
get "topics/created-by/:username" => "list#topics_by", as: "topics_by", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "topics/private-messages/:username" => "list#private_messages", as: "topics_private_messages", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "topics/private-messages-sent/:username" => "list#private_messages_sent", as: "topics_private_messages_sent", constraints: {username: USERNAME_ROUTE_FORMAT}
|
|
|
|
get "topics/private-messages-unread/:username" => "list#private_messages_unread", as: "topics_private_messages_unread", constraints: {username: USERNAME_ROUTE_FORMAT}
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2014-01-04 01:52:24 +08:00
|
|
|
get 'embed/comments' => 'embed#comments'
|
2014-01-14 01:47:24 +08:00
|
|
|
get 'embed/count' => 'embed#count'
|
2014-01-01 03:37:43 +08:00
|
|
|
|
2013-02-15 03:11:13 +08:00
|
|
|
# Topic routes
|
2013-12-24 07:50:36 +08:00
|
|
|
get "t/:slug/: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/:topic_id/wordpress" => "topics#wordpress", constraints: {topic_id: /\d+/}
|
|
|
|
get "t/:slug/:topic_id/summary" => "topics#show", defaults: {summary: true}, constraints: {topic_id: /\d+/, post_number: /\d+/}
|
|
|
|
get "t/:topic_id/summary" => "topics#show", constraints: {topic_id: /\d+/, post_number: /\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/mute" => "topics#mute", constraints: {topic_id: /\d+/}
|
|
|
|
put "t/:topic_id/unmute" => "topics#unmute", constraints: {topic_id: /\d+/}
|
|
|
|
put "t/:topic_id/autoclose" => "topics#autoclose", constraints: {topic_id: /\d+/}
|
|
|
|
put "t/:topic_id/remove-allowed-user" => "topics#remove_allowed_user", 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+/}
|
2014-01-31 04:23:42 +08:00
|
|
|
get "t/:topic_id/last" => "topics#show", post_number: 99999999, constraints: {topic_id: /\d+/}
|
2013-12-24 07:50:36 +08:00
|
|
|
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+/}
|
2014-01-31 04:23:42 +08:00
|
|
|
get "t/:slug/:topic_id/last" => "topics#show", post_number: 99999999, constraints: {topic_id: /\d+/}
|
2013-12-24 07:50:36 +08:00
|
|
|
get "t/:topic_id/posts" => "topics#posts", constraints: {topic_id: /\d+/}
|
|
|
|
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/move-posts" => "topics#move_posts", constraints: {topic_id: /\d+/}
|
|
|
|
post "t/:topic_id/merge-topic" => "topics#merge_topic", constraints: {topic_id: /\d+/}
|
|
|
|
delete "t/:topic_id/timings" => "topics#destroy_timings", constraints: {topic_id: /\d+/}
|
|
|
|
|
|
|
|
post "t/:topic_id/notifications" => "topics#set_notifications" , constraints: {topic_id: /\d+/}
|
|
|
|
|
2014-04-02 05:45:16 +08:00
|
|
|
get "/posts/:id/expand-embed" => "posts#expand_embed"
|
2013-12-24 07:50:36 +08:00
|
|
|
get "raw/:topic_id(/:post_number)" => "posts#markdown"
|
2013-04-30 14:29:57 +08:00
|
|
|
|
2013-02-06 03:16:51 +08:00
|
|
|
resources :invites
|
2013-12-24 07:50:36 +08:00
|
|
|
delete "invites" => "invites#destroy"
|
2013-02-15 03:11:13 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "onebox" => "onebox#show"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "error" => "forums#error"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "message-bus/poll" => "message_bus#poll"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "draft" => "draft#show"
|
|
|
|
post "draft" => "draft#update"
|
|
|
|
delete "draft" => "draft#destroy"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
get "robots.txt" => "robots_txt#index"
|
2013-02-11 08:02:57 +08:00
|
|
|
|
2013-12-24 07:50:36 +08:00
|
|
|
Discourse.filters.each do |filter|
|
2013-07-02 02:00:06 +08:00
|
|
|
root to: "list##{filter}", constraints: HomePageConstraint.new("#{filter}"), :as => "list_#{filter}"
|
2013-03-28 21:01:13 +08:00
|
|
|
end
|
|
|
|
# special case for categories
|
2013-07-02 02:00:06 +08:00
|
|
|
root to: "categories#index", constraints: HomePageConstraint.new("categories"), :as => "categories_index"
|
2014-01-04 02:36:49 +08:00
|
|
|
# special case for top
|
2014-01-18 06:52:06 +08:00
|
|
|
root to: "list#top", constraints: HomePageConstraint.new("top"), :as => "top_lists"
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
end
|