seven1m / onebody

OneBody is free, open-source, web-based social networking and online directory software for churches.

This URL has Read+Write access

onebody / config / routes.rb
100644 89 lines (72 sloc) 2.994 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
ActionController::Routing::Routes.draw do |map|
  
  PHOTO_SIZE_METHODS = {:tn => :get, :small => :get, :medium => :get, :large => :get}
 
  map.home '', :controller => 'pages', :action => 'show_for_public'
  
  map.resource :account, :member => {:verify_code => :any, :select => :any}
  
  map.resources :people,
    :collection => {:import => :any, :hashify => :get, :schema => :get, :batch => :post} do |people|
    people.resources :groups
    people.resources :pictures
    people.resources :friends, :collection => {:reorder => :post}
    people.resources :remote_accounts, :member => {:sync => :post}
    people.resource :account, :member => {:verify_code => :any, :select => :any}
    people.resource :sync
    people.resource :privacy
    people.resource :blog
    people.resource :wall, :member => {:with => :get}
    people.resource :photo, :member => PHOTO_SIZE_METHODS
  end
  
  map.resources :families,
    :collection => {:hashify => :get, :schema => :get, :batch => :post},
    :member => {:reorder => :post} do |families|
    families.resource :photo, :member => PHOTO_SIZE_METHODS
  end
  
  map.resources :groups do |groups|
    groups.resources :memberships, :collection => {:batch => :any}
    groups.resources :notes
    groups.resources :messages
    groups.resources :prayer_requests
    groups.resources :attendance, :collection => {:batch => :post}
    groups.resource :photo, :member => PHOTO_SIZE_METHODS
  end
  
  map.resources :albums do |albums|
    albums.resources :pictures, :member => {:next => :get, :prev => :get} do |pictures|
      pictures.resource :photo, :member => PHOTO_SIZE_METHODS
    end
  end
 
  map.resources :recipes do |recipes|
    recipes.resource :photo, :member => PHOTO_SIZE_METHODS
  end
 
  map.resources :messages do |messages|
    messages.resources :attachments
  end
  
  map.resources :verses
  map.resources :publications
  map.resources :notes
  map.resources :shares
  map.resources :tags
  map.resources :news
  map.resources :comments
  map.resources :attachments, :member => {:get => :get}
  
  map.resource :session
  map.resource :search, :member => {:opensearch => :get}
  map.resource :printable_directory
  map.resource :feed
  map.resource :privacy
  
  map.resources :pages, :as => 'pages/admin' do |pages|
    pages.resources :attachments
  end
  
  map.with_options :controller => 'pages' do |pages|
    pages.page_for_public 'pages/*path', :action => 'show_for_public', :conditions => {:method => :get}
  end
 
  map.admin 'admin', :controller => 'administration/dashboards'
  map.namespace :administration, :path_prefix => 'admin' do |admin|
    admin.resource :api_key
    admin.resources :updates
    admin.resources :admins
    admin.resources :membership_requests
    admin.resources :log_items, :collection => {:batch => :put}
    admin.resources :settings, :collection => {:batch => :put}
    admin.resources :scheduled_tasks
  end
  
  ActionController::Routing::Routes.draw_plugin_routes rescue nil
  
end