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 122 lines (101 sloc) 4.328 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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 :stream
 
  map.resource :account, :member => {:verify_code => :any, :select => :any}
 
  map.resources :people,
    :collection => {:import => :any, :hashify => :post, :schema => :get, :batch => :post},
    :member => {:favs => :get, :testimony => :get} do |people|
    people.resources :groups
    people.resources :pictures
    people.resources :friends, :collection => {:reorder => :post}
    people.resources :relationships, :collection => {:batch => :post}
    people.resources :remote_accounts, :member => {:sync => :post}
    people.resources :groupies
    people.resources :services
    people.resources :albums
    people.resources :feeds
    people.resources :notes
    people.resources :verses
    people.resources :recipes
    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
    people.resource :calendar
  end
 
  map.resources :families,
    :collection => {:hashify => :post, :schema => :get, :batch => :post, :select => :post},
    :member => {:reorder => :post} do |families|
    families.resources :relationships
    families.resource :photo, :member => PHOTO_SIZE_METHODS
  end
 
  map.resources :groups,
    :collection => {:batch => :any} do |groups|
    groups.resources :memberships, :collection => {:batch => :any}, :has_one => :privacy
    groups.resources :notes
    groups.resources :messages
    groups.resources :prayer_requests
    groups.resources :attendance, :collection => {:batch => :post}
    groups.resources :albums
    groups.resource :photo, :member => PHOTO_SIZE_METHODS
    groups.resource :calendar
  end
  
  map.resources :memberships, :collection => {:batch => :any}
 
  map.resources :service_categories, :collection => {:batch_edit => :get, :close_batch_edit => :get}
 
  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 :pictures
 
  map.resources :recipes do |recipes|
    recipes.resource :photo, :member => PHOTO_SIZE_METHODS
  end
 
  map.resources :messages do |messages|
    messages.resources :attachments
  end
 
  map.resources :feeds
  map.resources :verses
  map.resources :publications
  map.resources :notes
  map.resources :tags
  map.resources :news, :singular => 'news_item'
  map.resources :comments
  map.resources :attachments, :member => {:get => :get}
  map.resources :prayer_requests
  map.resources :external_groups
 
  map.resource :session
  map.resource :search
  map.resource :printable_directory
  map.resource :privacy
  map.resource :tour
 
  map.bible 'bible/:book/:chapter', :controller => 'bibles', :action => 'show',
    :book => 'x', :chapter => 0,
    :requirements => {:book => /[A-Za-z0-9 \+(%20)]+/, :chapter => /\d{1,3}/}
    
  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.resource :admin, :controller => 'administration/dashboards'
  map.namespace :administration, :path_prefix => 'admin' do |admin|
    admin.resource :api_key
    admin.resource :logo
    admin.resources :updates
    admin.resources :emails, :collection => {:batch => :put}
    admin.resources :admins
    admin.resources :membership_requests
    admin.resources :log_items, :collection => {:batch => :put}
    admin.resources :settings, :collection => {:batch => :put, :reload => :put}
    admin.resources :files, :requirements => {:id => /[a-z0-9_]+(\.[a-z0-9_]+)?/}
    admin.resources :attendance, :collection => {:prev => :get, :next => :get}
    admin.resources :syncs, :member => {:create_items => :post}
    admin.resources :deleted_people, :collection => {:batch => :put}
    admin.resources :reports
    admin.resource :theme
  end
 
end