hero_generator 0.0.1.beta5 → 0.0.1.beta6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. data/lib/generators/hero/authentication/authentication_generator.rb +8 -6
  2. data/lib/generators/hero/authentication/templates/config/initializers/constants.rb +1 -0
  3. data/lib/generators/hero/authentication/templates/config/initializers/fix_active_record_validations_full_messages.rb +29 -0
  4. data/lib/generators/hero/authentication/templates/config/locales/en.yml +74 -47
  5. data/lib/generators/hero/authentication/templates/controllers/application_controller.rb +0 -4
  6. data/lib/generators/hero/authentication/templates/controllers/confirmation_controller.rb +14 -13
  7. data/lib/generators/hero/authentication/templates/controllers/sessions_controller.rb +3 -3
  8. data/lib/generators/hero/authentication/templates/controllers/settings_controller.rb +4 -4
  9. data/lib/generators/hero/authentication/templates/controllers/users_controller.rb +2 -11
  10. data/lib/generators/hero/authentication/templates/models/user.rb +19 -7
  11. data/lib/generators/hero/authentication/templates/views/confirmation/new_email_token.html.haml +3 -2
  12. data/lib/generators/hero/authentication/templates/views/confirmation/order_new_password.html.haml +2 -2
  13. data/lib/generators/hero/authentication/templates/views/confirmation/password_token.html.haml +1 -1
  14. data/lib/generators/hero/authentication/templates/views/confirmation/recover_password.html.haml +1 -1
  15. data/lib/generators/hero/authentication/templates/views/confirmation/registration.html.haml +2 -2
  16. data/lib/generators/hero/authentication/templates/views/confirmation/resend_signup_token.html.haml +3 -2
  17. data/lib/generators/hero/authentication/templates/views/layouts/application.html.haml +28 -0
  18. data/lib/generators/hero/authentication/templates/views/sessions/new.html.haml +7 -6
  19. data/lib/generators/hero/authentication/templates/views/settings/index.html.haml +2 -2
  20. data/lib/generators/hero/authentication/templates/views/users/new.html.haml +7 -7
  21. metadata +11 -8
@@ -46,11 +46,14 @@ module Hero
46
46
  template "views/sessions/new.html.haml", "app/views/sessions/new.html.haml"
47
47
  template "views/settings/index.html.haml", "app/views/settings/index.html.haml"
48
48
  template "views/users/new.html.haml", "app/views/users/new.html.haml"
49
+ template "views/layouts/application.html.haml", "app/views/layouts/application.html.haml"
49
50
  end
50
51
 
51
52
  def create_config_files
52
53
  template "config/config.yml", "config/app_config.yml"
53
54
  template "config/initializers/action_mailer.rb", "config/initializers/action_mailer.rb"
55
+ template "config/initializers/constants.rb", "config/initializers/constants.rb"
56
+ template "config/initializers/fix_active_record_validations_full_messages.rb", "config/initializers/fix_active_record_validations_full_messages.rb"
54
57
  template "config/locales/en.yml", "config/locales/en.yml"
55
58
  end
56
59
 
@@ -79,18 +82,17 @@ module Hero
79
82
  route "resources #{user_plural_name.to_sym.inspect}"
80
83
  route "resources #{session_plural_name.to_sym.inspect}"
81
84
  route "get 'log_out' => '#{session_plural_name.to_sym.inspect}#destroy', :as => 'log_out'"
82
- route "get 'registrieren' => '#{user_singular_name}#new', :as => 'sign_up_form'"
83
- route "post 'sign_up' => '#{user_singular_name}#create', :as => 'sign_up'"
85
+ route "get 'registrieren' => '#{user_plural_name}#new', :as => 'sign_up_form'"
86
+ route "post 'registrieren' => '#{user_plural_name}#create', :as => 'sign_up'"
84
87
  route "match 'confirm/resend_confirmation' => 'confirmation#resend_signup_token', :as => 'resend_signup_token'"
85
88
  route "match 'confirm/:action(/:token)', :controller => :confirmation, :as => 'confirm'"
