diff options
| author | Michel Etienne | 2014-11-04 15:02:14 +0100 |
|---|---|---|
| committer | Michel Etienne | 2014-11-04 15:02:14 +0100 |
| commit | db89e7c94cbf7fdea3d46dcf37ac643075f79000 (patch) | |
| tree | b7903021b2058d31860db2fc351f6fe006c578db /config | |
| parent | 6841cc3d36990a0ed12c78f371112af9b3590f72 (diff) | |
| parent | c9fd03422743d3d716bbd7199184c035c1b0d4c9 (diff) | |
| download | chouette-core-db89e7c94cbf7fdea3d46dcf37ac643075f79000.tar.bz2 | |
Merge branch 'sismo' of github.com:afimb/chouette2 into sismo
Diffstat (limited to 'config')
| -rw-r--r-- | config/environments/development.rb | 4 | ||||
| -rw-r--r-- | config/environments/production.rb | 3 | ||||
| -rw-r--r-- | config/initializers/devise.rb | 22 | ||||
| -rw-r--r-- | config/locales/devise.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/devise.fr.yml | 1 | ||||
| -rw-r--r-- | config/routes.rb | 27 |
6 files changed, 31 insertions, 27 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb index 2c028ac58..0d33ac03c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -52,11 +52,13 @@ ChouetteIhm::Application.configure do config.company_name = "afimb" config.company_theme = "#61970b" # AFIMB color config.company_contact = "http://www.chouette.mobi/contact-support/" - + config.accept_user_creation = true + # CITYWAY # config.company_name = "cityway" # config.company_theme = "#32adb0" # config.company_contact = "http://www.cityway.fr/contact/?rub_code=14" + # config.accept_user_creation = false # file to data for demo config.demo_data = "tmp/demo.zip" diff --git a/config/environments/production.rb b/config/environments/production.rb index 594287bea..de408f29f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -135,12 +135,13 @@ ChouetteIhm::Application.configure do config.company_name = "afimb" config.company_theme = "#61970b" # AFIMB color config.company_contact = "http://www.chouette.mobi/contact-support/" + config.accept_user_creation = true # CITYWAY # config.company_name = "cityway" # config.company_theme = "#32adb0" # config.company_contact = "http://www.cityway.fr/contact/?rub_code=14" - + # config.accept_user_creation = false # file to data for demo config.demo_data = ENV['CHOUETTE_DEMO_DATA'].nil? ? "/path/to/demo.zip" : ENV['CHOUETTE_DEMO_DATA'] diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index ef5c89fbf..4aa6ef80d 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -242,25 +242,3 @@ Devise.setup do |config| # manager.default_strategies(:scope => :user).unshift :some_external_strategy # end end - -# class Devise::FailureApp -# def return_to_root_path? -# root_path == session["#{scope}_return_to"] -# end -# def redirect -# store_location! -# if flash[:timedout] && flash[:alert] -# flash.keep(:timedout) -# flash.keep(:alert) -# else -# Rails.logger.debug "A" * 30 -# Rails.logger.debug i18n_message -# Rails.logger.debug redirect_url -# Rails.logger.debug scope -# Rails.logger.debug root_path -# Rails.logger.debug session["#{scope}_return_to"] -# flash[:alert] = i18n_message unless return_to_root_path? -# end -# redirect_to redirect_url -# end -# end diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 4fb3980f1..0a42a021d 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -36,6 +36,7 @@ en: helpers: label: user: + organisation_name: "Organisation name" name: Full name password: Password password_confirmation: Password confirmation diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index b1a9a743a..d3a60d9a0 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -40,6 +40,7 @@ fr: helpers: label: user: + organisation_name: "Nom de l'organisation" name: Nom complet password: Mot de passe password_confirmation: Confirmation du mot de passe diff --git a/config/routes.rb b/config/routes.rb index 827ee97a1..f629a963f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,9 +1,31 @@ ChouetteIhm::Application.routes.draw do devise_scope :users do - match "/users/sign_up" => "subscriptions#new" + #match "/users/sign_up" => "subscriptions#new", end - devise_for :users + devise_for :users, :controllers => { :registrations => "registrations" } + + devise_scope :user do + authenticated :user do + root :to => 'referentials#index' + end + + unauthenticated do + root :to => 'devise/sessions#new' + end + end + + # Rails 4 syntax + # devise_for :users + # devise_scope :user do + # authenticated :user do + # root :to => 'referentials#index', as: :authenticated_root + # end + # unauthenticated :user do + # root :to => 'devise/registrations#new', as: :unauthenticated_root + # end + # end + namespace :api do namespace :v1 do @@ -188,5 +210,4 @@ ChouetteIhm::Application.routes.draw do match '/422', :to => 'errors#server_error' match '/500', :to => 'errors#server_error' - root :to => 'referentials#index' end |
