hero_generator 0.0.1.beta5 → 0.0.1.beta6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/generators/hero/authentication/authentication_generator.rb +8 -6
- data/lib/generators/hero/authentication/templates/config/initializers/constants.rb +1 -0
- data/lib/generators/hero/authentication/templates/config/initializers/fix_active_record_validations_full_messages.rb +29 -0
- data/lib/generators/hero/authentication/templates/config/locales/en.yml +74 -47
- data/lib/generators/hero/authentication/templates/controllers/application_controller.rb +0 -4
- data/lib/generators/hero/authentication/templates/controllers/confirmation_controller.rb +14 -13
- data/lib/generators/hero/authentication/templates/controllers/sessions_controller.rb +3 -3
- data/lib/generators/hero/authentication/templates/controllers/settings_controller.rb +4 -4
- data/lib/generators/hero/authentication/templates/controllers/users_controller.rb +2 -11
- data/lib/generators/hero/authentication/templates/models/user.rb +19 -7
- data/lib/generators/hero/authentication/templates/views/confirmation/new_email_token.html.haml +3 -2
- data/lib/generators/hero/authentication/templates/views/confirmation/order_new_password.html.haml +2 -2
- data/lib/generators/hero/authentication/templates/views/confirmation/password_token.html.haml +1 -1
- data/lib/generators/hero/authentication/templates/views/confirmation/recover_password.html.haml +1 -1
- data/lib/generators/hero/authentication/templates/views/confirmation/registration.html.haml +2 -2
- data/lib/generators/hero/authentication/templates/views/confirmation/resend_signup_token.html.haml +3 -2
- data/lib/generators/hero/authentication/templates/views/layouts/application.html.haml +28 -0
- data/lib/generators/hero/authentication/templates/views/sessions/new.html.haml +7 -6
- data/lib/generators/hero/authentication/templates/views/settings/index.html.haml +2 -2
- data/lib/generators/hero/authentication/templates/views/users/new.html.haml +7 -7
- 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' => '#{
|
83
|
-
route "post '
|
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 "
|
87
|
-
route "
|
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 "
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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'
|
@@ -5,21 +5,22 @@ class ConfirmationController < ApplicationController
|
|
5
5
|
|
6
6
|
if @user
|
7
7
|
@user.confirm_signup!
|
8
|
-
redirect_to
|
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( '
|
19
|
+
flash[:notice] = t( 'confirmation.resend_signup_token.flash.success' )
|
19
20
|
else
|
20
|
-
flash[:notice] = t( '
|
21
|
+
flash[:notice] = t( 'confirmation.resend_signup_token.flash.error' )
|
21
22
|
end
|
22
|
-
redirect_to
|
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( '
|
31
|
+
flash[:notice] = t( 'confirmation.order_new_password.flash.success' )
|
31
32
|
end
|
32
|
-
redirect_to
|
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( '
|
54
|
+
redirect_to( log_in_path, :notice => t( 'confirmation.recover_password.flash_success' ))
|
54
55
|
else
|
55
|
-
flash.now[:notice] = t( '
|
56
|
+
flash.now[:notice] = t( 'confirmation.recover_password.flash_error' )
|
56
57
|
end
|
57
58
|
end
|
58
59
|
else
|
59
|
-
redirect_to
|
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(
|
69
|
+
redirect_to( log_in_url, :notice => t( 'confirmation.new_email.flash_success' ))
|
69
70
|
else
|
70
|
-
flash[:notice] = t( '
|
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( '
|
10
|
+
redirect_to root_url, :notice => t( 'sessions.create.flash.success' )
|
11
11
|
else
|
12
|
-
redirect_to
|
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( '
|
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( '
|
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( "
|
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( "
|
26
|
-
redirect_to
|
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( '
|
15
|
+
redirect_to root_url, :notice => t( '.users.create.flash.success' )
|
16
16
|
@user.send_registration
|
17
17
|
else
|
18
|
-
flash.now[:error] = t( '
|
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 => :
|
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 =>
|
23
|
-
:if => :
|
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
|
data/lib/generators/hero/authentication/templates/views/confirmation/new_email_token.html.haml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
%h1
|
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( "
|
11
|
+
= submit_tag t( "common.button.send" ), :id => "new_email_token_button"
|
11
12
|
|
data/lib/generators/hero/authentication/templates/views/confirmation/order_new_password.html.haml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
%h1 Send new Password
|
2
2
|
|
3
|
-
= form_tag
|
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( "
|
10
|
+
= submit_tag t( "common.button.send" ), :id => "send_new_password_button"
|
11
11
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
%br
|
5
5
|
= text_field_tag :token
|
6
6
|
%p
|
7
|
-
= submit_tag t( "
|
7
|
+
= submit_tag t( "common.button.send" ), :id => "token_button"
|
8
8
|
%p
|
9
|
-
= link_to t('
|
9
|
+
= link_to t('confirmation.registration.view.resend_signup_token_link'), resend_signup_token_path, :id => 'resend_signup_token'
|
10
10
|
|
data/lib/generators/hero/authentication/templates/views/confirmation/resend_signup_token.html.haml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
%h1
|
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( "
|
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
|
1
|
+
%h1
|
2
|
+
= t '.title'
|
2
3
|
|
3
|
-
= form_tag
|
4
|
+
= form_tag log_in_url do
|
4
5
|
%p
|
5
|
-
= label_tag t( '
|
6
|
+
= label_tag t( '.label_email' )
|
6
7
|
%br
|
7
8
|
= text_field_tag :email, params[:email]
|
8
9
|
%p
|
9
|
-
= label_tag t( '
|
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( '
|
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
|
-
=
|
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( '
|
28
|
+
= submit_tag t( 'common.button.send' ), :id => 'change_email_button'
|
@@ -1,30 +1,30 @@
|
|
1
1
|
%h1
|
2
|
-
= t
|
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
|
-
=
|
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( '
|
15
|
+
= f.label t( '.label_email')
|
16
16
|
%br
|
17
17
|
= f.text_field :email
|
18
18
|
%p
|
19
|
-
= f.label t( '
|
19
|
+
= f.label t( '.label_password' )
|
20
20
|
%br
|
21
21
|
= f.password_field :password
|
22
22
|
%p
|
23
|
-
= f.label t( '
|
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( '
|
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.
|
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
|
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: &
|
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: *
|
24
|
+
version_requirements: *74047410
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bcrypt-ruby
|
27
|
-
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: *
|
35
|
+
version_requirements: *74047160
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
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: *
|
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
|