impress/config/routes.rb

110 lines
4 KiB
Ruby
Raw Normal View History

2013-03-05 13:10:25 -08:00
OpenneoImpressItems::Application.routes.draw do
2010-11-05 15:45:05 -07:00
root :to => 'outfits#new'
# Login and account management!
devise_for :auth_users, path: "users", skip: [:registrations]
resources :auth_users, only: [:new, :create, :update]
get '/users/edit', to: 'auth_users#edit', as: 'edit_auth_user'
# The outfit editor!
# TODO: It's a bit silly that outfits/new points to outfits#edit.
# Should we refactor the controller/view structure here?
get '/outfits/new', to: 'outfits#edit', as: :wardrobe
get '/wardrobe' => redirect('/outfits/new')
get '/start/:color_name/:species_name' => 'outfits#start'
# The outfits users have created!
resources :outfits, :only => [:show, :create, :update, :destroy]
get '/your-outfits', to: 'outfits#index', as: :current_user_outfits
get '/users/current-user/outfits', to: redirect('/your-outfits')
# Our customization data! Both the item pages, and JSON API endpoints.
2010-11-06 10:07:12 -07:00
resources :items, :only => [:index, :show] do
resources :trades, path: 'trades/:type', controller: 'item_trades',
only: [:index], constraints: {type: /offering|seeking/}
resources :appearances, controller: 'item_appearances', only: [:index]
2010-11-05 15:45:05 -07:00
collection do
get "sources/:ids", action: :sources
2010-11-05 15:45:05 -07:00
end
end
resources :species, only: [] do
resources :colors, only: [] do
get :pet_type, to: 'pet_types#show'
end
resources :alt_styles, path: 'alt-styles', only: [:index]
end
resources :alt_styles, path: 'alt-styles', only: [:index]
resources :swf_assets, path: 'swf-assets', only: [:show]
resources :pet_types, path: 'rainbow-pool', param: "name",
only: [:index, :show] do
resources :pet_states, only: [:show], path: "forms"
end
# Loading and modeling pets!
post '/pets/load' => 'pets#load', :as => :load_pet
get '/modeling' => 'pets#bulk', :as => :bulk_pets
# Contributions to our modeling database!
resources :contributions, :only => [:index]
get 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
get 'users/top_contributors' => redirect('/users/top-contributors')
# User resources, like their item lists!
2011-08-05 08:28:11 -07:00
resources :users, :path => 'user', :only => [:index, :update] do
2010-11-05 15:45:05 -07:00
resources :contributions, :only => [:index]
resources :closet_hangers, :only => [:index, :update, :destroy], :path => 'closet' do
2011-07-30 23:48:16 -07:00
collection do
get :petpage
put :update
delete :destroy
2011-07-30 23:48:16 -07:00
end
end
2011-07-29 07:52:04 -07:00
resources :closet_lists, :only => [:new, :create, :edit, :update, :destroy], :path => 'closet/lists'
resources :items, :only => [] do
resources :closet_hangers, :only => [:create] do
collection do
put :update_quantities
end
end
end
resources :neopets_connections, path: 'neopets-connections',
only: [:create, :destroy]
resource :neopass_connection, path: "neopass-connection", only: [:destroy]
2010-11-05 15:45:05 -07:00
end
get 'users/current-user/closet' => 'closet_hangers#index', :as => :your_items
2011-07-12 17:51:43 -07:00
# Importing users' owned items from Neopets.com!
scope 'import' do
resources :neopets_page_import_tasks, only: [:new, :create],
path: ':page_type/pages/:expected_index'
end
# Donation campaign stuff!
scope module: "fundraising", as: "fundraising" do
resources :donations, only: [:create, :show, :update] do
collection do
resources :donation_features, path: 'features', only: [:index]
end
2014-09-10 13:38:26 -07:00
end
resources :campaigns, only: [:show], path: '/donate/campaigns'
2014-09-10 13:38:26 -07:00
end
get '/donate' => 'fundraising/campaigns#current', as: :donate
2015-08-05 16:26:12 -07:00
2024-03-12 17:58:44 -07:00
# About pages!
get '/terms', to: "about#terms", as: :terms
get '/privacy',
to: redirect(Rails.configuration.impress_2020_origin + "/privacy")
get '/about/neopass',
to: redirect('https://blog.openneo.net/2024/03/13/neopass-for-dti.html')
2011-05-20 17:49:48 -07:00
# Other useful lil things!
get '/sitemap.xml' => 'sitemap#index', :as => :sitemap, :format => :xml
get '/robots.txt' => 'sitemap#robots', :as => :robots, :format => :text
post '/locales/choose' => 'locales#choose', :as => :choose_locale
end