86
- route "match 'log_in' => '#{session_plural_name.to_sym.inspect}#new', :as => 'log_in', :via => :get"
87
- route "match 'log_in' => '#{session_plural_name.to_sym.inspect}#create', :as => 'log_in', :via => :post"
89
+ route "get 'log_in' => '#{session_plural_name.to_sym.inspect}#new', :as => 'log_in'"
90
+ route "post 'log_in' => '#{session_plural_name.to_sym.inspect}#create', :as => 'log_in'"
88
91
  route "get 'recover_password_auth(/:token)' => 'confirmation#recover_password_auth', :as => 'recover_password_auth'"
89
92
  route "match 'recover_password(/:token)' => 'confirmation#recover_password', :as => 'recover_password'"
90
93
  route "match 'new_email(/:token)' => 'confirmation#new_email', :as => 'new_email'"
91
94
  route "match 'request_password' => 'confirmation#order_new_password', :as => 'order_new_password'"
92
- route "match 'notice' => 'application#notice', :as => 'notice'"
93
- route "root :to => '#{user_singular_name}#new'"
95
+ route "root :to => '#{user_plural_name}#new'"
94
96
  end
95
97
 
96
98
  private
@@ -0,0 +1 @@
1
+ EMAIL_REGEX = /^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i
@@ -0,0 +1,29 @@
1
+
2
+ ActiveModel::Errors.class_eval do
3
+ # Remove complicated logic
4
+ def full_messages
5
+ full_messages = []
6
+
7
+ each do |attribute, messages|
8
+ messages = Array.wrap(messages)
9
+ next if messages.empty?
10
+
11
+ if attribute == :base
12
+ messages.each {|m| full_messages << m }
13
+ else
14
+ attr_name = attribute.to_s.gsub('.', '_').humanize
15
+ attr_name = @base.class.human_attribute_name(
16
+ attribute,
17
+ :default => '' # attr_name
18
+ )
19
+
20
+ options = { :default => "%{message}", :attribute => attr_name }
21
+
22
+ messages.each do |m|
23
+ full_messages << I18n.t(:"errors.format", options.merge(:message => m))
24
+ end
25
+ end
26
+ end
27
+ full_messages
28
+ end
29
+ end
@@ -2,51 +2,78 @@
2
2
  # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
- fe:
6
- common:
7
- button:
8
- send: 'Send'
9
- user:
10
- new:
11
- title: 'Register'
12
- label_email: 'Email'
13
- label_password: 'Password'
14
- label_password_confirmation: 'Password Confirmation'
15
- create:
16
- flash:
17
- success: "Ihnen wurde eine Mail geschickt"
18
- error: "Fehler in der Eingabe"
19
-
20
- session:
21
- new:
22
- title: 'Login'
23
- label_email: 'Email'
24
- label_password: 'Password'
25
- create:
26
- flash:
27
- success: "Eingeloggt, hurra!"
28
- error:
29
- not_confirmed: "Bitte erst die Registrierung bestätigen."
30
- wrong_password_or_email: "Falsche Mail oder Password"
5
+
6
+ activerecord:
7
+ errors:
8
+
9
+ full_messages:
10
+ format: "{{message}}"
11
+ messages:
12
+ confirmation: "Passwortwiederholung ist falsch."
13
+
14
+ models:
15
+ user:
16
+ attributes:
17
+ password:
18
+ blank: "Bitte geben Sie ein Passwort an."
19
+ too_short: "Passwort ist zu kurz."
20
+ email:
21
+ blank: "Bitte geben Sie eine E-Mail an."
22
+ invalid: "Die E-Mail hat ein falsches Format."
23
+ password_digest:
24
+ blank: "Bitte geben Sie ein Passwort an."
25
+
31
26
 
