routes.rb 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. Actioncenter::Application.routes.draw do
  2. get "robots.txt", controller: :robots, action: :show, format: 'text'
  3. get "/heartbeat", to: "robots#heartbeat"
  4. # Root - Redundant - TODO - refactor
  5. get "welcome/index"
  6. root 'welcome#index'
  7. # EFF TOOLS (Call, Share, Petition) - External Reusable Services
  8. post "tools/call"
  9. post "tools/petition"
  10. post "tools/tweet"
  11. post "tools/email"
  12. post "tools/message-congress"
  13. get "tools/reps"
  14. get "tools/reps_raw"
  15. get "tools/social_buttons_count"
  16. get "smarty_streets/:action", controller: :smarty_streets
  17. get "petition/:id/recent_signatures", :to => "petition#recent_signatures", :format => 'json'
  18. # Handle notifications from Amazon SES
  19. post "bounce/:amazon_authorize_key", :to => "sns#bounce", :format => 'json'
  20. post "complaint/:amazon_authorize_key", :to => "sns#complaint", :format => 'json'
  21. get "ahoy/visit"
  22. # EFF Resources
  23. devise_for :users, path: '', path_names: {sign_in: 'login',
  24. sign_out: 'logout',
  25. sign_up: 'register'},
  26. controllers: {sessions: 'sessions', registrations: 'registrations'}
  27. devise_scope :user do
  28. get "/sessions/password_reset" => "sessions#password_reset"
  29. end
  30. resource :user, path: 'account', only: [:show, :edit, :update] do
  31. member do
  32. delete :clear_activity
  33. end
  34. end
  35. # override devise's user_root (defaults to site root)
  36. get 'account', to: 'users#show', as: 'user_root'
  37. resources :action_page, path: :action, only: [:index, :show] do
  38. member do
  39. get :embed_iframe
  40. get :signature_count
  41. get :filter
  42. get ':institution_id' => :show_by_institution, as: :institution
  43. end
  44. collection do
  45. get :embed
  46. end
  47. end
  48. resources :subscriptions, only: [:create, :edit]
  49. resources :partners, only: [:show, :edit, :update] do
  50. member do
  51. get :csv
  52. get :presentable_csv
  53. post 'users' => 'partners#add_user', as: :add_user
  54. delete 'users/:user_id' => 'partners#remove_user', as: :remove_user
  55. end
  56. end
  57. namespace :admin do
  58. resources :source_files, :only => [:index, :create, :destroy], :controller => 's3_uploads' do
  59. get :generate_key, :on => :collection
  60. end
  61. get 'mailer/:action/:id' => 'mailer#:action'
  62. resources :petitions, only: :show do
  63. member do
  64. get :csv
  65. get :presentable_csv
  66. delete "signatures" => "petitions#destroy_signatures", as: :signatures
  67. end
  68. end
  69. resources :congress_message_campaigns, only: :none do
  70. member do
  71. get :date_tabulation
  72. get :congress_tabulation
  73. get "staffer_report/:bioguide_id", to: "congress_message_campaigns#staffer_report", as: :staffer_report
  74. end
  75. end
  76. resources :em
  77. resources :partners, except: [:show, :edit, :update]
  78. resources :topic_categories, :topic_sets, :topics
  79. resources :action_pages do
  80. get :publish
  81. get :unpublish
  82. get :destroy
  83. post 'update_featured_pages', :on => :collection
  84. patch :preview
  85. resources :affiliation_types, only: [:index, :new, :create, :destroy]
  86. resources :institutions, except: [:show, :edit, :update] do
  87. match :import, via: :post, on: :collection
  88. match :index, via: :delete, on: :collection, action: :destroy_all
  89. end
  90. end
  91. resources :users, only: [:index, :update]
  92. get "images", to: "images#index"
  93. end
  94. resources :congress, only: [:index] do
  95. collection do
  96. get :search
  97. end
  98. end
  99. end