devise-i18n-views 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,10 +1,5 @@
1
1
  source "http://rubygems.org"
2
- # Add dependencies required to use your gem here.
3
- # Example:
4
- # gem "activesupport", ">= 2.3.5"
5
2
 
6
- # Add dependencies to develop your gem here.
7
- # Include everything needed to run rake, tests, features, etc.
8
3
  group :development do
9
4
  gem "bundler"
10
5
  gem "jeweler", "~> 1.8.3"
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # devise-i18n-views
2
+
3
+ I18n support and translations to **[Devise v2.+](https://github.com/plataformatec/devise)** views.
4
+
5
+ ## Install
6
+
7
+ Add the following line in your `Gemfile`
8
+
9
+ ``` rb
10
+ gem 'devise-i18n-views'
11
+ ```
12
+
13
+ ## Translation file stub
14
+
15
+ Please refer to [config/locales/en.yml](https://github.com/mcasimir/devise-i18n-views/blob/master/config/locales/en.yml) to grab a stub for your translation
16
+
17
+ ## Submit or edit a translation for devise-i18n-views
18
+
19
+ * Fork the latest master
20
+ * Create a translation file or edit an existing one under `config/locales`
21
+ * Make a pull request
22
+
23
+ ## Copyright
24
+
25
+ Copyright (c) 2012 mcasimir. See LICENSE.txt for
26
+ further details.
27
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.1.0
@@ -0,0 +1,3 @@
1
+ <% ActiveSupport::Deprecation.warn "Rendering partials devise/_links.erb is deprecated" \
2
+ "please use devise/shared/_links.erb instead."%>
3
+ <%= render "shared/links" %>
@@ -0,0 +1,12 @@
1
+ <h2><%= t('devise.views.confirmations.new.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= t('devise.views.confirmations.new.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></div>
10
+ <% end %>
11
+
12
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,6 @@
1
+ <p><%= t('devise.mailer.confirmation_instructions.greeting', :recepient => @resource.email, :default => "Welcome #{@resource.email}!") %></p>
2
+
3
+ <p><%= t('devise.mailer.confirmation_instructions.instruction', :default => "You can confirm your account email through the link below:") %></p>
4
+
5
+ <p><%= link_to t('devise.mailer.confirmation_instructions.action', :default => "Confirm my account"),
6
+ confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -0,0 +1,8 @@
1
+ <p><%= t('devise.mailer.reset_password_instructions.greeting', :recepient => @resource.email, :default => "Hello #{@resource.email}!") %></p>
2
+
3
+ <p><%= t('devise.mailer.reset_password_instructions.instruction', :default => "Someone has requested a link to change your password, and you can do this through the link below.") %></p>
4
+
5
+ <p><%= link_to t('devise.mailer.reset_password_instructions.action', :default => "Change my password"), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
6
+
7
+ <p><%= t('devise.mailer.reset_password_instructions.instruction_2', :default => "If you didn't request this, please ignore this email.") %></p>
8
+ <p><%= t('devise.mailer.reset_password_instructions.instruction_3', :default => "Your password won't change until you access the link above and create a new one.") %></p>
@@ -0,0 +1,7 @@
1
+ <p><%= t('devise.mailer.unlock_instructions.greeting', :recepient => @resource.email, :default => "Hello #{@resource.email}!") %></p>
2
+
3
+ <p><%= t('devise.mailer.unlock_instructions.message', :default => "Your account has been locked due to an excessive amount of unsuccessful sign in attempts.") %></p>
4
+
5
+ <p><%= t('devise.mailer.unlock_instructions.instruction', :default => "Click the link below to unlock your account:") %></p>
6
+
7
+ <p><%= link_to t('devise.mailer.unlock_instructions.action', :default => "Unlock my account"), unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -0,0 +1,16 @@
1
+ <h2>Change your password</h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+
7
+ <div><%= f.label :password, "New password" %><br />
8
+ <%= f.password_field :password %></div>
9
+
10
+ <div><%= f.label :password_confirmation, "Confirm new password" %><br />
11
+ <%= f.password_field :password_confirmation %></div>
12
+
13
+ <div><%= f.submit "Change my password" %></div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,12 @@
1
+ <h2><%= t('devise.views.passwords.new.forgot_your_password', :default => 'Forgot your password?') %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.submit t('devise.views.passwords.new.send_me_reset_password_instructions', :default => "Send me reset password instructions") %></div>
10
+ <% end %>
11
+
12
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,25 @@
1
+ <h2><%= t('devise.views.registrations.edit.title', :resource => resource_name.to_s.humanize , :default => 'Edit #{resource_name.to_s.humanize}') %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.label :password %> <i>(<%= t('devise.views.registrations.edit.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)</i><br />
10
+ <%= f.password_field :password, :autocomplete => "off" %></div>
11
+
12
+ <div><%= f.label :password_confirmation %><br />
13
+ <%= f.password_field :password_confirmation %></div>
14
+
15
+ <div><%= f.label :current_password %> <i>(<%= t('devise.views.registrations.edit.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes') %>)</i><br />
16
+ <%= f.password_field :current_password %></div>
17
+
18
+ <div><%= f.submit "Update" %></div>
19
+ <% end %>
20
+
21
+ <h3>Cancel my account</h3>
22
+
23
+ <p>Unhappy? <%= link_to t('devise.views.registrations.edit.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('devise.views.registrations.edit.are_you_sure', :default => "Are you sure?") }, :method => :delete %>.</p>
24
+
25
+ <%= link_to "Back", :back %>
@@ -0,0 +1,18 @@
1
+ <h2><%= t('devise.views.registrations.new.sign_up', :default => "Sign up") %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.label :password %><br />
10
+ <%= f.password_field :password %></div>
11
+
12
+ <div><%= f.label :password_confirmation %><br />
13
+ <%= f.password_field :password_confirmation %></div>
14
+
15
+ <div><%= f.submit t('devise.views.registrations.new.sign_up', :default => "Sign up") %></div>
16
+ <% end %>
17
+
18
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,17 @@
1
+ <h2><%= t('devise.views.sessions.new.sign_in', :default => "Sign in") %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
4
+ <div><%= f.label :email %><br />
5
+ <%= f.email_field :email %></div>
6
+
7
+ <div><%= f.label :password %><br />
8
+ <%= f.password_field :password %></div>
9
+
10
+ <% if devise_mapping.rememberable? -%>
11
+ <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
12
+ <% end -%>
13
+
14
+ <div><%= f.submit t('devise.views.sessions.new.sign_in', :default => "Sign in") %></div>
15
+ <% end %>
16
+
17
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to t("devise.views.links.sign_in", :default => "Sign in"), new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to t("devise.views.links.sign_up", :default => "Sign up"), new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
+ <%= link_to t("devise.views.links.forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to t('devise.views.links.didn_t_receive_confirmation_instructions', :default => "Didn't receive confirmation instructions?"), new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to t('devise.views.links.didn_t_receive_unlock_instructions', :default => "Didn't receive unlock instructions?"), new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to t('devise.views.links.sign_in_with_provider', :provider => provider.to_s.titleize, :default => "Sign in with #{provider.to_s.titleize}"), omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,12 @@
1
+ <h2><%= t('devise.views.unlocks.new.resend_unlock_instructions', :default => "Resend unlock instructions") %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <div><%= f.label :email %><br />
7
+ <%= f.email_field :email %></div>
8
+
9
+ <div><%= f.submit t('devise.views.unlocks.new.resend_unlock_instructions', :default => "Resend unlock instructions") %></div>
10
+ <% end %>
11
+
12
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,50 @@
1
+ en:
2
+ devise:
3
+ mailer:
4
+ confirmation_instructions:
5
+ subject: "Confirmation instructions"
6
+ greeting: "Welcome %{recepient}!"
7
+ instruction: "You can confirm your account email through the link below:"
8
+ action: "Confirm my account"
9
+ reset_password_instructions:
10
+ subject: "Reset password instructions"
11
+ greeting: "Hello %{recepient}!"
12
+ instruction: "Someone has requested a link to change your password, and you can do this through the link below."
13
+ action: "Change my password"
14
+ instruction_2: "If you didn't request this, please ignore this email."
15
+ instruction_3: "Your password won't change until you access the link above and create a new one."
16
+ unlock_instructions:
17
+ subject: "Unlock Instructions"
18
+ greeting: "Hello %{recepient}!"
19
+ message: "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
20
+ instruction: "Click the link below to unlock your account:"
21
+ action: "Unlock my account"
22
+ views:
23
+ confirmations:
24
+ new:
25
+ resend_confirmation_instructions: "Resend confirmation instructions"
26
+ passwords:
27
+ new:
28
+ forgot_your_password: "Forgot your password?"
29
+ send_me_reset_password_instructions: "Send me reset password instructions"
30
+ registrations:
31
+ edit:
32
+ title: "Edit %{resource}"
33
+ leave_blank_if_you_don_t_want_to_change_it: "leave blank if you dont want to change it"
34
+ we_need_your_current_password_to_confirm_your_changes: "we need your current password to confirm your changes"
35
+ cancel_my_account: "Cancel my account"
36
+ are_you_sure: "Are you sure?"
37
+ new:
38
+ sign_up: "Sign up"
39
+ sessions:
40
+ new:
41
+ sign_in: "Sign in"
42
+ links:
43
+ didn_t_receive_confirmation_instructions: "Didn't receive confirmation instructions?"
44
+ didn_t_receive_unlock_instructions: "Didn't receive unlock instructions?"
45
+ forgot_your_password: "Forgot your password?"
46
+ sign_up: "Sign up"
47
+ sign_in_with_provider: "Sign in with %{provider}"
48
+ unlocks:
49
+ new:
50
+ resend_unlock_instructions: "Resend unlock instructions"
@@ -0,0 +1,51 @@
1
+ it:
2
+ devise:
3
+ mailer:
4
+ confirmation_instructions:
5
+ subject: 'Istruzioni per la conferma'
6
+ greeting: 'Benvenuto %{recepient}!'
7
+ instruction: 'Puoi confermare il tuo account cliccando sul link qui sotto:'
8
+ action: 'Conferma il mio account'
9
+ reset_password_instructions:
10
+ subject: 'Istruzioni per resettare la password'
11
+ greeting: 'Ciao %{recepient}!'
12
+ instruction: 'Qualcuno ha richiesto di resettare la tua password, se lo vuoi davvero puoi farlo cliccando sul link qui sotto.'
13
+ action: 'Cambia la mia password'
14
+ instruction_2: "Se non sei stato tu ad effettuare questa richiesta puoi ignorare questa mail."
15
+ instruction_3: "La tua password non cambierà finchè non accederai al link sopra."
16
+ unlock_instructions:
17
+ subject: 'Istruzioni per lo sblocco'
18
+ greeting: 'Ciao %{recepient}!'
19
+ message: 'Il tuo account è stato bloccato a seguito di un numero eccessivo di tentativi di accesso falliti.'
20
+ instruction: 'Clicca sul link qui sotto per sbloccare il tuo account:'
21
+ action: "Sblocca il mio account"
22
+ views:
23
+ confirmations:
24
+ new:
25
+ resend_confirmation_instructions: "Invia di nuovo le istruzioni per la conferma"
26
+ passwords:
27
+ new:
28
+ forgot_your_password: "Password dimenticata?"
29
+ send_me_reset_password_instructions: "Inviami le istruzioni per resettare la password"
30
+ registrations:
31
+ edit:
32
+ title: "Modifica %{resource}"
33
+ leave_blank_if_you_don_t_want_to_change_it: "lascia in bianco se non vuoi cambiarla"
34
+ we_need_your_current_password_to_confirm_your_changes: "abbiamo bisogno della tua password attuale per confermare i cambiamenti"
35
+ cancel_my_account: "Rimuovi il mio account"
36
+ are_you_sure: "Sei sicuro?"
37
+ new:
38
+ sign_up: "Registrati"
39
+ sessions:
40
+ new:
41
+ sign_in: "Accedi"
42
+ links:
43
+ forgot_your_password: "Password dimenticata?"
44
+ sign_up: "Registrati"
45
+ sign_in_with_provider: "Sign in with %{provider}"
46
+ didn_t_receive_confirmation_instructions: "Non hai ricevuto le istruzioni per la conferma?"
47
+ didn_t_receive_unlock_instructions: "Non hai ricevuto le istruzioni per lo sblocco?"
48
+ unlocks:
49
+ new:
50
+ resend_unlock_instructions: "Invia di nuovo le istruzioni per lo sblocco"
51
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "devise-i18n-views"
8
- s.version = "0.0.1"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
@@ -14,20 +14,32 @@ Gem::Specification.new do |s|
14
14
  s.email = "maurizio.cas@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
- "README.rdoc"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
23
  "LICENSE.txt",
24
- "README.rdoc",
24
+ "README.md",
25
25
  "Rakefile",
26
26
  "VERSION",
27
+ "app/views/devise/_links.erb",
28
+ "app/views/devise/confirmations/new.html.erb",
29
+ "app/views/devise/mailer/confirmation_instructions.html.erb",
30
+ "app/views/devise/mailer/reset_password_instructions.html.erb",
31
+ "app/views/devise/mailer/unlock_instructions.html.erb",
32
+ "app/views/devise/passwords/edit.html.erb",
33
+ "app/views/devise/passwords/new.html.erb",
34
+ "app/views/devise/registrations/edit.html.erb",
35
+ "app/views/devise/registrations/new.html.erb",
36
+ "app/views/devise/sessions/new.html.erb",
37
+ "app/views/devise/shared/_links.erb",
38
+ "app/views/devise/unlocks/new.html.erb",
39
+ "config/locales/en.yml",
40
+ "config/locales/it.yml",
27
41
  "devise-i18n-views.gemspec",
28
- "lib/devise-i18n-views.rb",
29
- "test/helper.rb",
30
- "test/test_devise-i18n-views.rb"
42
+ "lib/devise-i18n-views.rb"
31
43
  ]
32
44
  s.homepage = "http://github.com/mcasimir/devise-i18n-views"
33
45
  s.licenses = ["MIT"]
@@ -0,0 +1,5 @@
1
+ require 'rails'
2
+ module DeviseI18nViews
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-i18n-views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -49,19 +49,31 @@ executables: []
49
49
  extensions: []
50
50
  extra_rdoc_files:
51
51
  - LICENSE.txt
52
- - README.rdoc
52
+ - README.md
53
53
  files:
54
54
  - .document
55
55
  - Gemfile
56
56
  - Gemfile.lock
57
57
  - LICENSE.txt
58
- - README.rdoc
58
+ - README.md
59
59
  - Rakefile
60
60
  - VERSION
61
+ - app/views/devise/_links.erb
62
+ - app/views/devise/confirmations/new.html.erb
63
+ - app/views/devise/mailer/confirmation_instructions.html.erb
64
+ - app/views/devise/mailer/reset_password_instructions.html.erb
65
+ - app/views/devise/mailer/unlock_instructions.html.erb
66
+ - app/views/devise/passwords/edit.html.erb
67
+ - app/views/devise/passwords/new.html.erb
68
+ - app/views/devise/registrations/edit.html.erb
69
+ - app/views/devise/registrations/new.html.erb
70
+ - app/views/devise/sessions/new.html.erb
71
+ - app/views/devise/shared/_links.erb
72
+ - app/views/devise/unlocks/new.html.erb
73
+ - config/locales/en.yml
74
+ - config/locales/it.yml
61
75
  - devise-i18n-views.gemspec
62
76
  - lib/devise-i18n-views.rb
63
- - test/helper.rb
64
- - test/test_devise-i18n-views.rb
65
77
  homepage: http://github.com/mcasimir/devise-i18n-views
66
78
  licenses:
67
79
  - MIT
@@ -77,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
89
  version: '0'
78
90
  segments:
79
91
  - 0
80
- hash: 1249341234517251538
92
+ hash: -3759659252338301753
81
93
  required_rubygems_version: !ruby/object:Gem::Requirement
82
94
  none: false
83
95
  requirements:
data/README.rdoc DELETED
@@ -1,19 +0,0 @@
1
- = devise-i18n-views
2
-
3
- Description goes here.
4
-
5
- == Contributing to devise-i18n-views
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
- * Fork the project.
10
- * Start a feature/bugfix branch.
11
- * Commit and push until you are happy with your contribution.
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2012 mcasimir. See LICENSE.txt for
18
- further details.
19
-
data/test/helper.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'devise-i18n-views'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestDeviseI18nViews < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end