32
-
33
- confirmation:
34
- order_new_password:
35
- flash:
36
- success: 'Es wurde eine Email mit Passwort versendet'
37
- registration:
38
- flash:
39
- success: 'Endlich richtig dabei.'
40
- error: 'falscher token'
41
- resend_signup_token:
42
- flash:
43
- success: "Token wurde nochmal gesendet"
44
- error: "Sie sind schon freigeschaltet. Was soll das?"
45
-
46
- confirmation_mailer:
47
- send_password_reset:
48
- subject: 'Neues Passwort angefordert'
49
- registration:
50
- subject: 'Bitte Anmeldung bestätigen'
51
- resend_signup_token:
52
- subject: 'Neuer Registrierungstoken'
27
+
28
+ common:
29
+ button:
30
+ send: 'Senden'
31
+ form:
32
+ error: "Fehler"
33
+ users:
34
+ new:
35
+ title: 'Registrieren'
36
+ label_email: 'E-Mail'
37
+ label_password: 'Passwort'
38
+ label_password_confirmation: 'Passwort wiederholen'
39
+ create:
40
+ flash:
41
+ success: "Ihnen wurde eine Mail geschickt"
42
+ error: "Fehler in der Eingabe"
43
+
44
+ sessions:
45
+ new:
46
+ title: 'Login'
47
+ label_email: 'Email'
48
+ label_password: 'Password'
49
+ create:
50
+ flash:
51
+ success: "Eingeloggt, hurra!"
52
+ error:
53
+ not_confirmed: "Bitte erst die Registrierung bestätigen."
54
+ wrong_password_or_email: "Falsche E-Mail und/oder Passwort"
55
+
56
+
57
+ confirmation:
58
+ new_email_token:
59
+ title: "Neue E-Mail bestätigen"
60
+ order_new_password:
61
+ flash:
62
+ success: 'Es wurde eine Email mit Passwort versendet'
63
+ registration:
64
+ flash:
65
+ success: 'Endlich richtig dabei.'
66
+ error: 'falscher Token'
67
+ resend_signup_token:
68
+ title: "Token nochmal zusenden"
69
+ flash:
70
+ success: "Token wurde nochmal gesendet"
71
+ error: "Sie sind schon freigeschaltet. Was soll das?"
72
+
73
+ confirmation_mailer:
74
+ send_password_reset:
75
+ subject: 'Neues Passwort angefordert'
76
+ registration:
77
+ subject: 'Bitte Anmeldung bestätigen'
78
+ resend_signup_token:
79
+ subject: 'Neuer Registrierungstoken'
@@ -2,8 +2,4 @@ class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
3
  include Authentication
4
4
 
5
- def notice
6
- # left empty on purpose
7
- end
8
-
9
5
  end
@@ -5,21 +5,22 @@ class ConfirmationController < ApplicationController
5
5
 
6
6
  if @user
7
7
  @user.confirm_signup!
8
- redirect_to log_in_path, :notice => t( 'fe.confirmation.registration.flash.success' )
8
+ redirect_to log_in_url, :notice => t( 'confirmation.registration.flash.success' )
9
+ else
10
+ flash[:notice] = t( 'confirmation.registration.flash.error') if params[:token]
9
11
  end
10
-
11
- flash[:notice] = t( 'fe.confirmation.registration.flash.error') if params[:token]
12
+
12
13
  end
13
14
 
14
15
  def resend_signup_token
15
16
  @user = User.find_by_email(params[:email])
16
17
  if @user && @user.authenticate(params[:password])
17
18
  if @user.resend_signup_token
18
- flash[:notice] = t( 'fe.confirmation.resend_signup_token.flash.success' )
19
+ flash[:notice] = t( 'confirmation.resend_signup_token.flash.success' )
19
20
  else
20
- flash[:notice] = t( 'fe.confirmation.resend_signup_token.flash.error' )
21
+ flash[:notice] = t( 'confirmation.resend_signup_token.flash.error' )
21
22
  end
22
- redirect_to log_in_path
23
+ redirect_to log_in_url
23
24
  end
24
25
  end
25
26
 
@@ -27,9 +28,9 @@ class ConfirmationController < ApplicationController
27
28
  if params[:email]
