lobby 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/app/controllers/lobby/sessions_controller.rb +5 -5
  2. data/app/models/lobby/auth_user.rb +18 -0
  3. data/app/models/lobby/auth_user.rb~ +19 -1
  4. data/config/locales/de.yml +84 -464
  5. data/config/locales/de.yml~ +78 -467
  6. data/config/locales/en.yml +67 -76
  7. data/config/locales/en.yml~ +88 -97
  8. data/config/routes.rb +0 -2
  9. data/config/routes.rb~ +21 -0
  10. data/lib/generators/lobby/install_generator.rb +86 -0
  11. data/lib/generators/lobby/install_generator.rb~ +86 -0
  12. data/lib/generators/lobby/lobby_generator.rb~ +97 -0
  13. data/lib/generators/templates/config/config.yml +31 -0
  14. data/lib/generators/templates/config/initializers/action_mailer.rb +75 -0
  15. data/lib/generators/templates/config/initializers/constants.rb +1 -0
  16. data/lib/generators/templates/config/locales/de.yml +149 -0
  17. data/lib/generators/templates/config/locales/en.yml +148 -0
  18. data/{db/migrate/20131205180849_create_users.rb → lib/generators/templates/db/migrate/create_users.rb} +2 -2
  19. data/lib/generators/templates/views/common/_form_errors.html.haml +6 -0
  20. data/lib/generators/templates/views/confirmation/new_email_token.html.haml +10 -0
  21. data/lib/generators/templates/views/confirmation/registration.html.haml +11 -0
  22. data/lib/generators/templates/views/confirmation/registration.html.haml~ +15 -0
  23. data/lib/generators/templates/views/confirmation/resend_signup_token.html.haml +13 -0
  24. data/lib/generators/templates/views/confirmation/resend_signup_token.html.haml~ +17 -0
  25. data/lib/generators/templates/views/confirmation_mailer/new_email_request.text.haml +1 -0
  26. data/lib/generators/templates/views/confirmation_mailer/registration.text.haml +1 -0
  27. data/lib/generators/templates/views/confirmation_mailer/resend_signup_token.text.haml +1 -0
  28. data/lib/generators/templates/views/confirmation_mailer/send_password_reset.text.haml +1 -0
  29. data/lib/generators/templates/views/password_forgotten/new.html.haml +17 -0
  30. data/lib/generators/templates/views/password_forgotten/new.html.haml~ +21 -0
  31. data/lib/generators/templates/views/password_forgotten/order_new_password.html.haml +9 -0
  32. data/lib/generators/templates/views/password_forgotten/order_new_password.html.haml~ +13 -0
  33. data/lib/generators/templates/views/password_forgotten/recover_password_auth.html.haml +9 -0
  34. data/lib/generators/templates/views/sessions/new.html.haml +12 -0
  35. data/lib/generators/templates/views/sessions/new.html.haml~ +12 -0
  36. data/lib/generators/templates/views/users/new.html.haml +20 -0
  37. data/lib/generators/templates/views/users/new.html.haml~ +20 -0
  38. data/lib/lobby/engine.rb +8 -0
  39. data/lib/lobby/engine.rb~ +12 -3
  40. data/lib/lobby/version.rb +1 -1
  41. data/lib/lobby/version.rb~ +1 -1
  42. metadata +31 -3
