aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Florisson2012-09-07 15:18:14 +0200
committerMarc Florisson2012-09-07 15:18:14 +0200
commit912b35783d8dd147475203fe0bce9d387e4e4766 (patch)
treef09f35f851c43bef0ceffc317ba1e051793c24ff
parent1216e32dea850344899826b17861d98a8deb9302 (diff)
downloadchouette-core-912b35783d8dd147475203fe0bce9d387e4e4766.tar.bz2
fix confirmable changes
-rw-r--r--Gemfile.lock4
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/helpers/users_helper.rb7
-rw-r--r--app/models/user.rb3
-rw-r--r--app/views/layouts/mailer.html.erb4
-rw-r--r--config/locales/devise.fr.yml2
6 files changed, 13 insertions, 9 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 5af91e2b9..222ddb2e1 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -61,7 +61,7 @@ GIT
GIT
remote: git://sim.dryade.priv/user_interface
- revision: 55a84bcc7d88c3962cb43eda817bbfa780e4365c
+ revision: 0fac5e33ba61eaa691a65d9a5f49f6acd3755927
specs:
user_interface (0.0.1)
rails (> 3.1.0)
@@ -109,7 +109,7 @@ GEM
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.0.1-java)
bouncy-castle-java (1.5.0146.1)
- builder (3.0.0)
+ builder (3.0.2)
capistrano (2.13.3)
highline
net-scp (>= 1.0.0)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 3c9ad214d..3b4775fc7 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,7 +1,7 @@
class UsersController < InheritedResources::Base
def create
- @user = current_organisation.users.create(params[:user])
+ @user = current_organisation.users.build(params[:user])
@user.invite!
respond_with @user, :location => organisation_user_path(@user)
end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index ad45433c1..82ecb3273 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -1,11 +1,14 @@
module UsersHelper
def user_gravatar_image_tag(user)
- gravatar_image_tag user.email, :alt => user.name, :class => "preview", :gravatar => { :default => user_default_avatar, :size => 64 }
+ gravatar_image_tag user.email, :alt => user.name, :class => "preview", :gravatar => { :default => user_default_avatar , :size => 64 }
end
def user_default_avatar
- "#{root_url}#{image_path('icons/user.png')}"
+ return "#{root_url}#{image_path('icons/user.png')}" if Rails.application.config.relative_url_root.blank?
+
+ relative_url_root = Rails.application.config.relative_url_root.sub( /\//, '')
+ "#{root_url}#{image_path('icons/user.png')}".sub( Regexp.new("/#{relative_url_root}/#{relative_url_root}/"), "/#{relative_url_root}/")
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 77aa02c68..480efa2f9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -3,8 +3,7 @@ class User < ActiveRecord::Base
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
- :invitable
-
+ :confirmable, :invitable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :name
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb
index 078e14083..86f141428 100644
--- a/app/views/layouts/mailer.html.erb
+++ b/app/views/layouts/mailer.html.erb
@@ -4,14 +4,14 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
-<body style="font-family: Verdana, Helvetica, Arial, MS Trebuchet, sans-serif; font-size: 14px; width: 600px; background: #61970B; padding: 15px">
+<body style="font-family: Verdana, Helvetica, Arial, MS Trebuchet, sans-serif; font-size: 14px; width: 600px; background: #E5E5E5; padding: 15px">
<style>
h2 { font-size: 18px; }
h3 { font-size: 14px; }
a { color: black; }
</style>
- <h1 style="background: #606; height: 75px; font-size: 24px; font-weight: normal; color: white; padding: 20px 0 0 30px;">Chouette</h1>
+ <h1 style="background: #61970B; height: 75px; font-size: 24px; font-weight: normal; color: white; padding: 20px 0 0 30px;">Chouette</h1>
<div style="background: white; margin-bottom: 10px; padding: 15px; -moz-box-shadow: 3px 3px 4px #bbbbbb; -webkit-box-shadow: 3px 3px 4px #BBB; box-shadow: 3px 3px 4px #BBB; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB;">
<%= yield %>
diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml
index 68e0dcb0f..7fc3ff5ee 100644
--- a/config/locales/devise.fr.yml
+++ b/config/locales/devise.fr.yml
@@ -3,3 +3,5 @@ fr:
mailer:
invitation_instructions:
subject: "Invitation sur l'application Chouette"
+ confirmation_instructions:
+ subject: "Confirmation de votre compte d'accès à l'application Chouette"