28
29
  @user = User.where( :email => params[:email] ).first
29
30
  if @user && @user.send_password_reset
30
- flash[:notice] = t( 'fe.confirmation.order_new_password.flash.success' )
31
+ flash[:notice] = t( 'confirmation.order_new_password.flash.success' )
31
32
  end
32
- redirect_to root_path
33
+ redirect_to root_url
33
34
  end
34
35
  end
35
36
 
@@ -50,13 +51,13 @@ class ConfirmationController < ApplicationController
50
51
  if @user
51
52
  if !params[:recover_password].nil? && params[:recover_password_confirmation] == params[:recover_password]
52
53
  if @user.confirm_password!(params[:recover_password])
53
- redirect_to( log_in_path, :notice => t( 'fe.confirmation.recover_password.flash_success' ))
54
+ redirect_to( log_in_path, :notice => t( 'confirmation.recover_password.flash_success' ))
54
55
  else
55
- flash.now[:notice] = t( 'fe.confirmation.recover_password.flash_error' )
56
+ flash.now[:notice] = t( 'confirmation.recover_password.flash_error' )
56
57
  end
57
58
  end
58
59
  else
59
- redirect_to recover_password_auth_path
60
+ redirect_to recover_password_auth_url
60
61
  end
61
62
  end
62
63
 
@@ -65,9 +66,9 @@ class ConfirmationController < ApplicationController
65
66
  @user = User.find_by_new_email_token( params[:token] ) unless params[:token].nil?
66
67
  if @user
67
68
  if @user.confirm_new_email!
68
- redirect_to( log_in_path, :notice => t( 'fe.confirmation.new_email.flash_success' ))
69
+ redirect_to( log_in_url, :notice => t( 'confirmation.new_email.flash_success' ))
69
70
  else
70
- flash[:notice] = t( 'fe.confirmation.new_email.flash_error' )
71
+ flash[:notice] = t( 'confirmation.new_email.flash_error' )
71
72
  end
72
73
  else
73
74
  render :new_email_token
@@ -7,12 +7,12 @@ class SessionsController < ApplicationController
7
7
  if @user && @user.authenticate(params[:password])
8
8
  if @user.confirmed?
9
9
  session[:user_id] = @user.id
10
- redirect_to root_url, :notice => t( 'fe.session.create.flash.success' )
10
+ redirect_to root_url, :notice => t( 'sessions.create.flash.success' )
11
11
  else
12
- redirect_to confirm_path( :action => "registration" ), :notice => t( 'fe.session.create.flash.error.not_confirmed' )
12
+ redirect_to confirm_url( :action => "registration" ), :notice => t( 'sessions.create.flash.error.not_confirmed' )
13
13
  end
14
14
  else
15
- flash.now.alert = t( 'fe.session.create.flash.error.wrong_password_or_email' )
15
+ flash.now.alert = t( 'sessions.create.flash.error.wrong_password_or_email' )
16
16
  render :new
17
17
  end
18
18
  end
@@ -8,7 +8,7 @@ class SettingsController < ApplicationController
8
8
  email_updated = false
9
9
  @user = current_user
10
10
 
11
- flash.now[:notice] = t( 'fe.settings.change_user_email.flash_error' )
11
+ flash.now[:notice] = t( 'settings.change_user_email.flash_error' )
12
12
 
13
13
  if @user.authenticate( params[:user][:password] )
14
14
  current_user.set_new_email = true
@@ -18,12 +18,12 @@ class SettingsController < ApplicationController
18
18
  email_updated = true
19
19
  end
20
20
  else
21
- flash.now[:notice] = t( "fe.settings.update_email.flash.error.wrong_password" )
21
+ flash.now[:notice] = t( "settings.update_email.flash.error.wrong_password" )
22
22
  end
23
23
 
24
24
  if email_updated
25
- flash.now[:notice] = t( "fe.settings.update_email.flash.success" )
26
- redirect_to "/settings"
25
+ flash.now[:notice] = t( "settings.update_email.flash.success" )
26
+ redirect_to settings_url
27
27
  else
