devise_invitable 1.7.5 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise_invitable might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.rdoc +98 -111
- data/app/controllers/devise/invitations_controller.rb +41 -40
- data/app/controllers/devise_invitable/registrations_controller.rb +11 -11
- data/app/views/devise/invitations/edit.html.erb +14 -8
- data/app/views/devise/invitations/new.html.erb +11 -7
- data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
- data/config/locales/ar.yml +23 -0
- data/config/locales/da.yml +41 -0
- data/config/locales/de.yml +31 -0
- data/config/locales/es.yml +31 -0
- data/config/locales/et.yml +23 -0
- data/config/locales/fa.yml +31 -0
- data/config/locales/fr.yml +34 -0
- data/config/locales/it.yml +31 -0
- data/config/locales/ja.yml +31 -0
- data/config/locales/ko.yml +24 -0
- data/config/locales/nl.yml +32 -0
- data/config/locales/no.yml +17 -0
- data/config/locales/pl.yml +31 -0
- data/config/locales/pt-BR.yml +23 -0
- data/config/locales/pt.yml +23 -0
- data/config/locales/ru.yml +23 -0
- data/config/locales/tr.yml +24 -0
- data/config/locales/ua.yml +31 -0
- data/config/locales/vi.yml +25 -0
- data/config/locales/zh-HK.yml +31 -0
- data/config/locales/zh-TW.yml +31 -0
- data/lib/devise_invitable.rb +5 -4
- data/lib/devise_invitable/controllers/helpers.rb +3 -4
- data/lib/devise_invitable/inviter.rb +4 -3
- data/lib/devise_invitable/mailer.rb +1 -1
- data/lib/devise_invitable/mapping.rb +6 -5
- data/lib/devise_invitable/models.rb +28 -28
- data/lib/devise_invitable/models/authenticatable.rb +7 -1
- data/lib/devise_invitable/parameter_sanitizer.rb +18 -18
- data/lib/devise_invitable/routes.rb +5 -5
- data/lib/devise_invitable/version.rb +1 -1
- data/lib/generators/active_record/devise_invitable_generator.rb +3 -3
- data/lib/generators/active_record/templates/migration.rb +0 -1
- data/lib/generators/devise_invitable/devise_invitable_generator.rb +4 -8
- data/lib/generators/devise_invitable/install_generator.rb +11 -14
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/edit.html.erb +10 -6
- data/lib/generators/devise_invitable/templates/simple_form_for/invitations/new.html.erb +10 -6
- data/lib/generators/devise_invitable/views_generator.rb +6 -6
- data/test/functional/registrations_controller_test.rb +24 -25
- data/test/generators/views_generator_test.rb +7 -6
- data/test/generators_test.rb +3 -2
- data/test/integration/invitation_remove_test.rb +8 -8
- data/test/integration/invitation_test.rb +46 -46
- data/test/integration_tests_helper.rb +8 -9
- data/test/model_tests_helper.rb +5 -5
- data/test/models/invitable_test.rb +120 -110
- data/test/models_test.rb +3 -3
- data/test/orm/active_record.rb +2 -2
- data/test/orm/mongoid.rb +2 -2
- data/test/rails_app/app/controllers/admins_controller.rb +4 -3
- data/test/rails_app/app/controllers/application_controller.rb +11 -10
- data/test/rails_app/app/controllers/free_invitations_controller.rb +12 -9
- data/test/rails_app/app/controllers/users_controller.rb +2 -2
- data/test/rails_app/app/models/admin.rb +7 -10
- data/test/rails_app/app/models/octopussy.rb +4 -4
- data/test/rails_app/app/models/user.rb +20 -20
- data/test/rails_app/app/views/admins/new.html.erb +9 -5
- data/test/rails_app/app/views/devise/sessions/new.html.erb +14 -6
- data/test/rails_app/app/views/free_invitations/new.html.erb +9 -5
- data/test/rails_app/app/views/layouts/application.html.erb +3 -4
- data/test/rails_app/app/views/users/invitations/new.html.erb +15 -9
- data/test/rails_app/config/application.rb +6 -6
- data/test/rails_app/config/boot.rb +2 -2
- data/test/rails_app/config/credentials.yml.enc +1 -0
- data/test/rails_app/config/initializers/devise.rb +4 -3
- data/test/rails_app/config/initializers/secret_token.rb +3 -1
- data/test/rails_app/config/initializers/session_store.rb +1 -1
- data/test/rails_app/config/initializers/wrap_parameters.rb +1 -1
- data/test/rails_app/config/master.key +1 -0
- data/test/rails_app/config/routes.rb +3 -3
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -2
- data/test/routes_test.rb +4 -4
- data/test/test_helper.rb +6 -19
- metadata +46 -22
@@ -0,0 +1,31 @@
|
|
1
|
+
it:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Hai un invito in sospeso, accettalo per completare la creazione del tuo account."
|
5
|
+
invitations:
|
6
|
+
send_instructions: "Un'email di invito è stata inoltrata a %{email}."
|
7
|
+
invitation_token_invalid: "Il token di invito fornito non è valido!"
|
8
|
+
updated: "La tua password è stata impostata correttamente. Ora sei connesso."
|
9
|
+
updated_not_active: "La tua password è stata impostata correttamente."
|
10
|
+
no_invitations_remaining: "Non sono più disponibili inviti."
|
11
|
+
invitation_removed: "Il tuo invito è stato rimosso."
|
12
|
+
new:
|
13
|
+
header: "Inoltra l'invito"
|
14
|
+
submit_button: "Inoltra un invito"
|
15
|
+
edit:
|
16
|
+
header: "Imposta la tua password"
|
17
|
+
submit_button: "Imposta la password"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "Istruzioni per l'invito"
|
21
|
+
hello: "Buongiorno %{email}"
|
22
|
+
someone_invited_you: "Qualcuno ti ha invitato a %{url}, accetta tramite il link qua sotto."
|
23
|
+
accept: "Accetta l'invito"
|
24
|
+
accept_until: "L'invito sarà valido fino a %{due_date}."
|
25
|
+
ignore: "Se non si desidera accettare l'invito si prega di ignorare la presente email.<br />L'account non sarà creato finché non verrà impostata la password (v. link sotto)."
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
ja:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: 'アカウントを作成するには、保留中の招待を承認してください。'
|
5
|
+
invitations:
|
6
|
+
send_instructions: '招待メールが%{email}に送信されました。'
|
7
|
+
invitation_token_invalid: '招待コードが不正です。'
|
8
|
+
updated: 'パスワードが設定されました。お使いのアカウントでログインできます。'
|
9
|
+
updated_not_active: 'パスワードが設定されました。'
|
10
|
+
no_invitations_remaining: 'これ以上招待できません。'
|
11
|
+
invitation_removed: '招待を取り消しました。'
|
12
|
+
new:
|
13
|
+
header: '招待する'
|
14
|
+
submit_button: '招待メールを送る'
|
15
|
+
edit:
|
16
|
+
header: 'パスワードを設定する'
|
17
|
+
submit_button: 'パスワードを設定する'
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: '招待を承認するには'
|
21
|
+
hello: 'こんにちは、%{email}さん'
|
22
|
+
someone_invited_you: '%{url}に招待されました。以下のリンクから承認できます。'
|
23
|
+
accept: '招待を承認する'
|
24
|
+
accept_until: 'この招待は%{due_date}まで有効です。'
|
25
|
+
ignore: '招待を承認しない場合は、このメールを無視してください。<br />あなたのアカウントは上記のリンク先にアクセスしパスワードを設定するまでは作成されません。'
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: '%Y年%m月%d日%H時%M分'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
ko:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "귀하께로 초대장이 발부되었습니다. 초대를 수락하면 계정을 생성할 수 있습니다. "
|
5
|
+
invitations:
|
6
|
+
send_instructions: "초대 이메일이 %{email}에게로 발송되었습니다."
|
7
|
+
invitation_token_invalid: "제공된 초대장 토큰이 유효하지 않습니다!"
|
8
|
+
updated: "비밀번호가 성공적으로 설정되었으며, 현재 로그인 상태입니다."
|
9
|
+
updated_not_active: "비밀번호가 성공적으로 설정되었습니다."
|
10
|
+
no_invitations_remaining: "남은 초대장이 없습니다."
|
11
|
+
invitation_removed: "귀하께로 온 초대장이 삭제되었습니다."
|
12
|
+
new:
|
13
|
+
header: "초대장 발송"
|
14
|
+
submit_button: "발송하기"
|
15
|
+
edit:
|
16
|
+
header: "비밀번호 설정"
|
17
|
+
submit_button: "설정하기"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "초대장 안내메일"
|
21
|
+
hello: "%{email}님 안녕하세요."
|
22
|
+
someone_invited_you: "귀하는 %{url}로 초대되었습니다. 아래의 링크를 클릭하여 초대를 수락할 수 있습니다."
|
23
|
+
accept: "초대수락"
|
24
|
+
ignore: "초대를 원치 않을 경우 이 이메일을 무시해도 됩니다.<br />위의 링크로 접속하여 귀하의 비밀번호를 설정하여 계정을 생성할 수 있습니다."
|
@@ -0,0 +1,32 @@
|
|
1
|
+
nl:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "U bent reeds uitgenodigd, accepteer de uitnodiging die u heeft ontvangen per mail om uw account te accepteren."
|
5
|
+
invitations:
|
6
|
+
send_instructions: "Een uitnodigingsmail aan %{email} is verstuurd."
|
7
|
+
invitation_token_invalid: "De uitnodigingscode is ongeldig!"
|
8
|
+
updated: "Uw wachtwoord is ingesteld. U bent nu ingelogd."
|
9
|
+
updated_not_active: "Uw wachtwoord is ingesteld."
|
10
|
+
no_invitations_remaining: "Geen uitnodigingen over."
|
11
|
+
invitation_removed: "Uw uitnodiging is verwijderd."
|
12
|
+
new:
|
13
|
+
header: "Verstuur uitnodiging"
|
14
|
+
submit_button: "Verstuur een uitnodiging"
|
15
|
+
edit:
|
16
|
+
header: "Stel Uw wachtwoord in"
|
17
|
+
submit_button: "Stel mijn wachtwoord in"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "Instructies voor uitnodigingen"
|
21
|
+
hello: "Beste %{email}"
|
22
|
+
someone_invited_you: "Iemand heeft U uitgenodigd voor %{url}, U kunt de uitnodiging accepteren via onderstaande link."
|
23
|
+
accept: "Accepteer uitnodiging"
|
24
|
+
accept_until: "Deze uitnodoging vervalt per %{due_date}."
|
25
|
+
ignore: "Indien U de uitnodiging niet wenst te accepteren, negeer dan alstublieft deze email.<br />\nUw account wordt niet aangemaakt indien U niet via bovenstaande link uw wachtwoord aanmaakt."
|
26
|
+
|
27
|
+
time:
|
28
|
+
formats:
|
29
|
+
devise:
|
30
|
+
mailer:
|
31
|
+
invitation_instructions:
|
32
|
+
accept_until_format: "%a %d %b %Y %H:%M:%S %Z"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"no":
|
2
|
+
devise:
|
3
|
+
invitations:
|
4
|
+
send_instructions: 'En epost med invitasjon er sent til %{email}.'
|
5
|
+
invitation_token_invalid: 'Autentiseringskoden er ikke gyldig!'
|
6
|
+
updated: 'Passordet ble oppdatert suksessfullt. Du er nå logget inn.'
|
7
|
+
no_invitations_remaining: 'Ingen gjenværende invitasjoner.'
|
8
|
+
invitation_removed: 'Din invitasjon ble fjernet.'
|
9
|
+
new:
|
10
|
+
header: 'Send invitasjon'
|
11
|
+
submit_button: 'Send en invitasjon'
|
12
|
+
edit:
|
13
|
+
header: 'Sett ditt passord'
|
14
|
+
submit_button: 'Sett mitt passord'
|
15
|
+
mailer:
|
16
|
+
invitation_instructions:
|
17
|
+
subject: 'Invitasjonsinstruksjoner'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
pl:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Posiadasz oczekujące zaproszenie, zaakceptuj je aby ukończyć proces rejestracji."
|
5
|
+
invitations:
|
6
|
+
send_instructions: "E-mail z zaproszeniem został wysłany do %{email}."
|
7
|
+
invitation_token_invalid: "Kod zaproszenia jest nieprawidłowy."
|
8
|
+
updated: "Twoje hasło zostało pomyślnie ustawione. Jesteś teraz zalogowany."
|
9
|
+
updated_not_active: "Twoje hasło zostało ustawione."
|
10
|
+
no_invitations_remaining: "Brak oczekujących zaproszeń"
|
11
|
+
invitation_removed: "Twoje zaproszenie zostało usunięte."
|
12
|
+
new:
|
13
|
+
header: "Wyślij zaproszenie"
|
14
|
+
submit_button: "Wyślij zaproszenie"
|
15
|
+
edit:
|
16
|
+
header: "Ustaw swoje hasło"
|
17
|
+
submit_button: "Zapisz moje hasło"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "Instrukcja do zaproszenia"
|
21
|
+
hello: "Cześć %{email}"
|
22
|
+
someone_invited_you: "Ktoś zaprosił Cię do %{url}. Zaproszenie możesz zaakceptować przez podany link."
|
23
|
+
accept: "Przyjmij zaproszenie"
|
24
|
+
accept_until: "Zaprosze będzie ważne do %{due_date}."
|
25
|
+
ignore: "Jeśli nie chcesz przyjąć zaproszenia, zignoruj tę wiadomość.<br />Twoje konto nie zostanie utworzone do momentu ustawienia przez Ciebie hasła."
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
pt_BR:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: 'Você tem um convite pendente, aceite para finalizar sua conta.'
|
5
|
+
invitations:
|
6
|
+
send_instructions: 'Um email de convite foi enviado para %{email}.'
|
7
|
+
invitation_token_invalid: 'O código do convite não é válido!'
|
8
|
+
updated: 'Sua senha foi atualizada com sucesso. Você está autenticado agora.'
|
9
|
+
no_invitations_remaining: "Sem convites pendentes"
|
10
|
+
invitation_removed: 'Seu convite foi removido.'
|
11
|
+
new:
|
12
|
+
header: "Enviar convite"
|
13
|
+
submit_button: "Enviar um convite"
|
14
|
+
edit:
|
15
|
+
header: "Escolha sua senha"
|
16
|
+
submit_button: "Atualizar minha senha"
|
17
|
+
mailer:
|
18
|
+
invitation_instructions:
|
19
|
+
subject: 'Instruções do convite'
|
20
|
+
hello: 'Olá %{email}'
|
21
|
+
someone_invited_you: 'Alguém convidou você para acessar %{url}, você pode aceitar o convite através do link abaixo.'
|
22
|
+
accept: 'Aceitar convite'
|
23
|
+
ignore: "Se você não quer aceitar esse convite, por favor ignore esse e-mail.<br />Sua conta não será criada até você acessar o link abaixo e escolher sua senha."
|
@@ -0,0 +1,23 @@
|
|
1
|
+
pt:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: 'Você tem um convite pendente, aceite para finalizar sua conta.'
|
5
|
+
invitations:
|
6
|
+
send_instructions: 'Um email de convite foi enviado para %{email}.'
|
7
|
+
invitation_token_invalid: 'O código do convite não é válido!'
|
8
|
+
updated: 'Sua senha foi atualizada com sucesso. Você está autenticado agora.'
|
9
|
+
no_invitations_remaining: "Sem convites pendentes"
|
10
|
+
invitation_removed: 'Seu convite foi removido.'
|
11
|
+
new:
|
12
|
+
header: "Enviar convite"
|
13
|
+
submit_button: "Enviar um convite"
|
14
|
+
edit:
|
15
|
+
header: "Escolha sua senha"
|
16
|
+
submit_button: "Atualizar minha senha"
|
17
|
+
mailer:
|
18
|
+
invitation_instructions:
|
19
|
+
subject: 'Instruções do convite'
|
20
|
+
hello: 'Olá %{email}'
|
21
|
+
someone_invited_you: 'Alguém convidou você para acessar %{url}, você pode aceitar o convite através do link abaixo.'
|
22
|
+
accept: 'Aceitar convite'
|
23
|
+
ignore: "Se você não quer aceitar esse convite, por favor ignore esse e-mail.<br />Sua conta não será criada até você acessar o link abaixo e escolher sua senha."
|
@@ -0,0 +1,23 @@
|
|
1
|
+
ru:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: 'У вас есть непринятое приглашение, подтвердите его чтобы продолжить создание аккаунта.'
|
5
|
+
invitations:
|
6
|
+
send_instructions: 'Письмо с приглашением было отправлено на %{email}.'
|
7
|
+
invitation_token_invalid: 'Неверный токен приглашения.'
|
8
|
+
updated: 'Ваш пароль успешно сохранен. Вы вошли в систему.'
|
9
|
+
no_invitations_remaining: "Приглашений нет"
|
10
|
+
invitation_removed: 'Выше приглашение было удалено.'
|
11
|
+
new:
|
12
|
+
header: "Отправить приглашение"
|
13
|
+
submit_button: "Отправить приглашение"
|
14
|
+
edit:
|
15
|
+
header: "Создание пароля"
|
16
|
+
submit_button: "Сохранить"
|
17
|
+
mailer:
|
18
|
+
invitation_instructions:
|
19
|
+
subject: 'Инструкции по созданию учетной записи'
|
20
|
+
hello: 'Здравствуйте, %{email}'
|
21
|
+
someone_invited_you: 'Это письмо - приглашение стать пользователем сайта %{url}, вы можете создать аккаунт, кликнув по ссылке ниже.'
|
22
|
+
accept: 'Создать аккаунт'
|
23
|
+
ignore: "Если вы не хотите создавать аккаунт, проигнорируйте это письмо. <br /> Учетная запись не будет создана, пока вы не пройдете по ссылке и не установите пароль."
|
@@ -0,0 +1,24 @@
|
|
1
|
+
tr:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Hesap oluşturmak için bekleyen davetiyenizi kabul edin"
|
5
|
+
invitations:
|
6
|
+
send_instructions: "%{email} adresine davetiye maili gönderildi."
|
7
|
+
invitation_token_invalid: "Davetiye tokenı geçerli değil!"
|
8
|
+
updated: "Şifreniz başarıyla oluşturuldu ve giriş yaptınız"
|
9
|
+
updated_not_active: "Şifreniz başarıyla oluşturuldu."
|
10
|
+
no_invitations_remaining: "Davetiye kalmadı"
|
11
|
+
invitation_removed: "Davetiyeniz silindi"
|
12
|
+
new:
|
13
|
+
header: "Davetiye gönderildi"
|
14
|
+
submit_button: "Davetiye gönder"
|
15
|
+
edit:
|
16
|
+
header: "Şifre oluştur"
|
17
|
+
submit_button: "Şifremi oluştur"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "Davetiye adımları"
|
21
|
+
hello: "Merhaba %{email}"
|
22
|
+
someone_invited_you: "%{url} adresine davet edildiniz. Kabul etmek için aşağıdaki linke tıklayınız."
|
23
|
+
accept: "Daveti kabul et"
|
24
|
+
ignore: "Daveti kabul etmek istemiyorsanız bu maili yoksayabilirsiniz.<br />Aşağıdaki linke tıklayıp şifrenizi oluşturmadan hesabınız oluşturulmayacaktır."
|
@@ -0,0 +1,31 @@
|
|
1
|
+
ua:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Вас очікує ще не прийняте запрошення, прийміть його, щоб завершити створення облікового запису."
|
5
|
+
invitations:
|
6
|
+
send_instructions: 'Лист з запрошенням було відправлено на %{email}.'
|
7
|
+
invitation_token_invalid: 'Передано неправильний токен запрошення!'
|
8
|
+
updated: 'Пароль успішно встановлено. Ви успішно увійшли.'
|
9
|
+
updated_not_active: "Ваш пароль успішно встановлено."
|
10
|
+
no_invitations_remaining: "Не лишилось запрошень"
|
11
|
+
invitation_removed: 'Ваше запрошення було видалено.'
|
12
|
+
new:
|
13
|
+
header: "Надсилання запрошення"
|
14
|
+
submit_button: "Надіслати запрошення"
|
15
|
+
edit:
|
16
|
+
header: "Встановіть ваш пароль"
|
17
|
+
submit_button: "Встановити мій пароль"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: 'Інструкції для запрошення'
|
21
|
+
hello: 'Вітаємо, %{email}'
|
22
|
+
someone_invited_you: 'Дехто запросив вас на %{url}, ви можете прийняти запрошення за посиланням нижче.'
|
23
|
+
accept: 'Прийняти запрошення'
|
24
|
+
accept_until: "Це запрошення дійсне до %{due_date}."
|
25
|
+
ignore: "Якщо ви не хочете приймати запрошення, будь ласка, ігноруйте цього листа.<br />Ваш акаунт не буде створено, доти, доки ви не перейдете за посиланням вище і не встановите свій пароль."
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: "%I:%M %p %B %d, %Y"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
vi:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Bạn có một lời mời đang ở trạng thái chờ, hãy xác nhận nó để tạo tài khoản của bạn."
|
5
|
+
invitations:
|
6
|
+
send_instructions: "Một thư mời đã được gửi đến cho %{email}."
|
7
|
+
invitation_token_invalid: "Mã xác nhận không chính xác!"
|
8
|
+
updated: "Mật khẩu của bạn đã được thiết lập thành công. Bạn hiện đang đăng nhập."
|
9
|
+
updated_not_active: "Mật khẩu của bạn đã được thiết lập thành công."
|
10
|
+
no_invitations_remaining: "Không còn lời mời nào."
|
11
|
+
invitation_removed: "Lời mời của bạn đã bị xóa."
|
12
|
+
new:
|
13
|
+
header: "Gửi lời mời"
|
14
|
+
submit_button: "Gửi thư mời"
|
15
|
+
edit:
|
16
|
+
header: "Thiết lập mật khẩu"
|
17
|
+
submit_button: "Đặt mật khẩu"
|
18
|
+
mess: 'Hãy thiết lập mật khẩu của bạn để sử dụng dịch vụ'
|
19
|
+
mailer:
|
20
|
+
invitation_instructions:
|
21
|
+
subject: "Hướng dẫn"
|
22
|
+
hello: "Xin chào %{email}"
|
23
|
+
someone_invited_you: "Có một ai đó đã mời bạn ghé thăm %{url}, Bạn có thể chấp nhận lời mời này thông qua đường dẫn bên dưới."
|
24
|
+
accept: "Chấp nhận lời mời"
|
25
|
+
ignore: "Nếu bạn không muốn chấp nhận lời mời, xin vui lòng bỏ qua email này.<br />Tài khoản của bạn sẽ không được khởi tạo cho đến khi bạn truy cập vào đường dẫn ở trên và đặt mật khẩu cho tài khoản của bạn."
|
@@ -0,0 +1,31 @@
|
|
1
|
+
zh-HK:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "你有一個待處理的邀請, 請接受它以完成創建您的帳戶。"
|
5
|
+
invitations:
|
6
|
+
send_instructions: "邀請電子郵件已發送到%{email)。"
|
7
|
+
invitation_token_invalid: "提供嘅邀請令牌無效!"
|
8
|
+
updated: "你嘅密碼設置成功。 你而家已經登錄。"
|
9
|
+
updated_not_active: "你嘅密碼設置成功。"
|
10
|
+
no_invitations_remaining: "冇剩餘邀請"
|
11
|
+
invitation_removed: "你嘅邀請已被刪除。"
|
12
|
+
new:
|
13
|
+
header: "發送邀請"
|
14
|
+
submit_button: "發送邀請"
|
15
|
+
edit:
|
16
|
+
header: "設置密碼"
|
17
|
+
submit_button: "設置密碼"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "邀請指示"
|
21
|
+
hello: "你好%{email}"
|
22
|
+
someone_invited_you: "有人邀請你去%{url}, 你可以通過下面嘅連結接受它。"
|
23
|
+
accept: "接受邀請"
|
24
|
+
accept_until: "此邀請就喺%{due_date} 中到期。"
|
25
|
+
ignore: "如果你唔想接受邀請, 請忽略此電子郵件。 系你訪問上面的連結並設置密碼之前, 不會創建您的帳戶。"
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
zh-TW:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "你有已經有一個建立帳號的邀請,請接受邀請來建立帳號"
|
5
|
+
invitations:
|
6
|
+
send_instructions: "邀請已發送至%{email)。"
|
7
|
+
invitation_token_invalid: "提供認證已無效!"
|
8
|
+
updated: "你的密碼已設置成功,你現在已經登入了。"
|
9
|
+
updated_not_active: "密碼設置成功。"
|
10
|
+
no_invitations_remaining: "沒有名額可以給您邀請其他人"
|
11
|
+
invitation_removed: "你的邀請已被刪除。"
|
12
|
+
new:
|
13
|
+
header: "發送邀請"
|
14
|
+
submit_button: "發送邀請"
|
15
|
+
edit:
|
16
|
+
header: "設置密碼"
|
17
|
+
submit_button: "設置密碼"
|
18
|
+
mailer:
|
19
|
+
invitation_instructions:
|
20
|
+
subject: "邀請教學"
|
21
|
+
hello: "%{email} 你好"
|
22
|
+
someone_invited_you: "你已被邀請成為會員,你可以通過此連結接受邀請並創立帳號:%{url}"
|
23
|
+
accept: "接受邀請"
|
24
|
+
accept_until: "此邀請將於 %{due_date} 後過期。"
|
25
|
+
ignore: "如果你不想接受邀請, 請忽略此電子郵件。在你透過上面的連結設置密碼前,都不會建立您的帳號。"
|
26
|
+
time:
|
27
|
+
formats:
|
28
|
+
devise:
|
29
|
+
mailer:
|
30
|
+
invitation_instructions:
|
31
|
+
accept_until_format: "%B %d, %Y %I:%M %p"
|
data/lib/devise_invitable.rb
CHANGED
@@ -22,7 +22,8 @@ module Devise
|
|
22
22
|
mattr_accessor :invite_for
|
23
23
|
@@invite_for = 0
|
24
24
|
|
25
|
-
# Public:
|
25
|
+
# Public: Ensure that invited record is valid.
|
26
|
+
# The invitation won't be sent if this check fails.
|
26
27
|
# (default: false).
|
27
28
|
#
|
28
29
|
# Examples (in config/initializers/devise.rb)
|
@@ -44,9 +45,9 @@ module Devise
|
|
44
45
|
#
|
45
46
|
# Examples (in config/initializers/devise.rb)
|
46
47
|
#
|
47
|
-
# config.invite_key = {:
|
48
|
+
# config.invite_key = { email: /\A[^@]+@[^@]+\z/ }
|
48
49
|
mattr_accessor :invite_key
|
49
|
-
@@invite_key = {:
|
50
|
+
@@invite_key = { email: Devise.email_regexp }
|
50
51
|
|
51
52
|
# Public: Resend invitation if user with invited status is invited again
|
52
53
|
# (default: true)
|
@@ -84,4 +85,4 @@ module Devise
|
|
84
85
|
@@require_password_on_accepting = true
|
85
86
|
end
|
86
87
|
|
87
|
-
Devise.add_module :invitable, :
|
88
|
+
Devise.add_module :invitable, controller: :invitations, model: 'devise_invitable/models', route: { invitation: [nil, :new, :accept] }
|
@@ -14,9 +14,8 @@ module DeviseInvitable::Controllers::Helpers
|
|
14
14
|
|
15
15
|
protected
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
def authenticate_inviter!
|
18
|
+
send(:"authenticate_#{resource_name}!", force: true)
|
19
|
+
end
|
21
20
|
end
|
22
21
|
|
@@ -25,6 +25,7 @@ module DeviseInvitable
|
|
25
25
|
end
|
26
26
|
|
27
27
|
protected
|
28
|
+
|
28
29
|
def decrement_invitation_limit!
|
29
30
|
if self.class.invitation_limit.present?
|
30
31
|
self.invitation_limit ||= self.class.invitation_limit
|
@@ -32,8 +33,8 @@ module DeviseInvitable
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
module ClassMethods
|
37
|
+
Devise::Models.config(self, :invitation_limit)
|
38
|
+
end
|
38
39
|
end
|
39
40
|
end
|