diff options
| -rw-r--r-- | Gemfile.lock | 4 | ||||
| -rw-r--r-- | app/controllers/users_controller.rb | 2 | ||||
| -rw-r--r-- | app/helpers/users_helper.rb | 7 | ||||
| -rw-r--r-- | app/models/user.rb | 3 | ||||
| -rw-r--r-- | app/views/layouts/mailer.html.erb | 4 | ||||
| -rw-r--r-- | config/locales/devise.fr.yml | 2 | 
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"  | 