28
28
  render :index
29
29
  end
@@ -12,21 +12,12 @@ class UsersController < ApplicationController
12
12
  @user.password_confirmation = params[:user][:password_confirmation]
13
13
 
14
14
  if @user.save
15
- redirect_to root_url, :notice => t( 'fe.user.create.flash.success' )
15
+ redirect_to root_url, :notice => t( '.users.create.flash.success' )
16
16
  @user.send_registration
17
17
  else
18
- flash.now[:error] = t( 'fe.user.create.flash.error' )
18
+ #flash.now[:error] = t( '.users.create.flash.error' )
19
19
  render :new
20
20
  end
21
21
  end
22
22
 
23
-
24
23
  end
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
@@ -4,23 +4,24 @@ class User < ActiveRecord::Base
4
4
  attr_accessible :email, :password, :password_confirmation, :new_email_confirmation, :set_new_email
5
5
 
6
6
  attr_accessor :update_password, :new_email_confirmation, :set_new_email
7
-
8
- validates_format_of :email, :with => /^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i
7
+
9
8
  validates_presence_of :email
9
+ validates_format_of :email, :with => EMAIL_REGEX,
10
+ :if => :should_validate_email_format?
10
11
  validates_uniqueness_of :email, :unless => :confirmed_duplicate
11
12
 
12
- validates_presence_of :password, :if => :should_validate_password?
13
- validates_length_of :password, :if => :should_validate_password?,
13
+ #validates_presence_of :password, :if => :should_validate_password?
14
+ validates_length_of :password, :if => :should_validate_password_length?,
14
15
  :within => 3..30,
15
16
  :too_short => 'too short message',
16
17
  :too_long => 'too long message'
17
18
 
18
- validates_confirmation_of :password, :if => :should_validate_password?
19
+ #validates_confirmation_of :password, :if => :should_validate_password?
19
20
 
20
21
  #set new email
21
22
  validates_presence_of :new_email, :if => :should_validate_new_email?
22
- validates_format_of :new_email, :with => /^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i,
23
- :if => :should_validate_new_email?
23
+ validates_format_of :new_email, :with => EMAIL_REGEX,
24
+ :if => :should_validate_new_email_format?
24
25
 
25
26
  validates_presence_of :new_email_confirmation, :if => :should_validate_new_email?
26
27
  validates_confirmation_of :new_email, :if => :should_validate_new_email?
@@ -77,14 +78,25 @@ class User < ActiveRecord::Base
77
78
  end
78
79
  end
79
80
 
81
+ def should_validate_email_format?
82
+ email.present?
83
+ end
84
+
80
85
  def should_validate_new_email?
81
86
  set_new_email.present?
82
87
  end
83
88
 
89
+ def should_validate_new_email_format?
90
+ set_new_email.present? && new_email.present?
91
+ end
92
+
84
93
  def should_validate_password?
85
94
  update_password || new_record?
86
95
  end
87
96
 
97
+ def should_validate_password_length?
98
+ should_validate_password? && password.present?
99
+ end
88
100
 
89
101
 
90
102
  def send_password_reset
@@ -1,4 +1,5 @@
1
- %h1 Verify new email request
1
+ %h1
2
+ = t '.title'
2
3
 
3
4
  = form_tag new_email_path, {:id => "new_email_token"} do
4
5
  %p
@@ -7,5 +8,5 @@
7
8
  = text_field_tag :token
8
9
 
9
10
  %p.button
10
- = submit_tag t( "fe.common.button.send" ), :id => "new_email_token_button"
11
+ = submit_tag t( "common.button.send" ), :id => "new_email_token_button"
11
12
 
@@ -1,11 +1,11 @@
1
1
  %h1 Send new Password
2
2
 
3
- = form_tag order_new_password_path do
3
+ = form_tag order_new_password_url do
4
4
  %p
5
5
  = label_tag :email
6
6
  %br
7
7
  = text_field_tag :email
8
8
 
9
9
  %p.button