@@ -0,0 +1,86 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module Lobby
5
+ class InstallGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ attr_accessor :user_name, :session_name
9
+
10
+ argument :user_name, :type => :string, :default => "user"
11
+ argument :session_name, :type => :string, :default => "session"
12
+
13
+ source_root File.expand_path("../../templates", __FILE__)
14
+
15
+ def create_views
16
+ directory "views", "app/views/lobby"
17
+ end
18
+
19
+ def create_locales
20
+ template "config/locales/de.yml", "config/locales/de.lobby.yml"
21
+ template "config/locales/en.yml", "config/locales/en.lobby.yml"
22
+ end
23
+
24
+ def create_config_files
25
+ template "config/config.yml", "config/app_config.yml"
26
+ template "config/locales/en.yml", "config/locales/en.lobby.yml"
27
+ end
28
+
29
+ def create_config_files
30
+ template "config/config.yml", "config/app_config.yml"
31
+ template "config/initializers/action_mailer.rb", "config/initializers/action_mailer.rb"
32
+ template "config/initializers/constants.rb", "config/initializers/constants.rb"
33
+ end
34
+
35
+ def create_migration
36
+ migration_template 'db/migrate/create_users.rb', "db/migrate/create_#{user_plural_name}.rb"
37
+ end
38
+
39
+ def setup_routes
40
+ route "mount Lobby::Engine => '/', :as => 'lobby_engine'"
41
+ end
42
+
43
+ private
44
+
45
+ def user_singular_name
46
+ user_name.underscore
47
+ end
48
+
49
+ def user_plural_name
50
+ user_singular_name.pluralize
51
+ end
52
+
53
+ def user_class_name
54
+ user_name.camelize
55
+ end
56
+
57
+ def user_plural_class_name
58
+ user_plural_name.camelize
59
+ end
60
+
61
+ def session_singular_name
62
+ session_name.underscore
63
+ end
64
+
65
+ def session_plural_name
66
+ session_singular_name.pluralize
67
+ end
68
+
69
+ def session_class_name
70
+ session_name.camelize
71
+ end
72
+
73
+ def session_plural_class_name
74
+ session_plural_name.camelize
75
+ end
76
+
77
+ def self.next_migration_number(dirname) #:nodoc:
78
+ if ActiveRecord::Base.timestamped_migrations
79
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
80
+ else
81
+ "%.3d" % (current_migration_number(dirname) + 1)
82
+ end
83
+ end
84
+
85
+ end
86
+ end
@@ -0,0 +1,97 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module Lobby
5
+ class InstGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ attr_accessor :user_name, :session_name
9
+
10
+ argument :user_name, :type => :string, :default => "user"
11
+ argument :session_name, :type => :string, :default => "session"
12
+
13
+
14
+
15
+ # def create_views
16
+ # template "views/confirmation/new_email_token.html.haml", "app/views/confirmation/new_email_token.html.haml"
17
+ # template "views/confirmation/order_new_password.html.haml", "app/views/confirmation/order_new_password.html.haml"
18
+ # template "views/confirmation/password_token.html.haml", "app/views/confirmation/password_token.html.haml"
19
+ # end
20
+
21
+ # def create_config_files
22
+ # template "config/config.yml", "config/app_config.yml"
23
+ # template "config/initializers/action_mailer.rb", "config/initializers/action_mailer.rb"
24
+ # template "config/initializers/constants.rb", "config/initializers/constants.rb"
25
+ # template "config/initializers/fix_active_record_validations_full_messages.rb", "config/initializers/fix_active_record_validations_full_messages.rb"
26
+ # template "config/locales/de.yml", "config/locales/de.yml"
27
+ # template "config/locales/de.yml", "config/locales/en.yml"
28
+ # end
29
+
30
+ def create_migration
31
+ migration_template 'db/migrate/create_users.rb', "db/migrate/create_#{user_plural_name}.rb"
32
+ end
33
+
34
+ # def create_test_files
35
+ # template "tests/spec/controllers/sessions_controller_spec.rb", "spec/controllers/sessions_controller_spec.rb"
36
+ # template "tests/spec/controllers/users_controller_spec.rb", "spec/controllers/users_controller_spec.rb"
37
+ # template "tests/spec/models/user_spec.rb", "spec/models/user_spec.rb"
38
+ # template "tests/spec/requests/new_email_request_spec.rb", "spec/requests/new_email_request_spec.rb"
39
+ # template "tests/spec/requests/password_resets_spec.rb", "spec/requests/password_resets_spec.rb"
40
+ # template "tests/spec/requests/user_confirmation_spec.rb", "spec/requests/user_confirmation_spec.rb"
41
+ # template "tests/spec/requests/user_sign_in_spec.rb", "spec/requests/user_sign_in_spec.rb"
42
+ # template "tests/spec/requests/user_sign_up_spec.rb", "spec/requests/user_sign_up_spec.rb"
43
+ # template "tests/spec/routing/confirmation_mailer_spec.rb", "spec/routing/confirmation_mailer_spec.rb"
44
+ # template "tests/spec/support/mailer_macros.rb", "spec/support/mailer_macros.rb"
45
+ # template "tests/spec/factories.rb", "spec/factories.rb"
46
+ # template "tests/spec/spec_helper.rb", "spec/spec_helper.rb"
47
+ # end
48
+
49
+
50
+ def self.source_root
51
+ @source_root ||= File.join(File.dirname(__FILE__), '../../spec/dummy')
52
+ end
53
+
54
+ private
55
+
56
+ def user_singular_name
57
+ user_name.underscore
58
+ end
59
+
60
+ def user_plural_name
61
+ user_singular_name.pluralize
62
+ end
63
+
64
+ def user_class_name
65
+ user_name.camelize
66
+ end
67
+
68
+ def user_plural_class_name
69
+ user_plural_name.camelize
70
+ end
71
+
72
+ def session_singular_name
73
+ session_name.underscore
74
+ end
75
+
76
+ def session_plural_name
77
+ session_singular_name.pluralize
78
+ end
79
+
80
+ def session_class_name
81
+ session_name.camelize
82
+ end
83
+
84
+ def session_plural_class_name
85
+ session_plural_name.camelize
86
+ end
87
+
88
+ def self.next_migration_number(dirname) #:nodoc:
89
+ if ActiveRecord::Base.timestamped_migrations
90
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
91
+ else
92
+ "%.3d" % (current_migration_number(dirname) + 1)
93
+ end
94
+ end
95
+
96
+ end
97
+ end
@@ -0,0 +1,31 @@
1
+
2
+ const: &const
3
+ username: true
4
+
5
+ mailers: &mailers
6
+ registration_mailer: &mailconfig
7
+ from: "service@improwiki.com"
8
+
9
+ development: &development
10
+ default_url_options: 'localhost:3000'
11
+ <<: *const
12
+ <<: *mailers
13
+
14
+
15
+ test:
16
+ default_url_options: 'localhost:3000'
17
+ <<: *development
18
+
19
+ cucumber:
20
+ default_url_options: 'localhost:3000'
21
+ <<: *development
22
+
23
+ production:
24
+ default_url_options: 'new.improwiki.com'
25
+ <<: *const
26
+ <<: *mailers
27
+
28
+ staging:
29
+ default_url_options: 'improwiki.railscoder.de'
30
+ <<: *const
31
+ <<: *mailers
@@ -0,0 +1,75 @@
1
+ # Email settings
2
+
3
+ if Rails.env == "production"
4
+ ActionMailer::Base.delivery_method = :smtp
5
+ ActionMailer::Base.raise_delivery_errors = true
6
+ ActionMailer::Base.perform_deliveries = true
7
+ ActionMailer::Base.smtp_settings = {
8
+ :address => "www.example.com",
9
+ :port => 25,
10
+ :domain => 'example.com',
11
+ :authentication => :plain,
12
+ :enable_starttls_auto => true,
13
+ :user_name => "username",
14
+ :password => "password"
15
+ }
16
+ end
17
+
18
+ if Rails.env == "staging"
19
+ ActionMailer::Base.delivery_method = :smtp
20
+ ActionMailer::Base.raise_delivery_errors = true
21
+ ActionMailer::Base.perform_deliveries = true
22
+ ActionMailer::Base.smtp_settings = {
23
+ :address => "www.example.com",
24
+ :port => 25,
25
+ :domain => 'example.com',
26
+ :authentication => :plain,
27
+ :enable_starttls_auto => true,
28
+ :user_name => "username",
29
+ :password => "password"
30
+ }
31
+ end
32
+
33
+ if Rails.env == "development"
34
+ ActionMailer::Base.delivery_method = :smtp
35
+ ActionMailer::Base.raise_delivery_errors = true
36
+ ActionMailer::Base.perform_deliveries = false
37
+ ActionMailer::Base.smtp_settings = {
38
+ :address => "www.example.com",
39
+ :port => 25,
40
+ :domain => 'example.com',
41
+ :authentication => :plain,
42
+ :enable_starttls_auto => true,
43
+ :user_name => "username",
44
+ :password => "password"
45
+ }
46
+ end
47
+
48
+ if Rails.env == "test"
49
+ ActionMailer::Base.perform_deliveries = true
50
+ ActionMailer::Base.smtp_settings = {
51
+ :openssl_verify_mode => 'none'
52
+ }
53
+ end
54
+
55
+ if ActionMailer::Base.delivery_method == :smtp and ActionMailer::Base.smtp_settings.has_key?(:pop3_auth)
56
+ class ActionMailer::Base
57
+ alias_method :base_perform_delivery_smtp, :perform_delivery_smtp
58
+ @@pop3_auth_done = nil
59
+
60
+ private
61
+
62
+ def perform_delivery_smtp(mail)
63
+ do_pop_auth if !@@pop3_auth_done or (Time.now - smtp_settings[:pop3_auth][:expires]) >= @@pop3_auth_done
64
+ base_perform_delivery_smtp(mail)
65
+ end
66
+
67
+ def do_pop_auth
68
+ require 'net/pop'
69
+ pop = Net::POP3.new(smtp_settings[:pop3_auth][:server])
70
+ pop.start(smtp_settings[:pop3_auth][:user_name], smtp_settings[:pop3_auth][:password])
71
+ @@pop3_auth_done = Time.now
72
+ pop.finish
73
+ end
74
+ end
75
+ end
@@ -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,149 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ de:
5
+ common:
6
+ button:
7
+ send: 'Abschicken'
8
+ form:
9
+ error: "Fehler"
10
+
11
+ activerecord:
12
+ errors:
13
+ full_messages:
14
+ format: "{{message}}"
15
+ messages:
16
+ confirmation: "Passwortwiederholung ist falsch."
17
+ models:
18
+ user:
19
+ attributes:
20
+ password:
21
+ blank: "Bitte gib ein Passwort ein."
22
+ too_short: "Passwort ist zu kurz."
23
+ password_confirmation:
24
+ blank: "Passwort bitte wiederholen."
25
+ email:
26
+ taken: 'Diese E-Mail ist schon im System.'
27
+ blank: "Bitte gib eine E-Mail an."
28
+ invalid: "Die E-Mail hat ein falsches Format."
29
+ password_digest:
30
+ blank: "Bitte gib ein Passwort ein."
31
+ username:
32
+ blank: "Bitte gib einen Username an."
33
+ taken: 'Dieser Username ist schon im System.'
34
+ activemodel:
35
+ errors:
36
+ models:
37
+ password_forgotten_form:
38
+ attributes:
39
+ new_password:
40
+ too_short: 'Das neue Passwort ist zu kurz (mind. 5 Zeichen)'
41
+ new_password_confirmation:
42
+ confirmation: 'Die Passwortbestätigung war falsch.'
43
+
44
+ lobby:
45
+
46
+ users:
47
+ new:
48
+ title: 'Registrieren'
49
+ label_email: 'E-Mail'
50
+ label_username: 'Username'
51
+ label_password: 'Passwort'
52
+ label_password_confirmation: 'Passwort wiederholen'
53
+ create:
54
+ success: "Um die Registrierung abzuschließen, klicke bitte auf den Link den wir Dir soeben geschickt haben."
55
+
56
+ sessions:
57
+ destroy:
58
+ success: "Du bis nun ausgeloggt. Bis zum nächsten Mal."
59
+ new:
60
+ title: 'Login'
61
+ label_email: 'E-Mail oder Username'
62
+ label_password: 'Passwort'
63
+ link_password_forgotten: 'Passwort vergessen?'
64
+ create:
65
+ flash:
66
+ success: "Du bist drin."
67
+ error:
68
+ not_active: "Dein Account wurde deaktiviert."
69
+ not_confirmed: "Bitte erst die Registrierung bestätigen."
70
+ wrong_password_or_email: "Falsche E-Mail und/oder Passwort"
71
+
72
+ info:
73
+ login_status:
74
+ logged_in:
75
+ message_html: "Du bist angemeldet als: %{email}. %{logout_link}"
76
+ link1: "Abmelden?"
77
+ logged_out:
78
+ message_html: "Sie sind nicht angemeldet. %{signin_link} or %{signup_link}"
79
+ link1: "Registrieren?"
80
+ link2: "Anmelden?"
81
+
82
+ confirmation:
83
+ registration:
84
+ title: "Token"
85
+ resend_signup_token_link: "oder den Token nochmal senden."
86
+ flash:
87
+ success: 'Deine Registrierung war erfolgreich. Nun kannst Du Dich einloggen.'
88
+ error: 'Deine Registrierung konnte nicht bestätigt werden. War der Link korrekt? Sollte Dein E-Mail-Programm den Bestätigungslink nicht richtig darstellen, so kannst Du den Aktivierungstoken auch unten in das Feld kopieren.'
89
+ resend_signup_token:
90
+ label_email: "E-Mail"
91
+ label_password: "Passwort"
92
+ title: "Aktivierungstoken bitte nochmal zusenden"
93
+ flash:
94
+ success: "Der Aktivierungstoken wurde nochmal gesendet"
95
+ error: "Du bist schon freigeschaltet. Dieser Link ist nicht mehr gültig."
96
+
97
+
98
+ password_forgotten:
99
+ recover_password_auth:
100
+ title: 'Jetzt neues Passwort erstellen'
101
+ label_token: 'Token'
102
+ order_new_password:
103
+ title: "Neues Passwort generieren"
104
+ label_email: "Deine registrierte E-Mail"
105
+ flash:
106
+ success: 'Bitte prüfe Deine E-Mails. Dort findest Du einen Link zum Setzen Deines Passwortes.'
107
+
108
+ confirmation_mailer:
109
+
110
+ new_email_request:
111
+ subject: 'Neue E-Mail bestätigen'
112
+ body: "Hallo,
113
+ um die Änderung Deiner E-Mail-Adress bei XYZ abzuschließen klicke bitte auf folgenden Link:
114
+
115
+ %{url}
116
+
117
+ Vielen Dank"
118
+
119
+ registration:
120
+ subject: 'Bitte Anmeldung bestätigen'
121
+ body: "Hallo,
122
+ vielen Danke für die Registrierung bei XYZ. Um Deine Registrierung abzuschließen klicke bitte auf folgenden Link:
123
+
124
+ %{url}
125
+
126
+ Vielen Dank"
127
+
128
+
129
+ send_password_reset:
130
+ subject: 'Neues Passwort angefordert'
131
+ body: "Hallo,
132
+ dies ist eine automatisch generierte Nachricht von XYZ für Nutzer die ihre Zugangsdaten vergessen haben. Anbei erhälst Du,
133
+ wie angefordert, einen Link mit dem Du Dein Passwort neu setzen kannst:
134
+
135
+ %{url}
136
+
137
+ Vielen Dank"
138
+
139
+
140
+
141
+ resend_signup_token:
142
+ subject: 'Neuer Registrierungstoken'
143
+ body: "Hallo,
144
+ dies ist eine automatisch generierte Nachricht von XYZ für Nutzer die ihre Registrierungsmail verloren haben. Anbei erhälst Du,
145
+ wie angefordert, einen Link mit dem Du Deine Registrierung bestätigen kannst:
146
+
147
+ %{url}
148
+
149
+ Vielen Dank"
@@ -0,0 +1,148 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ common:
6
+ button:
7
+ send: 'send'
8
+ form:
9
+ error: "error"
10
+
11
+ activerecord:
12
+ errors:
13
+ full_messages:
14
+ format: "{{message}}"
15
+ messages:
16
+ confirmation: "Repeat Password is incorrect."
17
+ models:
18
+ user:
19
+ attributes:
20
+ password:
21
+ blank: "Please enter a password."
22
+ too_short: "Password is too short."
23
+ password_confirmation:
24
+ blank: "Please verify the password."
25
+ email:
26
+ taken: 'This e-mail is already in the system.'
27
+ blank: "Please enter an e-mail."
28
+ invalid: "The e-mail has an incorrect format."
29
+ password_digest:
30
+ blank: "Please enter a password"
31
+ username:
32
+ blank: "Please enter a user name."
33
+ taken: 'This username is already in the system.'
34
+ activemodel:
35
+ errors:
36
+ models:
37
+ password_forgotten_form:
38
+ attributes:
39
+ new_password:
40
+ too_short: 'The new password is too short (minimum 5 characters)'
41
+ new_password_confirmation:
42
+ confirmation: 'Incorrect password confirmation.'
43
+
44
+ lobby:
45
+
46
+ users:
47
+ new:
48
+ title: 'Register'
49
+ label_email: 'e-mail'
50
+ label_username: 'Username'
51
+ label_password: 'Password'
52
+ label_password_confirmation: 'Password confirmation'
53
+ create:
54
+ success: "To complete the registration please click on the link we've just sent you."
55
+
56
+ sessions:
57
+ destroy:
58
+ success: "You logged out. Bye."
59
+ new:
60
+ title: 'Login'
61
+ label_email: 'e-mail or username'
62
+ label_password: 'password'
63
+ link_password_forgotten: 'Forgot Password?'
64
+ create:
65
+ flash:
66
+ success: "You're in."
67
+ error:
68
+ not_active: "Your account has been disabled."
69
+ not_confirmed: "Please confirm the registration first."
70
+ wrong_password_or_email: "Incorrect email and / or password"
71
+
72
+ info:
73
+ login_status:
74
+ logged_in:
75
+ message_html: "You are logged in as: %{email}. %{logout_link}"
76
+ link1: "log off?"
77
+ logged_out:
78
+ message_html: "You are not logged in. %{signin_link} or %{signup_link}"
79
+ link1: "Sign up?"
80
+ link2: "Log in?"
81
+
82
+ confirmation:
83
+ registration:
84
+ title: "Token"
85
+ resend_signup_token_link: "or send token again."
86
+ flash:
87
+ success: 'Your registration was successful. Now you can login'
88
+ error: 'Your registration could not be confirmed. Was the link incorrect? If your email program does not properly represent the confirmation link, so you can copy it to the field activation token below.'
89
+ resend_signup_token:
90
+ label_email: "E-mail"
91
+ label_password: "Password"
92
+ title: "Send activation token again"
93
+ flash:
94
+ success: "The activation token was again sent"
95
+ error: "You are already confirmed. This link is no longer valid."
96
+
97
+
98
+ password_forgotten:
99
+ recover_password_auth:
100
+ title: 'Create new password'
101
+ label_token: 'Token'
102
+ order_new_password:
103
+ title: "Generate new password"
104
+ label_email: "Your registered e-mail"
105
+ flash:
106
+ success: 'Please check your e-mails. There you will find a link to set your password.'
107
+
108
+ confirmation_mailer:
109
+
110
+ new_email_request:
111
+ subject: 'Confirm new email'
112
+ body: "Hallo,
113
+ to complete the change of your e-mail address at XYZ please click on the following link:
114
+
115
+ %{url}
116
+
117
+ Thank you very much"
118
+
119
+ registration:
120
+ subject: 'Please confirm registration'
121
+ body: "Hello,
122
+ many Thanks for registering with XYZ. To complete your registration please click on the following link:
123
+
124
+ %{url}
125
+
126
+ Thank you very much"
127
+
128
+
129
+ send_password_reset:
130
+ subject: 'Requested new password'
131
+ body: "Hello.
132
+ This is an automatically generated message from XYZ for users who have forgotten their login details. Enclosed you will receive,
133
+    as requested, a link with which you can generate your new password:
134
+
135
+ %{url}
136
+
137
+ Thank you very much"
138
+
139
+
140
+ resend_signup_token:
141
+ subject: 'New registration token'
142
+ body: "Hello.
143
+ This is an automatically generated message from XYZ for users who have lost their registration email. Enclosed you will receive,
144
+    as requested, a link with which you can confirm your registration:
145
+
146
+ %{url}
147
+
148
+ VThank you very much"
@@ -5,8 +5,8 @@ class CreateUsers < ActiveRecord::Migration
5
5
  t.string :password_digest
