diff options
Diffstat (limited to 'app')
| -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 |
4 files changed, 9 insertions, 7 deletions
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 %> |