10
- = submit_tag t( "fe.common.button.send" ), :id => "send_new_password_button"
10
+ = submit_tag t( "common.button.send" ), :id => "send_new_password_button"
11
11
 
@@ -7,5 +7,5 @@
7
7
  = text_field_tag :token
8
8
 
9
9
  %p.button
10
- = submit_tag t( "fe.common.button.send" ), :id => "password_token_button"
10
+ = submit_tag t( "common.button.send" ), :id => "password_token_button"
11
11
 
@@ -11,5 +11,5 @@
11
11
  = password_field_tag :recover_password_confirmation
12
12
 
13
13
  %p.button
14
- = submit_tag t( "fe.common.button.send" ), :id => "recover_password_button"
14
+ = submit_tag t( "common.button.send" ), :id => "recover_password_button"
15
15
 
@@ -4,7 +4,7 @@
4
4
  %br
5
5
  = text_field_tag :token
6
6
  %p
7
- = submit_tag t( "fe.common.button.send" ), :id => "token_button"
7
+ = submit_tag t( "common.button.send" ), :id => "token_button"
8
8
  %p
9
- = link_to t('fe.confirmation.registration.view.resend_signup_token_link'), resend_signup_token_path, :id => 'resend_signup_token'
9
+ = link_to t('confirmation.registration.view.resend_signup_token_link'), resend_signup_token_path, :id => 'resend_signup_token'
10
10
 
@@ -1,4 +1,5 @@
1
- %h1 Resend Confirmation
1
+ %h1
2
+ = t( 'confirmation.resend_signup_token.title' )
2
3
 
3
4
  = form_tag resend_signup_token_path do
4
5
  %p
@@ -10,4 +11,4 @@
10
11
  %br
11
12
  = password_field_tag :password
12
13
  %p.button
13
- = submit_tag t( "fe.common.button.send" ), :id => "resend_signup_token_button"
14
+ = submit_tag t( "common.button.send" ), :id => "resend_signup_token_button"
@@ -0,0 +1,28 @@
1
+ !!! XML
2
+ !!!
3
+ %html{:xmlns => "http://www.w3.org/1999/xhtml"}
4
+ %head
5
+ %title
6
+ = t( 'common.application.title' )
7
+ = stylesheet_link_tag "application", :media => "all"
8
+ = javascript_include_tag "application"
9
+ = csrf_meta_tag
10
+
11
+ %body
12
+ - if current_user
13
+ = "Sie sind angelmeldet als: " + current_user.email.to_s |
14
+ = link_to "Abmelden?", log_out_path
15
+ - else
16
+ = "Sie sind nicht angemeldet." |
17
+ = link_to "Anmelden?", log_in_link_path
18
+ = " oder "
19
+ = link_to "Registrieren?", sign_up_form_path
20
+
21
+
22
+
23
+ - flash.each do |name, msg|
24
+ %div{:class => "box box-#{name}", :id => "flash_#{name}"}
25
+ = msg
26
+
27
+ = yield
28
+
@@ -1,16 +1,17 @@
1
- %h1 Login
1
+ %h1
2
+ = t '.title'
2
3
 
3
- = form_tag sessions_path do
4
+ = form_tag log_in_url do
4
5
  %p
5
- = label_tag t( 'fe.session.new.label_email' )
6
+ = label_tag t( '.label_email' )
6
7
  %br
7
8
  = text_field_tag :email, params[:email]
8
9
  %p
9
- = label_tag t( 'fe.session.new.label_password' )
10
+ = label_tag t( '.label_password' )
10
11
  %br
11
12
  = password_field_tag :password
13
+
12
14
  %p{:class =>"button"}
13
- = submit_tag t( 'fe.common.button.send' ), :id => 'log_in_button'
14
-
15
+ = submit_tag t( 'common.button.send' ), :id => 'log_in_button'
15
16
  %p
16
17
  = link_to "Passwort vergessen?", order_new_password_path, :id => 'password_forgotten_link'
@@ -5,7 +5,7 @@
5
5
  - if @user.errors.any?
