From d31369e508a37a46e57146ef9157b0d140c3b073 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Wed, 7 Jan 2015 21:59:44 +0100 Subject: Fix root_url in mailer by unauthenticated_root_url --- app/views/layouts/mailer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index 387221103..b8dea72e8 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -18,7 +18,7 @@
- Envoyé par <%= link_to root_url, "Chouette" %> + Envoyé par <%= link_to unauthenticated_root_url, "Chouette" %>
-- cgit v1.2.3 From 8a4bb1eb66da1140375071ea153b83946b07aa71 Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Thu, 8 Jan 2015 17:12:27 +0100 Subject: manage unauthenticated_root --- app/helpers/users_helper.rb | 4 ++-- app/views/devise/mailer/invitation_instructions.fr.html.erb | 2 +- config/deploy/production.rb | 4 ++-- config/deploy/unstable.rb | 4 ++-- config/environments/development.rb | 9 +++++---- config/routes.rb | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 0ddea8356..a4347bd18 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -5,10 +5,10 @@ module UsersHelper end def user_default_avatar - return "#{root_url}#{image_path('icons/user.png')}" if Rails.application.config.relative_url_root.blank? + return "#{authenticated_root_url}#{image_path('icons/user.png')}" if Rails.application.config.relative_url_root.blank? relative_url_root = Rails.application.config.relative_url_root.gsub( /\//, '') - "#{root_url}#{image_path('icons/user.png')}". + "#{authenticated_root_url}#{image_path('icons/user.png')}". sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/"). sub( Regexp.new("/#{relative_url_root}//#{relative_url_root}/"), "/#{relative_url_root}/") end diff --git a/app/views/devise/mailer/invitation_instructions.fr.html.erb b/app/views/devise/mailer/invitation_instructions.fr.html.erb index 7ef4e6c99..c932763f2 100644 --- a/app/views/devise/mailer/invitation_instructions.fr.html.erb +++ b/app/views/devise/mailer/invitation_instructions.fr.html.erb @@ -1,6 +1,6 @@

Bonjour <%= @resource.email %>,

-

Ce message est une invitation pour accéder à <%= link_to nil, root_url %>, vous pouvez l'accepter en cliquant sur le lien suivant :

+

Ce message est une invitation pour accéder à <%= link_to nil, unauthenticated_root_url %>, vous pouvez l'accepter en cliquant sur le lien suivant :

<%= link_to "Accepter l'invitation", accept_invitation_url(@resource, :invitation_token => @resource.invitation_token) %>

diff --git a/config/deploy/production.rb b/config/deploy/production.rb index 57d36de2d..976a5d9a3 100644 --- a/config/deploy/production.rb +++ b/config/deploy/production.rb @@ -1,3 +1,3 @@ server "chouette.cityway.fr", :app, :web, :db, :primary => true -set :branch, "V2_5" -set :gui_cmd, "2.5.1" \ No newline at end of file +set :branch, "V2_5_1" +set :gui_cmd, "2.5.1" diff --git a/config/deploy/unstable.rb b/config/deploy/unstable.rb index e8fe08e75..b5e60b53d 100644 --- a/config/deploy/unstable.rb +++ b/config/deploy/unstable.rb @@ -1,3 +1,3 @@ server "chouette-p.aix.cityway.fr", :app, :web, :db, :primary => true -set :branch, "V2_5" -set :gui_cmd, "2.5.1" \ No newline at end of file +set :branch, "V2_5_1" +set :gui_cmd, "2.5.1" diff --git a/config/environments/development.rb b/config/environments/development.rb index 0d33ac03c..3d7819639 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,10 +69,11 @@ ChouetteIhm::Application.configure do # Configure the e-mail address which will be shown in Devise::Maile config.mailer_sender = "appli@chouette.mobi" - ActionMailer::Base.smtp_settings = { - :address => "smtp.samle.com", - :domain => "sample.com" - } + config.action_mailer.delivery_method = :sendmail + # change to true to allow email to be sent during development + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = true + config.action_mailer.default :charset => "utf-8" # api key to geoportail IGN (development key 3 month validity) # config.geoportail_api_key = "f1t6wihbh98njlbaf5cuzxy4" diff --git a/config/routes.rb b/config/routes.rb index 530e17409..6879a2191 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,11 +7,11 @@ ChouetteIhm::Application.routes.draw do devise_scope :user do authenticated :user do - root :to => 'referentials#index' + root :to => 'referentials#index', as: :authenticated_root end unauthenticated do - root :to => 'devise/sessions#new' + root :to => 'devise/sessions#new', as: :unauthenticated_root end end -- cgit v1.2.3 From 283a9eed064a72c22c381c5025717b592c6cc4fb Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 9 Jan 2015 07:54:33 +0100 Subject: manage unauthenticated_root --- app/controllers/registrations_controller.rb | 2 +- app/views/devise/passwords/edit.html.erb | 2 +- app/views/devise/passwords/new.html.erb | 2 +- app/views/layouts/_user_links.erb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index b02d3217a..f563fbb03 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -6,7 +6,7 @@ def accept_user_creation if !Rails.application.config.accept_user_creation - redirect_to root_path + redirect_to unauthenticated_root_path return false else return true diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 7b408a149..0c5ba77cf 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -9,7 +9,7 @@ <%= f.input :password_confirmation, :as => :password %>
- <%= link_to t("cancel"), root_path, :class => "btn btn-default" %> + <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> <%= f.button :submit, :value => t("devise.passwords.edit.commit"), :class => "btn-info" %>
<% end %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 865805319..498e24c4c 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -6,7 +6,7 @@ <%= form.input :email, :as => :email, placeholder: 'user@domain.com' %>
- <%= link_to t("cancel"), root_path, :class => "btn btn-default" %> + <%= link_to t("cancel"), unauthenticated_root_path, :class => "btn btn-default" %> <%= form.button :submit, :value => t("devise.passwords.new.commit"), :class => "btn-info" %>
<% end %> diff --git a/app/views/layouts/_user_links.erb b/app/views/layouts/_user_links.erb index 404f52172..bd9196b3f 100644 --- a/app/views/layouts/_user_links.erb +++ b/app/views/layouts/_user_links.erb @@ -1,5 +1,5 @@