6
6
  t.string :signup_token
7
7
  t.string :password_token
8
- t.string :new_email
9
- t.string :new_email_token
8
+ # t.string :new_email
9
+ # t.string :new_email_token
10
10
  t.boolean :active
11
11
  t.string :username
12
12
  t.datetime :confirmed, :null => true
@@ -0,0 +1,6 @@
1
+ - if object.errors.any?
2
+ .alert.alert-danger
3
+ %ul
4
+ - for message in object.errors.full_messages
5
+ %li
6
+ = message
@@ -0,0 +1,10 @@
1
+ %h1
2
+ = t '.title'
3
+
4
+ = form_tag new_email_path, {:id => "new_email_token"} do
5
+ .form-group
6
+ = label_tag :token
7
+ = text_field_tag :token
8
+
9
+ .form-actions
10
+ = submit_tag t( "common.button.send" ), :id => "new_email_token_button", :class => 'btn btn-primary'
@@ -0,0 +1,11 @@
1
+ %h1
2
+ = t '.title'
3
+
4
+ = form_tag confirm_path(:registration) do
5
+
6
+ .form-group
7
+ = text_field_tag :token
8
+ .form-group
9
+ = link_to t('.resend_signup_token_link'), resend_signup_token_url, :id => 'resend_signup_token'
10
+ .form-actions
11
+ = submit_tag t( "common.button.send" ), :id => "token_button", :class => 'btn btn-primary'
@@ -0,0 +1,15 @@
1
+ %main
2
+ %page-header
3
+ %h1
4
+ = t '.title'
5
+ .page-main
6
+
7
+ = form_tag confirm_path(:registration) do
8
+ .row
9
+ .col-lg-6
10
+ .form-group
11
+ = text_field_tag :token
12
+ .form-group
13
+ = link_to t('confirmation.registration.resend_signup_token_link'), resend_signup_token_url, :id => 'resend_signup_token'
14
+ .form-actions
15
+ = submit_tag t( "common.button.send" ), :id => "token_button", :class => 'btn btn-primary'
@@ -0,0 +1,13 @@
1
+ %h1
2
+ = t '.title'
3
+
4
+ = form_tag resend_signup_token_url do
5
+
6
+ .form-group
7
+ = label_tag :email, t( ".label_email" )
8
+ = text_field_tag :email, params[:email], :class => 'form-control'
9
+ .form-group
10
+ = label_tag :password, t( ".label_password" )
11
+ = password_field_tag :password, nil, :class => 'form-control'
12
+ .form-actions
13
+ = submit_tag t( "common.button.send" ), :id => "resend_signup_token_button", :class => 'btn btn-primary'
@@ -0,0 +1,17 @@
1
+ %main
2
+ %page-header
3
+ %h1
4
+ = t '.title'
5
+ .page-main
6
+
7
+ = form_tag resend_signup_token_url do
8
+ .row
9
+ .col-lg-6
10
+ .form-group
11
+ = label_tag :email, t( ".label_email" )
12
+ = text_field_tag :email, params[:email], :class => 'form-control'
13
+ .form-group
14
+ = label_tag :password, t( ".label_password" )
15
+ = password_field_tag :password, nil, :class => 'form-control'
16
+ .form-actions
17
+ = submit_tag t( "common.button.send" ), :id => "resend_signup_token_button", :class => 'btn btn-primary'
@@ -0,0 +1 @@
1
+ = t('.body', url: @confirmation_url)