6
6
  .error_messages
7
7
  %h2
8
- = "Form is invalid"
8
+ = t( 'common.form.error' )
9
9
  %ul
10
10
  - for message in @user.errors.full_messages
11
11
  %li
@@ -25,4 +25,4 @@
25
25
  %br
26
26
  = f.password_field :password
27
27
  %p.button
28
- = submit_tag t( 'fe.common.button.send' ), :id => 'change_email_button'
28
+ = submit_tag t( 'common.button.send' ), :id => 'change_email_button'
@@ -1,30 +1,30 @@
1
1
  %h1
2
- = t( 'fe.user.new.title' )
2
+ = t '.title'
3
3
 
4
4
 
5
- = form_for @user do |f|
5
+ = form_for @user, :url => sign_up_url do |f|
6
6
  - if @user.errors.any?
7
7
  .error_messages
8
8
  %h2
9
- = "Form is invalid"
9
+ = t( 'common.form.error' )
10
10
  %ul
11
11
  - for message in @user.errors.full_messages
12
12
  %li
13
13
  = message
14
14
  %p
15
- = f.label t( 'fe.user.new.label_email')
15
+ = f.label t( '.label_email')
16
16
  %br
17
17
  = f.text_field :email
18
18
  %p
19
- = f.label t( 'fe.user.new.label_password' )
19
+ = f.label t( '.label_password' )
20
20
  %br
21
21
  = f.password_field :password
22
22
  %p
23
- = f.label t( 'fe.user.new.label_password_confirmation' )
23
+ = f.label t( '.label_password_confirmation' )
24
24
  %br
25
25
  = f.password_field :password_confirmation
26
26
  %p.button
27
- = f.submit t( 'fe.common.button.send' ), :id => 'sign_up_button'
27
+ = f.submit t( 'common.button.send' ), :id => 'sign_up_button'
28
28
 
29
29
 
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hero_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta5
4
+ version: 0.0.1.beta6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000Z
12
+ date: 2012-10-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-rails
16
- requirement: &82459840 !ruby/object:Gem::Requirement
16
+ requirement: &74047410 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *82459840
24
+ version_requirements: *74047410
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bcrypt-ruby
27
- requirement: &82459580 !ruby/object:Gem::Requirement
27
+ requirement: &74047160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.1.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *82459580
35
+ version_requirements: *74047160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rails
38
- requirement: &82459310 !ruby/object:Gem::Requirement
38
+ requirement: &74046930 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 3.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82459310
46
+ version_requirements: *74046930
47
47
  description: Write a gem description
48
48
  email:
49
49
  - guido@boyke.de
@@ -57,6 +57,7 @@ files:
57
57
  - lib/generators/hero/authentication/USAGE
58
58
  - lib/generators/hero/authentication/authentication_generator.rb
59
59
  - lib/generators/hero/authentication/templates/views/sessions/new.html.haml
60
+ - lib/generators/hero/authentication/templates/views/layouts/application.html.haml
60
61
  - lib/generators/hero/authentication/templates/views/settings/index.html.haml
61
62
  - lib/generators/hero/authentication/templates/views/confirmation_mailer/new_email_request.text.haml
62
63
  - lib/generators/hero/authentication/templates/views/confirmation_mailer/resend_signup_token.text.haml
@@ -86,6 +87,8 @@ files:
86
87
  - lib/generators/hero/authentication/templates/models/user.rb
87
88
  - lib/generators/hero/authentication/templates/models/authentication.rb
88
89
  - lib/generators/hero/authentication/templates/config/initializers/action_mailer.rb
90
+ - lib/generators/hero/authentication/templates/config/initializers/constants.rb
91
+ - lib/generators/hero/authentication/templates/config/initializers/fix_active_record_validations_full_messages.rb
89
92
  - lib/generators/hero/authentication/templates/config/config.yml
90
93
  - lib/generators/hero/authentication/templates/config/locales/en.yml
91
94
  - lib/generators/hero/authentication/templates/migrations/create_users.rb