devise-foundation-views 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +49 -0
- data/Rakefile +1 -0
- data/app/assets/stylesheets/devise_foundation_views_less.less +10 -0
- data/app/assets/stylesheets/devise_foundation_views_scss.scss +9 -0
- data/app/views/devise/confirmations/new.html.erb +22 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +6 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +25 -0
- data/app/views/devise/passwords/new.html.erb +21 -0
- data/app/views/devise/registrations/edit.html.erb +31 -0
- data/app/views/devise/registrations/new.html.erb +27 -0
- data/app/views/devise/sessions/new.html.erb +30 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +21 -0
- data/app/views/devise_haml/confirmations/new.html.haml +13 -0
- data/app/views/devise_haml/mailer/confirmation_instructions.html.haml +3 -0
- data/app/views/devise_haml/mailer/reset_password_instructions.html.haml +5 -0
- data/app/views/devise_haml/mailer/unlock_instructions.html.haml +4 -0
- data/app/views/devise_haml/passwords/edit.html.haml +16 -0
- data/app/views/devise_haml/passwords/new.html.haml +13 -0
- data/app/views/devise_haml/registrations/edit.html.haml +22 -0
- data/app/views/devise_haml/registrations/new.html.haml +17 -0
- data/app/views/devise_haml/sessions/new.html.haml +19 -0
- data/app/views/devise_haml/shared/_links.html.haml +19 -0
- data/app/views/devise_haml/unlocks/new.html.haml +13 -0
- data/app/views/devise_slim/confirmations/new.html.slim +13 -0
- data/app/views/devise_slim/mailer/confirmation_instructions.html.slim +4 -0
- data/app/views/devise_slim/mailer/reset_password_instructions.html.slim +6 -0
- data/app/views/devise_slim/mailer/unlock_instructions.html.slim +4 -0
- data/app/views/devise_slim/passwords/edit.html.slim +17 -0
- data/app/views/devise_slim/passwords/new.html.slim +13 -0
- data/app/views/devise_slim/registrations/edit.html.slim +23 -0
- data/app/views/devise_slim/registrations/new.html.slim +18 -0
- data/app/views/devise_slim/sessions/new.html.slim +19 -0
- data/app/views/devise_slim/shared/_links.html.slim +19 -0
- data/app/views/devise_slim/unlocks/new.html.slim +14 -0
- data/devise-foundation-views.gemspec +32 -0
- data/lib/devise-foundation-views.rb +28 -0
- data/lib/devise_foundation_views_helper.rb +22 -0
- data/lib/generators/devise/views/foundation_templates/foundation_templates_generator.rb +25 -0
- data/lib/generators/devise/views/locale/locale_generator.rb +10 -0
- data/lib/version.rb +3 -0
- data/locales/ar.yml +112 -0
- data/locales/ca.yml +59 -0
- data/locales/cs.yml +110 -0
- data/locales/de.yml +110 -0
- data/locales/en.yml +111 -0
- data/locales/es-AR.yml +51 -0
- data/locales/es-ES.yml +59 -0
- data/locales/es.yml +51 -0
- data/locales/fr.yml +51 -0
- data/locales/hu.yml +59 -0
- data/locales/it.yml +51 -0
- data/locales/nl.yml +59 -0
- data/locales/pl.yml +57 -0
- data/locales/pt-BR.yml +56 -0
- data/locales/ru.yml +56 -0
- data/locales/tr.yml +51 -0
- data/locales/uk.yml +56 -0
- data/locales/zh-CN.yml +58 -0
- data/locales/zh-TW.yml +57 -0
- metadata +139 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
|
7
|
+
.row
|
8
|
+
%h5.text-center= t('.title', :resource => resource_class.model_name.human , :default => "Edit #{resource_name.to_s.humanize}")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password", title: "leave blank if you don't want to change it"
|
13
|
+
.row
|
14
|
+
= f.password_field :password_confirmation, autocomplete: "off", class: "large-12 columns", placeholder: "Password Confirmation"
|
15
|
+
.row
|
16
|
+
= f.password_field :current_password, autocomplete: "off", class: "large-12 columns", placeholder: "Current Password", title: "we need your current password to confirm your changes"
|
17
|
+
.row
|
18
|
+
= f.submit t('.update', :default => "Update"), class: "button expand large-12 large-centered columns"
|
19
|
+
%p
|
20
|
+
= t('.unhappy', :default => 'Unhappy')
|
21
|
+
? #{link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete}.
|
22
|
+
= link_to t('.back', :default => 'Back'), :back
|
@@ -0,0 +1,17 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
|
7
|
+
.row
|
8
|
+
%h5.text-center= t('.sign_up', :default => "Sign up")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password"
|
13
|
+
.row
|
14
|
+
= f.password_field :password_confirmation, autocomplete: "off", class: "large-12 columns", placeholder: "Password Confirmation"
|
15
|
+
.row
|
16
|
+
= f.submit t('.sign_up', :default => "Sign up"), class: "button expand large-12 large-centered columns"
|
17
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
7
|
+
.row
|
8
|
+
%h5.text-center= t('.sign_in', :default => "Sign in")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password"
|
13
|
+
- if devise_mapping.rememberable?
|
14
|
+
.row
|
15
|
+
= f.check_box :remember_me
|
16
|
+
= f.label :remember_me
|
17
|
+
.row
|
18
|
+
= f.submit t('.sign_in', :default => "Sign in"), class: "button expand large-12 large-centered columns"
|
19
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- if controller_name != 'sessions'
|
2
|
+
= link_to t(".sign_in", :default => "Sign in"), new_session_path(resource_name)
|
3
|
+
%br/
|
4
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
5
|
+
= link_to t(".sign_up", :default => "Sign up"), new_registration_path(resource_name)
|
6
|
+
%br/
|
7
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
8
|
+
= link_to t(".forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name)
|
9
|
+
%br/
|
10
|
+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
11
|
+
= link_to t('.didn_t_receive_confirmation_instructions', :default => "Didn't receive confirmation instructions?"), new_confirmation_path(resource_name)
|
12
|
+
%br/
|
13
|
+
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
14
|
+
= link_to t('.didn_t_receive_unlock_instructions', :default => "Didn't receive unlock instructions?"), new_unlock_path(resource_name)
|
15
|
+
%br/
|
16
|
+
- if devise_mapping.omniauthable?
|
17
|
+
- resource_class.omniauth_providers.each do |provider|
|
18
|
+
= link_to t('.sign_in_with_provider', :provider => provider.to_s.titleize, :default => "Sign in with #{provider.to_s.titleize}"), omniauth_authorize_path(resource_name, provider)
|
19
|
+
%br/
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post}) do |f|
|
7
|
+
.row
|
8
|
+
%h5.text-center= t('.resend_unlock_instructions', :default => "Resend unlock instructions")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions"), class: "button expand large-12 large-centered columns"
|
13
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post}) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions')
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.submit t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions'), class: "button expand large-12 large-centered columns"
|
13
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,4 @@
|
|
1
|
+
p= t('.greeting', :recipient => @resource.email, :default => "Welcome # @resource.email !")
|
2
|
+
p= t('.instruction', :default => "You can confirm your account email through the link below:")
|
3
|
+
p= link_to t('.action', :default => "Confirm my account"),confirmation_url(@resource, :confirmation_token => @token, locale: I18n.locale)
|
4
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
p= t('.greeting', :recipient => @resource.email, :default => "Hello # @resource.email !")
|
2
|
+
p= t('.instruction', :default => "Someone has requested a link to change your password, and you can do this through the link below.")
|
3
|
+
p= link_to t('.action', :default => "Change my password"), edit_password_url(@resource, :reset_password_token => @token, locale: I18n.locale)
|
4
|
+
p= t('.instruction_2', :default => "If you didn't request this, please ignore this email.")
|
5
|
+
p= t('.instruction_3', :default => "Your password won't change until you access the link above and create a new one.")
|
6
|
+
|
@@ -0,0 +1,4 @@
|
|
1
|
+
p= t('.greeting', :recipient => @resource.email, :default => "Hello # @resource.email !")
|
2
|
+
p= t('.message', :default => "Your account has been locked due to an excessive amount of unsuccessful sign in attempts.")
|
3
|
+
p= t('.instruction', :default => "Click the link below to unlock your account:")
|
4
|
+
p= link_to t('.action', :default => "Unlock my account"), unlock_url(@resource, :unlock_token => @resource.unlock_token, locale: I18n.locale)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put}) do |f|
|
7
|
+
= f.hidden_field :reset_password_token
|
8
|
+
.row
|
9
|
+
h5.text-center= t('.change_your_password', :default => 'Change your password')
|
10
|
+
.row
|
11
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "New Password"
|
12
|
+
.row
|
13
|
+
= f.password_field :password_confirmation, autocomplete: "off", class: "large-12 columns", placeholder: "Confirm New Password"
|
14
|
+
.row
|
15
|
+
= f.submit t('.change_my_password', :default => 'Change my password'), class: "button expand large-12 large-centered columns"
|
16
|
+
= render "devise/shared/links"
|
17
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post}) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.forgot_your_password', :default => 'Forgot your password?')
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.submit t('.send_me_reset_password_instructions', :default => "Send me reset password instructions"), class: "button expand large-12 large-centered columns"
|
13
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.title', :resource => resource_class.model_name.human , :default => "Edit # resource_name.to_s.humanize ")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password", title: "leave blank if you don't want to change it"
|
13
|
+
.row
|
14
|
+
= f.password_field :password_confirmation, autocomplete: "off", class: "large-12 columns", placeholder: "Password Confirmation"
|
15
|
+
.row
|
16
|
+
= f.password_field :current_password, autocomplete: "off", class: "large-12 columns", placeholder: "Current Password", title: "we need your current password to confirm your changes"
|
17
|
+
.row
|
18
|
+
= f.submit t('.update', :default => "Update"), class: "button expand large-12 large-centered columns"
|
19
|
+
p
|
20
|
+
= t('.unhappy', :default => 'Unhappy')
|
21
|
+
| ? #{link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete}.
|
22
|
+
= link_to t('.back', :default => 'Back'), :back
|
23
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.sign_up', :default => "Sign up")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password"
|
13
|
+
.row
|
14
|
+
= f.password_field :password_confirmation, autocomplete: "off", class: "large-12 columns", placeholder: "Password Confirmation"
|
15
|
+
.row
|
16
|
+
= f.submit t('.sign_up', :default => "Sign up"), class: "button expand large-12 large-centered columns"
|
17
|
+
= render "devise/shared/links"
|
18
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.sign_in', :default => "Sign in")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.password_field :password, autocomplete: "off", class: "large-12 columns", placeholder: "Password"
|
13
|
+
- if devise_mapping.rememberable?
|
14
|
+
.row
|
15
|
+
= f.check_box :remember_me
|
16
|
+
= f.label :remember_me
|
17
|
+
.row
|
18
|
+
= f.submit t('.sign_in', :default => "Sign in"), class: "button expand large-12 large-centered columns"
|
19
|
+
= render "devise/shared/links"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- if controller_name != 'sessions'
|
2
|
+
= link_to t(".sign_in", :default => "Sign in"), new_session_path(resource_name)
|
3
|
+
br/
|
4
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
5
|
+
= link_to t(".sign_up", :default => "Sign up"), new_registration_path(resource_name)
|
6
|
+
br/
|
7
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
8
|
+
= link_to t(".forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name)
|
9
|
+
br/
|
10
|
+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
11
|
+
= link_to t('.didn_t_receive_confirmation_instructions', :default => "Didn't receive confirmation instructions?"), new_confirmation_path(resource_name)
|
12
|
+
br/
|
13
|
+
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
14
|
+
= link_to t('.didn_t_receive_unlock_instructions', :default => "Didn't receive unlock instructions?"), new_unlock_path(resource_name)
|
15
|
+
br/
|
16
|
+
- if devise_mapping.omniauthable?
|
17
|
+
- resource_class.omniauth_providers.each do |provider|
|
18
|
+
= link_to t('.sign_in_with_provider', :provider => provider.to_s.titleize, :default => "Sign in with #{provider.to_s.titleize}"), omniauth_authorize_path(resource_name, provider)
|
19
|
+
br/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= foundation_devise_error_messages!
|
2
|
+
.large-3.large-centered.columns
|
3
|
+
.login-box
|
4
|
+
.row
|
5
|
+
.large-12.columns
|
6
|
+
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post}) do |f|
|
7
|
+
.row
|
8
|
+
h5.text-center= t('.resend_unlock_instructions', :default => "Resend unlock instructions")
|
9
|
+
.row
|
10
|
+
= f.email_field :email, autofocus: true, class: "large-12 columns", placeholder: "Email"
|
11
|
+
.row
|
12
|
+
= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions"), class: "button expand large-12 large-centered columns"
|
13
|
+
= render "devise/shared/links"
|
14
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "devise-foundation-views"
|
8
|
+
spec.version = DeviseFoundationViews::VERSION
|
9
|
+
spec.authors = ["ethi"]
|
10
|
+
spec.email = ["ethirajsrinivasan@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Devise views based on foundation framework"
|
13
|
+
spec.description = "Devise views based on foundation framework"
|
14
|
+
spec.homepage = "https://github.com/ethirajsrinivasan/devise-foundation-views"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'devise_foundation_views_helper'
|
3
|
+
module DeviseFoundationViews
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
end
|
6
|
+
|
7
|
+
class Railtie < ::Rails::Railtie
|
8
|
+
initializer 'rails-devise-foundation-views' do |app|
|
9
|
+
DeviseFoundationViews::Railtie.instance_eval do
|
10
|
+
pattern = pattern_from app.config.i18n.available_locales
|
11
|
+
|
12
|
+
files = Dir[File.join(File.dirname(__FILE__), '../locales', "#{pattern}.yml")]
|
13
|
+
I18n.load_path.concat(files)
|
14
|
+
|
15
|
+
ActionView::Base.send :include, DeviseFoundationViewsHelper
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def self.pattern_from(args)
|
22
|
+
array = Array(args || [])
|
23
|
+
array.blank? ? '*' : "{#{array.join ','}}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
module DeviseFoundationViewsHelper
|
4
|
+
def foundation_devise_error_messages!
|
5
|
+
return '' if resource.errors.empty?
|
6
|
+
|
7
|
+
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
|
8
|
+
sentence = I18n.t('errors.messages.not_saved',
|
9
|
+
count: resource.errors.count,
|
10
|
+
resource: resource.class.model_name.human.downcase)
|
11
|
+
|
12
|
+
html = <<-HTML
|
13
|
+
<div data-alert class="alert-box alert radius">
|
14
|
+
<h5>#{sentence}</h5>
|
15
|
+
<ul>#{messages}</ul>
|
16
|
+
<a href="#" class="close">×</a>
|
17
|
+
</div>
|
18
|
+
HTML
|
19
|
+
|
20
|
+
html.html_safe
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Devise
|
2
|
+
module Views
|
3
|
+
class FoundationTemplatesGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../../../../../../app/views', __FILE__)
|
5
|
+
argument :template_name, :type => :string, :default => "devise"
|
6
|
+
def copy_views
|
7
|
+
directory(template, Rails.root.join("app", "views", "devise"))
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
def template
|
12
|
+
case template_name
|
13
|
+
when "devise"
|
14
|
+
"devise"
|
15
|
+
when "slim"
|
16
|
+
"devise_slim"
|
17
|
+
when "haml"
|
18
|
+
"devise_haml"
|
19
|
+
else
|
20
|
+
raise "Template not available for #{template_name}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Devise
|
2
|
+
module Views
|
3
|
+
class LocaleGenerator < Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path('../../../../../../locales', __FILE__)
|
5
|
+
def copy_locale
|
6
|
+
copy_file("#{name}.yml", Rails.root.join("config", "locales", "devise.views.#{name}.yml"))
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/version.rb
ADDED
data/locales/ar.yml
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
ar:
|
2
|
+
devise:
|
3
|
+
confirmations:
|
4
|
+
new:
|
5
|
+
resend_confirmation_instructions: "أعدْ إرسال تعليمات التأكيد"
|
6
|
+
confirmed: "تم تأكيد حسابك بنجاح"
|
7
|
+
send_instructions: "ستستلم بريدًا إلكترونيًا بالتعليمات حول كيفية تأكيد حسابك خلال دقائق."
|
8
|
+
send_paranoid_instructions: "إن كان بريدك الإلكتروني موجود في قاعدة البيانات، ستستلم بريدًا إلكترونيًا بالتعليمات حول كيفية حول تأكيد حسابك خلال دقائق."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "أنت بالفعل مسجّلًا دخولك."
|
11
|
+
inactive: "لم يُفعّل حسابك بعد."
|
12
|
+
invalid: "البريد الإلكتروني أو كلمة السر غير صالحة"
|
13
|
+
invalid_token: "توثيق غير صالح"
|
14
|
+
locked: "قُفل حسابك"
|
15
|
+
not_found_in_database: "البريد الإلكتروني أو كلمة السر غير صالحة"
|
16
|
+
timeout: "انتهت صالحية الجلسة. فضلًا سجّل دخولك مرّة أخرى للمتابعة."
|
17
|
+
unauthenticated: "يتوجّب تسجيل الدخول أو التسجيل قبل المتابعة."
|
18
|
+
unconfirmed: "يتوجّب تأكيد حسابك قبل المتابعة."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
action: "أكّد حسابي"
|
22
|
+
greeting: "مرحبًا %{recipient}"
|
23
|
+
instruction: "يمكن تأكيد حساب بريدك الإلكتروني من خلال الرابط التّالي:"
|
24
|
+
subject: "تعليمات التأكيد"
|
25
|
+
reset_password_instructions:
|
26
|
+
action: "غيّر كلمة السر"
|
27
|
+
greeting: "مرحبًا %{recipient}!"
|
28
|
+
instruction: "طلب أحدهم رابطًا لتغيير كلمة السر الخاصة بك، ويُمكن عمل ذلك من خلال الرابط التالي."
|
29
|
+
instruction_2: "إن لم تكن أنت من طلب هذا، من فضلك تجاهل هذه الرسالة."
|
30
|
+
instruction_3: "لن تتغيّر كلمة السر الخاصة بك حتى تتبع الرابط السابق وتُنشئ كلمة سر جديدة."
|
31
|
+
subject: "تعليمات تصفير كلمة المرور"
|
32
|
+
unlock_instructions:
|
33
|
+
action: "أزل الحظر عن حسابي"
|
34
|
+
greeting: "مرحبًا %{recipient}"
|
35
|
+
instruction: "انقرْ الرابط على الرابط التالي لفك الحظر عن حسابك:"
|
36
|
+
message: "قُفل حسابك بسبب المحاولات الفاشلة في تسجيل الدخول."
|
37
|
+
subject: "تعليمات فك الحظر"
|
38
|
+
omniauth_callbacks:
|
39
|
+
failure: "لم يتم تصديقك من %{kind} بسبب \"%{reason}\"."
|
40
|
+
success: "صُدّق بنجاح من الحساب %{kind}."
|
41
|
+
passwords:
|
42
|
+
new:
|
43
|
+
forgot_your_password: "هل نسيت كلمة المرور؟"
|
44
|
+
send_me_reset_password_instructions: "أرسلْ لي تعليمات تصفير كلمة المرور"
|
45
|
+
edit:
|
46
|
+
change_your_password: "غيّر كلمة المرور الخاصة بك"
|
47
|
+
new_password: "كلمة سر جديدة"
|
48
|
+
confirm_new_password: "أكّد كلمة السر الجديدة"
|
49
|
+
change_my_password: "غيّر كلمة المرور خاصتي"
|
50
|
+
no_token: "لا يُمكن الدّخول إلى هذه الصفحة إلّا بإستخدام رسالة تصفير كلمة المرور. إن كان الوصول لهذه الصفحة عبر تلك الرسالة فالرجاء التأكد من فتح كامل الرابط بشكل صحيح."
|
51
|
+
send_instructions: "ستصل خلال دقائق رسالة بريد إلكتروني تحوي التعليمات اللازمة لإعادة ضبط كلمة السر."
|
52
|
+
send_paranoid_instructions: "إذا كان بريدك الإلكتروني مسجلاً عندنا فستصل إليه خلال دقائق رسالة تتضمّن رابطاً لاستعادة كلمة المرور."
|
53
|
+
updated: "لقد تمّ تغيير كلمة المرور بنجاح، وتم تسجيل الدخول."
|
54
|
+
updated_not_active: "تمّ تعديل كلمة المرور بنجاح."
|
55
|
+
registrations:
|
56
|
+
edit:
|
57
|
+
are_you_sure: "هل أنت متأكّد؟"
|
58
|
+
cancel_my_account: "ألغِ حسابي"
|
59
|
+
leave_blank_if_you_don_t_want_to_change_it: "أبقه فارغًا إن كنت لا ترغب في تغييره"
|
60
|
+
title: "تعديل %{resource}"
|
61
|
+
we_need_your_current_password_to_confirm_your_changes: "نحتاج كلمة المرور الحالية خاصتك لتأكيد تغيراتك"
|
62
|
+
update: "تحديث"
|
63
|
+
unhappy: "غير راضٍ؟"
|
64
|
+
back: "عودة"
|
65
|
+
new:
|
66
|
+
sign_up: "سجّلْ"
|
67
|
+
destroyed: "لقد تمّت إزالة الحساب، نأمل في نتقابل مجدداً في وقت قريب، إلى اللقاء!"
|
68
|
+
signed_up: "تمّ التسجيل في الموقع بنجاح، أهلاً وسهلاً!"
|
69
|
+
signed_up_but_inactive: "تمّ التسجيل في الموقع بنجاح، ولكن لا يُمكن تسجيل الدخول قبل تفعيل الحساب."
|
70
|
+
signed_up_but_locked: "تمّ التسجيل في الموقع بنجاح، ولكن لا يمكن تسجيل الدخول ?ن الحساب مُعلّق."
|
71
|
+
signed_up_but_unconfirmed: "تمّ إرسال رسالة تحوي على رابط تأكيد الحساب باستخدام البريد الإلكتروني، يُرجى فتح الرابط لتفعيل الحساب."
|
72
|
+
update_needs_confirmation: "تُم تعديل الحساب بنجاح، يرجى تأكيد البريد الإلكتروني. الرجاء الذهاب الى البريد الإلكتروني والضغط على الرابط الموجود للانتهاء من عمليّة التاكيد."
|
73
|
+
updated: "تمّ تعديل الحساب بنجاح."
|
74
|
+
sessions:
|
75
|
+
signed_in: "تمّ تسجيل الدخول."
|
76
|
+
signed_out: "تمّ تسجيل الخروج."
|
77
|
+
new:
|
78
|
+
sign_in: "تسجيل الدخول"
|
79
|
+
shared:
|
80
|
+
links:
|
81
|
+
didn_t_receive_confirmation_instructions: "ألم تستلم تعليمات التأكيد؟"
|
82
|
+
didn_t_receive_unlock_instructions: "ألم تستلم تعليمات فك الحظر؟"
|
83
|
+
forgot_your_password: "هل نسيت كلمة المرور؟"
|
84
|
+
sign_in: "سجّلْ الدخول"
|
85
|
+
sign_in_with_provider: "سجّلْ الدخول عن طريق %{provider}"
|
86
|
+
sign_up: "سجّلْ"
|
87
|
+
unlocks:
|
88
|
+
new:
|
89
|
+
resend_unlock_instructions: "أعدْ إرسال تعليمات فك الحظر"
|
90
|
+
send_instructions: "خلال بضعة دقائق، سوف تصل رسالة بالتعليمات اللازمة لإعادة تفعيل الحساب."
|
91
|
+
send_paranoid_instructions: "إذا كان الحساب موجوداً، ستصل رسالة خلال دقائق تتضمّن الارشادات عن كيفيّة التفعيل."
|
92
|
+
unlocked: "لقد تمّ فتح الحساب بنجاح. الرجاء الدخول للاستمرار."
|
93
|
+
errors:
|
94
|
+
messages:
|
95
|
+
already_confirmed: "الحساب مُفعّل، الرجاء محاولة تسجيل الدخول"
|
96
|
+
confirmation_period_expired: "بحاجة الى تفعيل خلال %{period}، الرجاء طلب تفعيل"
|
97
|
+
expired: "انتهت الصلاحيّة، الرجاء عمل طلب جديد"
|
98
|
+
not_found: "غير موجود"
|
99
|
+
not_locked: "غير مقفل"
|
100
|
+
not_saved:
|
101
|
+
one: "يوجد خطأ واحد منع هذا %{resource} من الحفظ:"
|
102
|
+
other: "%{count} من الأخطاء منعت هذا %{resource} من الحفظ:"
|
103
|
+
activerecord:
|
104
|
+
models:
|
105
|
+
user: "مستخدم"
|
106
|
+
attributes:
|
107
|
+
user:
|
108
|
+
current_sign_in_at: "سُجّل عند"
|
109
|
+
email: "البريد الإلكتروني"
|
110
|
+
password: "كلمة المرور"
|
111
|
+
last_sign_in_at: "تسجيل الدخول الأخير عند"
|
112
|
+
|