campfire_logic 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Capfile +4 -0
- data/Gemfile +29 -0
- data/Gemfile.local +27 -0
- data/README.rdoc +17 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/directory_controller.rb +65 -0
- data/app/controllers/locations_controller.rb +65 -0
- data/app/controllers/services_controller.rb +46 -0
- data/app/helpers/application_helper.rb +27 -0
- data/app/models/google_maps_geocoder.rb +108 -0
- data/app/models/locale.rb +204 -0
- data/app/models/location.rb +216 -0
- data/app/models/location_import.rb +48 -0
- data/app/models/service.rb +27 -0
- data/app/models/zip_code.rb +48 -0
- data/app/models/zip_code_import.rb +19 -0
- data/app/views/directory/_search_form.html.erb +4 -0
- data/app/views/directory/_show_children.html.erb +29 -0
- data/app/views/directory/_show_location.html.erb +14 -0
- data/app/views/directory/search.html.erb +31 -0
- data/app/views/directory/show.html.erb +32 -0
- data/app/views/layouts/application.html.erb +49 -0
- data/app/views/locations/_form.html.erb +69 -0
- data/app/views/locations/edit.html.erb +3 -0
- data/app/views/locations/export.erb +4 -0
- data/app/views/locations/import.html.erb +13 -0
- data/app/views/locations/index.html.erb +37 -0
- data/app/views/locations/new.html.erb +3 -0
- data/app/views/locations/show.html.erb +70 -0
- data/app/views/services/_form.html.erb +29 -0
- data/app/views/services/edit.html.erb +3 -0
- data/app/views/services/index.html.erb +25 -0
- data/app/views/services/new.html.erb +3 -0
- data/app/views/services/show.html.erb +15 -0
- data/app/views/shared/_location.html.erb +18 -0
- data/app/views/shared/_map.html.erb +2 -0
- data/app/views/shared/_nav_tabs.html.erb +5 -0
- data/autotest/discover.rb +1 -0
- data/campfire_logic.gemspec +208 -0
- data/config/application.rb +44 -0
- data/config/boot.rb +13 -0
- data/config/cucumber.yml +10 -0
- data/config/deploy.rb +40 -0
- data/config/environment.rb +6 -0
- data/config/environments/development.rb +28 -0
- data/config/environments/production.rb +49 -0
- data/config/environments/test.rb +35 -0
- data/config/initializers/campfire_logic.rb +3 -0
- data/config/initializers/metric_fu.rb +9 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/locales/en.yml +5 -0
- data/config/mongoid.yml +25 -0
- data/config/routes.rb +96 -0
- data/config.ru +4 -0
- data/db/seeds.rb +5 -0
- data/db/zip_codes.txt +42742 -0
- data/doc/google_maps_response.rb +56 -0
- data/features/admin_manages_locations.feature +10 -0
- data/features/customer_browses_directory.feature +25 -0
- data/features/customer_searches_directory.feature +29 -0
- data/features/step_definitions/directory_steps.rb +22 -0
- data/features/step_definitions/location_steps.rb +10 -0
- data/features/step_definitions/web_steps.rb +211 -0
- data/features/support/env.rb +31 -0
- data/features/support/paths.rb +33 -0
- data/features/support/selectors.rb +39 -0
- data/init.rb +1 -0
- data/lib/campfire_logic/engine.rb +7 -0
- data/lib/campfire_logic/railtie.rb +10 -0
- data/lib/campfire_logic.rb +31 -0
- data/lib/tasks/campfire_logic.rake +7 -0
- data/lib/tasks/cucumber.rake +71 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/favicon.ico +0 -0
- data/public/images/icons/collapsed.gif +0 -0
- data/public/images/icons/delete.png +0 -0
- data/public/images/icons/drag.png +0 -0
- data/public/images/icons/edit.png +0 -0
- data/public/images/icons/expanded.gif +0 -0
- data/public/images/icons/help_icon.png +0 -0
- data/public/images/icons/link_icon.png +0 -0
- data/public/images/icons/move.png +0 -0
- data/public/images/icons/move_white.png +0 -0
- data/public/images/icons/note.png +0 -0
- data/public/images/icons/note_white.png +0 -0
- data/public/images/icons/notification_icon_sprite.png +0 -0
- data/public/images/icons/spinner.gif +0 -0
- data/public/images/icons/view.png +0 -0
- data/public/images/icons/warning.png +0 -0
- data/public/images/icons/warning_2.png +0 -0
- data/public/images/icons/warning_box.png +0 -0
- data/public/images/icons/warning_icon.png +0 -0
- data/public/images/icons/warning_white.png +0 -0
- data/public/images/layout/arrow_asc.png +0 -0
- data/public/images/layout/arrow_desc.png +0 -0
- data/public/images/layout/black_bar.png +0 -0
- data/public/images/layout/branding.png +0 -0
- data/public/images/layout/button_bg.png +0 -0
- data/public/images/layout/content_left_bg.png +0 -0
- data/public/images/layout/content_right_bg.png +0 -0
- data/public/images/layout/footer_bg.png +0 -0
- data/public/images/layout/h2_bg.png +0 -0
- data/public/images/layout/h2_bg_for_table.png +0 -0
- data/public/images/layout/header_bg_grey.png +0 -0
- data/public/images/layout/header_bg_purple.png +0 -0
- data/public/images/layout/legend_bg.png +0 -0
- data/public/images/layout/text_field_bg.jpg +0 -0
- data/public/images/layout/text_field_error_bg.png +0 -0
- data/public/images/layout/th_bg.png +0 -0
- data/public/images/layout/th_bg_selected.png +0 -0
- data/public/images/rails.png +0 -0
- data/public/index.html +9 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +965 -0
- data/public/javascripts/dragdrop.js +974 -0
- data/public/javascripts/effects.js +1123 -0
- data/public/javascripts/prototype.js +6001 -0
- data/public/javascripts/rails.js +175 -0
- data/public/robots.txt +6 -0
- data/public/sample-locations.xls +1 -0
- data/public/stylesheets/.gitkeep +0 -0
- data/public/stylesheets/application.css +682 -0
- data/public/stylesheets/core.css +1147 -0
- data/public/stylesheets/core_ie.css +52 -0
- data/public/stylesheets/csshover3.htc +14 -0
- data/script/cucumber +10 -0
- data/script/rails +6 -0
- data/spec/controllers/directory_controller_spec.rb +11 -0
- data/spec/controllers/services_controller_spec.rb +62 -0
- data/spec/models/google_maps_geocoder_spec.rb +62 -0
- data/spec/models/locale_spec.rb +64 -0
- data/spec/models/location_import_spec.rb +41 -0
- data/spec/models/location_spec.rb +195 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/test-locations.xls +1 -0
- metadata +361 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Rails.application.config.secret_token = '7e7d63cc40339d7c0413b464087c8f33c7811b85adc81916521c2b83848407ef03b446f847b08f124f69cb55d81e2232fb718fa08b906e504eb505477b0e9235'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Rails.application.config.session_store :cookie_store, :key => '_CampfireLogic_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rake db:sessions:create")
|
8
|
+
# Rails.application.config.session_store :active_record_store
|
data/config/mongoid.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
defaults: &defaults
|
2
|
+
host: localhost
|
3
|
+
# slaves:
|
4
|
+
# - host: slave1.local
|
5
|
+
# port: 27018
|
6
|
+
# - host: slave2.local
|
7
|
+
# port: 27019
|
8
|
+
skip_version_check: true
|
9
|
+
|
10
|
+
development:
|
11
|
+
<<: *defaults
|
12
|
+
database: campfire_logic_development
|
13
|
+
|
14
|
+
test:
|
15
|
+
<<: *defaults
|
16
|
+
database: campfire_logic_test
|
17
|
+
|
18
|
+
# set these environment variables on your prod server
|
19
|
+
production:
|
20
|
+
<<: *defaults
|
21
|
+
host: <%= ENV['MONGOID_HOST'] %>
|
22
|
+
port: <%= ENV['MONGOID_PORT'] %>
|
23
|
+
username: <%= ENV['MONGOID_USERNAME'] %>
|
24
|
+
password: <%= ENV['MONGOID_PASSWORD'] %>
|
25
|
+
database: <%= ENV['MONGOID_DATABASE'] %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
# The priority is based upon order of creation:
|
3
|
+
# first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
match "#{CampfireLogic.directory_slug}" => 'directory#show', :as => :directory, :via => 'get'
|
13
|
+
match "#{CampfireLogic.directory_slug}/search" => 'directory#search', :as => :directory_search_root, :via => 'get'
|
14
|
+
match "#{CampfireLogic.directory_slug}/search/:criteria" => 'directory#search', :as => :directory_search, :via => 'get'
|
15
|
+
|
16
|
+
class DirectoryConstraint
|
17
|
+
def initialize; end
|
18
|
+
def matches?(request)
|
19
|
+
!! (request.subdomain =~ /^local/)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
constraints(DirectoryConstraint.new) do
|
24
|
+
root :to => 'directory#show', :via => :get
|
25
|
+
end
|
26
|
+
|
27
|
+
class LocaleConstraint
|
28
|
+
def initialize
|
29
|
+
end
|
30
|
+
|
31
|
+
def matches?(request)
|
32
|
+
!! (request.path =~ /^\/#{CampfireLogic.directory_slug}/)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
constraints(LocaleConstraint.new) do
|
37
|
+
match "#{CampfireLogic.directory_slug}/:country" => 'directory#show', :as => 'directory_show_country', :via => 'get'
|
38
|
+
match "#{CampfireLogic.directory_slug}/:country/:state" => 'directory#show', :as => 'directory_show_state', :via => 'get'
|
39
|
+
match "#{CampfireLogic.directory_slug}/:country/:state/:city" => 'directory#show', :as => 'directory_show_city', :via => 'get'
|
40
|
+
match "#{CampfireLogic.directory_slug}/:country/:state/:city/:location" => 'directory#show', :as => 'directory_show_location', :via => 'get'
|
41
|
+
end
|
42
|
+
|
43
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
44
|
+
# resources :products
|
45
|
+
resources :services
|
46
|
+
|
47
|
+
# Sample resource route with options:
|
48
|
+
# resources :products do
|
49
|
+
# member do
|
50
|
+
# get 'short'
|
51
|
+
# post 'toggle'
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# collection do
|
55
|
+
# get 'sold'
|
56
|
+
# end
|
57
|
+
# end
|
58
|
+
resources :locations do
|
59
|
+
collection do
|
60
|
+
get 'import'
|
61
|
+
get 'export'
|
62
|
+
post 'upload'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Sample resource route with sub-resources:
|
67
|
+
# resources :products do
|
68
|
+
# resources :comments, :sales
|
69
|
+
# resource :seller
|
70
|
+
# end
|
71
|
+
|
72
|
+
# Sample resource route with more complex sub-resources
|
73
|
+
# resources :products do
|
74
|
+
# resources :comments
|
75
|
+
# resources :sales do
|
76
|
+
# get 'recent', :on => :collection
|
77
|
+
# end
|
78
|
+
# end
|
79
|
+
|
80
|
+
# Sample resource route within a namespace:
|
81
|
+
# namespace :admin do
|
82
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
83
|
+
# # (app/controllers/admin/products_controller.rb)
|
84
|
+
# resources :products
|
85
|
+
# end
|
86
|
+
|
87
|
+
# You can have the root of your site routed with "root"
|
88
|
+
# just remember to delete public/index.html.
|
89
|
+
# root :to => "directory#show", :via => 'get'
|
90
|
+
|
91
|
+
# See how all your routes lay out with "rake routes"
|
92
|
+
|
93
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
94
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
95
|
+
# match ':controller(/:action(/:id(.:format)))'
|
96
|
+
end
|
data/config.ru
ADDED