clean up routes.rb a bit
This commit is contained in:
parent
5934616422
commit
7e84747a52
1 changed files with 30 additions and 32 deletions
|
|
@ -4,20 +4,19 @@
|
|||
|
||||
Diaspora::Application.routes.draw do
|
||||
|
||||
|
||||
# Posting and Reading
|
||||
|
||||
resources :aspects do
|
||||
put 'toggle_contact_visibility' => :toggle_contact_visibility
|
||||
put :toggle_contact_visibility
|
||||
end
|
||||
|
||||
resources :status_messages, :only => [:new, :create] do
|
||||
end
|
||||
resources :status_messages, :only => [:new, :create]
|
||||
|
||||
resources :posts, :only => [:show, :destroy] do
|
||||
resources :likes, :only => [:create, :destroy, :index]
|
||||
resources :comments, :only => [:create, :destroy, :index]
|
||||
end
|
||||
get 'p/:id' => 'publics#post', :as => 'public_post'
|
||||
|
||||
# roll up likes into a nested resource above
|
||||
resources :comments, :only => [:create, :destroy] do
|
||||
|
|
@ -26,10 +25,9 @@ Diaspora::Application.routes.draw do
|
|||
|
||||
|
||||
get 'bookmarklet' => 'status_messages#bookmarklet'
|
||||
get 'p/:id' => 'publics#post', :as => 'public_post'
|
||||
|
||||
resources :photos, :except => [:index] do
|
||||
put 'make_profile_photo' => :make_profile_photo
|
||||
put :make_profile_photo
|
||||
end
|
||||
|
||||
# ActivityStreams routes
|
||||
|
|
@ -43,16 +41,22 @@ Diaspora::Application.routes.draw do
|
|||
end
|
||||
|
||||
resources :notifications, :only => [:index, :update] do
|
||||
get 'read_all' => :read_all, :on => :collection
|
||||
get :read_all, :on => :collection
|
||||
end
|
||||
|
||||
resources :tags, :only => [:index]
|
||||
post "/tags/:name/tag_followings" => "tag_followings#create", :as => 'tag_tag_followings'
|
||||
delete "/tags/:name/tag_followings" => "tag_followings#destroy"
|
||||
|
||||
scope "tags/:name" do
|
||||
post "tag_followings" => "tag_followings#create", :as => 'tag_tag_followings'
|
||||
delete "tag_followings" => "tag_followings#destroy"
|
||||
end
|
||||
get 'tags/:name' => 'tags#show', :as => 'tag'
|
||||
|
||||
resources :apps, :only => [:show]
|
||||
|
||||
#Cubbies info page
|
||||
resource :token, :only => :show
|
||||
|
||||
|
||||
# Users and people
|
||||
|
||||
resource :user, :only => [:edit, :update, :destroy], :shallow => true do
|
||||
|
|
@ -60,7 +64,6 @@ Diaspora::Application.routes.draw do
|
|||
get :export_photos
|
||||
end
|
||||
|
||||
|
||||
controller :users do
|
||||
get 'public/:username' => :public, :as => 'users_public'
|
||||
match 'getting_started' => :getting_started, :as => 'getting_started'
|
||||
|
|
@ -77,17 +80,14 @@ Diaspora::Application.routes.draw do
|
|||
:invitations => "invitations"} do
|
||||
get 'invitations/resend/:id' => 'invitations#resend', :as => 'invitation_resend'
|
||||
end
|
||||
|
||||
#Cubbies info page
|
||||
resource :token, :only => :show
|
||||
|
||||
|
||||
get 'login' => redirect('/users/sign_in')
|
||||
|
||||
scope 'admins', :controller => :admins do
|
||||
match 'user_search' => :user_search
|
||||
get 'admin_inviter' => :admin_inviter
|
||||
get 'add_invites' => :add_invites, :as => 'add_invites'
|
||||
get 'stats' => :stats, :as => 'pod_stats'
|
||||
match :user_search
|
||||
get :admin_inviter
|
||||
get :add_invites, :as => 'add_invites'
|
||||
get :stats, :as => 'pod_stats'
|
||||
end
|
||||
|
||||
resource :profile
|
||||
|
|
@ -98,21 +98,17 @@ Diaspora::Application.routes.draw do
|
|||
resources :aspect_memberships, :only => [:destroy, :create, :update]
|
||||
resources :post_visibilities, :only => [:update]
|
||||
|
||||
|
||||
resources :people, :except => [:edit, :update] do
|
||||
resources :status_messages
|
||||
resources :photos
|
||||
get :contacts
|
||||
get "aspect_membership_button" => :aspect_membership_dropdown, :as => "aspect_membership_button"
|
||||
collection do
|
||||
post 'by_handle' => :retrieve_remote, :as => 'person_by_handle'
|
||||
get :tag_index
|
||||
end
|
||||
end
|
||||
|
||||
get "people/:id/aspect_membership_button" => "people#aspect_membership_dropdown", :as => "aspect_membership_button"
|
||||
|
||||
|
||||
|
||||
|
||||
# Federation
|
||||
|
||||
|
|
@ -127,17 +123,19 @@ Diaspora::Application.routes.draw do
|
|||
|
||||
# External
|
||||
|
||||
|
||||
get "/oauth/authorize" => "authorizations#new"
|
||||
post "/oauth/authorize" => "authorizations#create"
|
||||
|
||||
post "/oauth/token" => "authorizations#token"
|
||||
resources :authorizations, :only => [:index, :destroy]
|
||||
scope "/oauth", :controller => :authorizations, :as => "oauth" do
|
||||
get "authorize" => :new
|
||||
post "authorize" => :create
|
||||
post :token
|
||||
end
|
||||
|
||||
resources :services, :only => [:index, :destroy]
|
||||
controller :services do
|
||||
match '/auth/:provider/callback' => :create
|
||||
match '/auth/failure' => :failure
|
||||
scope "/auth", :as => "auth" do
|
||||
match ':provider/callback' => :create
|
||||
match :failure
|
||||
end
|
||||
scope 'services' do
|
||||
match 'inviter/:provider' => :inviter, :as => 'service_inviter'
|
||||
match 'finder/:provider' => :finder, :as => 'friend_finder'
|
||||
|
|
@ -145,7 +143,7 @@ Diaspora::Application.routes.draw do
|
|||
end
|
||||
|
||||
scope 'api/v0', :controller => :apis do
|
||||
get 'me' => :me
|
||||
get :me
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue