okkez-multi_auth 0.0.4 → 0.0.5

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.
Files changed (58) hide show
  1. data/README +15 -1
  2. data/app/controllers/application_controller.rb +1 -0
  3. data/app/controllers/auth/email_controller.rb +1 -1
  4. data/app/controllers/auth/open_id_controller.rb +3 -3
  5. data/app/controllers/credentials/email_controller.rb +10 -9
  6. data/app/controllers/credentials/open_id_controller.rb +7 -1
  7. data/app/controllers/signup/email_controller.rb +5 -5
  8. data/app/controllers/signup/open_id_controller.rb +3 -1
  9. data/app/models/activation_mailer.rb +6 -6
  10. data/app/models/email_credential.rb +5 -0
  11. data/app/models/open_id_credential.rb +5 -0
  12. data/app/models/session.rb +4 -0
  13. data/app/views/activation_mailer/complete_for_credential.erb +1 -1
  14. data/app/views/activation_mailer/complete_for_notice.erb +1 -1
  15. data/app/views/activation_mailer/complete_for_signup.erb +1 -1
  16. data/app/views/activation_mailer/request_for_credential.erb +5 -5
  17. data/app/views/activation_mailer/request_for_notice.erb +5 -5
  18. data/app/views/activation_mailer/request_for_signup.erb +5 -5
  19. data/app/views/auth/email/index.html.erb +3 -3
  20. data/app/views/auth/index.html.erb +5 -5
  21. data/app/views/auth/logged_in.html.erb +5 -3
  22. data/app/views/auth/logged_out.html.erb +5 -3
  23. data/app/views/auth/open_id/index.html.erb +3 -3
  24. data/app/views/credentials/email/activated.html.erb +4 -1
  25. data/app/views/credentials/email/activation.html.erb +3 -3
  26. data/app/views/credentials/email/created.html.erb +4 -4
  27. data/app/views/credentials/email/delete.html.erb +7 -4
  28. data/app/views/credentials/email/edit_password.html.erb +4 -4
  29. data/app/views/credentials/email/new.html.erb +2 -2
  30. data/app/views/credentials/index.html.erb +16 -16
  31. data/app/views/credentials/open_id/delete.html.erb +6 -3
  32. data/app/views/credentials/open_id/new.html.erb +2 -2
  33. data/app/views/signup/email/_progress.html.erb +14 -14
  34. data/app/views/signup/email/activated.html.erb +4 -4
  35. data/app/views/signup/email/activation.html.erb +8 -8
  36. data/app/views/signup/email/created.html.erb +6 -4
  37. data/app/views/signup/email/index.html.erb +3 -3
  38. data/app/views/signup/email/validated.html.erb +5 -5
  39. data/app/views/signup/index.html.erb +22 -9
  40. data/app/views/signup/open_id/authenticated.html.erb +3 -3
  41. data/app/views/signup/open_id/created.html.erb +3 -3
  42. data/app/views/signup/open_id/index.html.erb +3 -3
  43. data/config/cucumber.yml +7 -0
  44. data/config/database.yml +4 -1
  45. data/config/environment.rb +1 -1
  46. data/config/routes.rb +21 -20
  47. data/db/test.sqlite3 +0 -0
  48. data/lib/multi_auth.rb +5 -0
  49. data/lib/multi_auth/action_controller.rb +32 -1
  50. data/lib/open_id_authentication/result.rb +5 -5
  51. data/locale/ja/LC_MESSAGES/multi_auth.mo +0 -0
  52. data/po/ja/multi_auth.po +639 -0
  53. data/po/multi_auth.pot +637 -0
  54. data/test/functional/auth/open_id_controller_test.rb +1 -1
  55. data/test/functional/auth_controller_test.rb +10 -7
  56. data/test/functional/credentials_controller_test.rb +9 -0
  57. data/test/unit/activation_mailer_test.rb +2 -2
  58. metadata +7 -2
@@ -1,8 +1,8 @@
1
- <%- @title = "ログイン" -%>
1
+ <%- @title = p_("MultiAuth", "Login") -%>
2
2
  <%- @enable_side_column = false -%>
3
3
 
4
4
  <div id="dialog">
5
- <h1>OpenID によるログイン</h1>
5
+ <h1><%=h p_("MultiAuth", "By OpenID") %></h1>
6
6
 
7
7
  <%- form_tag(:controller => 'auth/open_id', :action => "login") do -%>
8
8
  <table>
@@ -13,12 +13,12 @@
13
13
  </td>
14
14
  </tr>
15
15
  </table>
16
- <div><%= submit_tag("ログイン") %></div>
16
+ <div><%= submit_tag(p_("MultiAuth", "Login")) %></div>
17
17
  <%- end -%>
18
18
 
19
19
  <hr />
20
20
 
21
- <h1>メールアドレスでログイン</h1>
21
+ <h1><%=h p_("MultiAuth", "By email address") %></h1>
22
22
  <%- form_for(:login_form, @login_form, :url => { :controller => 'auth/email', :action => "login"}) do |f| -%>
23
23
  <table id="email-login">
24
24
  <tr>
@@ -36,7 +36,7 @@
36
36
  </td>
37
37
  </tr>
38
38
  </table>
39
- <%= submit_tag("ログイン") %>
39
+ <%= submit_tag(p_("MultiAuth", "Login")) %>
40
40
  <%- end -%>
41
41
 
42
42
  </div>
@@ -1,5 +1,5 @@
1
1
 
2
- <%- @title = "ログインしました" -%>
2
+ <%- @title = p_("MultiAuth", "Logged in successfully.") -%>
3
3
  <%- @enable_side_column = false -%>
4
4
  <%- @stylesheets = %[auth] -%>
5
5
 
@@ -16,6 +16,8 @@
16
16
  <%- } -%>
17
17
 
18
18
  <div id="dialog">
19
- <h1>ログインしました</h1>
20
- <div class="message">ページが切り替わらない場合は <%= link_to(h(@return_path), @return_path) %> をクリックしてください。</div>
19
+ <h1><%=h @title %></h1>
20
+ <div class="message">
21
+ <%=h p_("MultiAuth", "Please click %{link} when the page doesn't change." % { :link => link_to(h(@return_path), @return_path) }) %>
22
+ </div>
21
23
  </div>
@@ -1,5 +1,5 @@
1
1
 
2
- <%- @title = "ログアウトしました" -%>
2
+ <%- @title = p_("MultiAuth", "You have been logged out.") -%>
3
3
  <%- @enable_side_column = false -%>
4
4
  <%- @stylesheets = %[auth] -%>
5
5
 
@@ -16,6 +16,8 @@
16
16
  <%- } -%>
17
17
 
18
18
  <div id="dialog">
19
- <h1>ログアウトしました</h1>
20
- <div class="message">ページが切り替わらない場合は <%= link_to(h(@return_path), @return_path) %> をクリックしてください。</div>
19
+ <h1><%=h @title %></h1>
20
+ <div class="message">
21
+ <%=h p_("MultiAuth", "Please click %{link} when the page doesn't change." % { :link => link_to(h(@return_path), @return_path) }) %>
22
+ </div>
21
23
  </div>
@@ -1,9 +1,9 @@
1
1
 
2
- <%- @title = "ログイン" -%>
2
+ <%- @title = p_("MultiAuth", "Login") -%>
3
3
  <%- @enable_side_column = false -%>
4
4
 
5
5
  <div id="dialog">
6
- <h1>OpenID によるログイン</h1>
6
+ <h1><%=h @title %></h1>
7
7
 
8
8
  <%- form_tag(:action => "login") do -%>
9
9
  <table>
@@ -14,7 +14,7 @@
14
14
  </td>
15
15
  </tr>
16
16
  </table>
17
- <div><%= submit_tag("ログイン") %></div>
17
+ <div><%= submit_tag(p_("MultiAuth", "Login")) %></div>
18
18
  <%- end -%>
19
19
  </div>
20
20
 
@@ -1,4 +1,7 @@
1
1
 
2
- <%- @title = "登録完了" -%>
2
+ <%- @title = p_("MultiAuth", "Registration completed") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
+
6
+ <p><%= link_to(p_("MultiAuth", "Top"), root_path) %></p>
7
+
@@ -1,15 +1,15 @@
1
1
 
2
- <%- @title = "アクティベーション" -%>
2
+ <%- @title = p_("MultiAuth", "Activation") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
6
6
  <table>
7
7
  <tr>
8
- <th>メールアドレス</th>
8
+ <th><%=h s_("EmailCredential|Email") %></th>
9
9
  <td><%=h @email_credential.email %></td>
10
10
  </tr>
11
11
  </table>
12
12
 
13
13
  <%- form_tag(:action => "activate") { -%>
14
- <div><%= submit_tag("登録") %></div>
14
+ <div><%= submit_tag(p_("MultiAuth", "Activate")) %></div>
15
15
  <%- } -%>
@@ -1,12 +1,12 @@
1
1
 
2
- <%- @title = "仮登録完了" -%>
2
+ <%- @title = p_("MultiAuth", "Pre-registeration completed") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
6
- <div>指定されたメールアドレスにメールを送信しました。メールに記載されたURLにアクセスして、登録を完了してください。</div>
7
- <div><%= link_to(h("ログイン設定に戻る"), :controller => "/credentials", :action => "index") %></div>
6
+ <div><%=h p_("MultiAuth", "System sent a mail to email address you specified. Please access the URL described in the mail. And complete registration.") %></div>
7
+ <div><%= link_to(h(p_("MultiAuth", "Back")), :controller => "/credentials", :action => "index") %></div>
8
8
 
9
9
  <%- unless production? -%>
10
10
  <hr />
11
- <%= link_to(h("アクティベーション"), :controller => "credentials/email", :action => "activation", :activation_token => @email_credential.activation_token) %>
11
+ <%= link_to(h("Activation"), :controller => "credentials/email", :action => "activation", :activation_token => @email_credential.activation_token) %>
12
12
  <%- end -%>
@@ -1,17 +1,20 @@
1
1
 
2
- <%- @title = "メールログイン情報の削除" -%>
2
+ <%- @title = p_("MultiAuth", "Delete email authentication credential.") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
6
- <div>削除します。よろしいですか?</div>
6
+ <div>
7
+ <%=h p_("MultiAuth", "Delete email authentication credential.") %>
8
+ <%=h p_("MultiAuth", "Are you sure?") %>
9
+ </div>
7
10
 
8
11
  <table>
9
12
  <tr>
10
- <th>メールアドレス</th>
13
+ <th><%=h s_("EmailCredential|Email") %></th>
11
14
  <td><%=h @email_credential.email %></td>
12
15
  </tr>
13
16
  </table>
14
17
 
15
18
  <%- form_tag(:action => "destroy") { -%>
16
- <div><%= submit_tag("削除") %></div>
19
+ <div><%= submit_tag(p_("MultiAuth", "Delete")) %></div>
17
20
  <%- } -%>
@@ -1,16 +1,16 @@
1
1
 
2
- <%- @title = "パスワードの変更" -%>
2
+ <%- @title = p_("MultiAuth", "Update password") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
6
6
  <%- form_for(:edit_form, @edit_form, :url => {:action => "update_password"}) { |f| -%>
7
7
  <table>
8
8
  <tr>
9
- <th>メールアドレス</th>
9
+ <th><%=h f.label(:email) %></th>
10
10
  <td><%=h @email_credential.email %></td>
11
11
  </tr>
12
12
  <tr>
13
- <th><%= f.label(:password) %></th>
13
+ <th><%=h f.label(:password) %></th>
14
14
  <td>
15
15
  <div><%= f.password_field(:password, :size => 20) %></div>
16
16
  <div><%= f.password_field(:password_confirmation, :size => 20) %></div>
@@ -18,7 +18,7 @@
18
18
  </td>
19
19
  </tr>
20
20
  </table>
21
- <div><%= submit_tag("変更") %></div>
21
+ <div><%= submit_tag(p_("MultiAuth", "Update")) %></div>
22
22
  <%- } -%>
23
23
 
24
24
  <%- unless production? -%>
@@ -1,5 +1,5 @@
1
1
 
2
- <%- @title = "メール認証情報の追加" -%>
2
+ <%- @title = p_("MultiAuth", "Add email authentication credential") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
@@ -22,7 +22,7 @@
22
22
  </td>
23
23
  </tr>
24
24
  </table>
25
- <div><%= submit_tag("追加") %></div>
25
+ <div><%= submit_tag(p_("MultiAuth", "Add")) %></div>
26
26
  <%- } -%>
27
27
 
28
28
  <%- unless production? -%>
@@ -1,13 +1,13 @@
1
1
 
2
- <%- @title = "ログイン設定" -%>
2
+ <%- @title = p_("MultiAuth", "Login setting") -%>
3
3
 
4
- <h2>OpenID認証</h2>
4
+ <h2><%=h p_("MultiAuth", "OpenID authentication") %></h2>
5
5
 
6
6
  <table class="list">
7
7
  <thead>
8
8
  <tr>
9
- <th>登録日</th>
10
- <th>最終ログイン日時</th>
9
+ <th><%=h s_("OpenIdCredential|Activated on") %></th>
10
+ <th><%=h s_("OpenIdCredential|Loggedin at") %></th>
11
11
  <th>OpenID</th>
12
12
  <th>&nbsp;</th>
13
13
  </tr>
@@ -16,7 +16,7 @@
16
16
  <tr>
17
17
  <td colspan="4">
18
18
  <%- can_add_open_id_credential = (@open_id_credentials.size < OpenIdCredential::MaximumRecordsPerUser) -%>
19
- <%= link_to_if(can_add_open_id_credential, add_icon + h(" OpenID認証を追加する"), :controller => "credentials/open_id", :action => "new") %>
19
+ <%= link_to_if(can_add_open_id_credential, add_icon + h(" " + p_("MultiAuth", "Add OpenID authentication")), :controller => "credentials/open_id", :action => "new") %>
20
20
  </td>
21
21
  </tr>
22
22
  </tfoot>
@@ -24,7 +24,7 @@
24
24
  <%- if @open_id_credentials.empty? -%>
25
25
  <tr>
26
26
  <td colspan="4" style="padding: 1em;">
27
- OpenID認証は、登録されていません。
27
+ <%=h p_("MultiAuth", "There are no OpenID authentication.") %>
28
28
  </td>
29
29
  </tr>
30
30
  <%- else -%>
@@ -33,21 +33,21 @@
33
33
  <td><%=h yyyymmdd(open_id_credential.created_at) %></td>
34
34
  <td><%=h yyyymmdd_hhmm(open_id_credential.loggedin_at) %></td>
35
35
  <td style="font-family: monospace;"><%=h open_id_credential.identity_url %></td>
36
- <td><%= link_to(delete_icon + h(" 削除"), :controller => "credentials/open_id", :action => "delete", :open_id_credential_id => open_id_credential.id) %></td>
36
+ <td><%= link_to(delete_icon + h(" " + p_("MultiAuth", "Delete")), :controller => "credentials/open_id", :action => "delete", :open_id_credential_id => open_id_credential.id) %></td>
37
37
  </tr>
38
38
  <%- } -%>
39
39
  <%- end -%>
40
40
  </tbody>
41
41
  </table>
42
42
 
43
- <h2>メールアドレス認証</h2>
43
+ <h2><%=h p_("MultiAuth", "Email address authentication") %></h2>
44
44
 
45
45
  <table class="list">
46
46
  <thead>
47
47
  <tr>
48
- <th>登録日</th>
49
- <th>最終ログイン日時</th>
50
- <th>メールアドレス</th>
48
+ <th><%=h s_("EmailCredential|Activated on") %></th>
49
+ <th><%=h s_("EmailCredential|Loggedin at") %></th>
50
+ <th><%=h s_("EmailCredential|Email") %></th>
51
51
  <th colspan="2">&nbsp;</th>
52
52
  </tr>
53
53
  </thead>
@@ -55,7 +55,7 @@
55
55
  <tr>
56
56
  <td colspan="6">
57
57
  <%- can_add_email_credential = (@email_credentials.size < EmailCredential::MaximumRecordsPerUser) -%>
58
- <%= link_to_if(can_add_email_credential, add_icon + h(" メールアドレス認証を追加する"), :controller => "credentials/email", :action => "new") %>
58
+ <%= link_to_if(can_add_email_credential, add_icon + h(" " + p_("MultiAuth", "Add email address authentication")), :controller => "credentials/email", :action => "new") %>
59
59
  </td>
60
60
  </tr>
61
61
  </tfoot>
@@ -63,7 +63,7 @@
63
63
  <%- if @email_credentials.empty? -%>
64
64
  <tr>
65
65
  <td colspan="5" style="padding: 1em;">
66
- メールアドレス認証は、登録されていません。
66
+ <%=h p_("MultiAuth", "There are no email address authentication.") %>
67
67
  </td>
68
68
  </tr>
69
69
  <%- else -%>
@@ -74,11 +74,11 @@
74
74
  <td>
75
75
  <div style="font-family: monospace;"><%= email_credential.email %></div>
76
76
  <%- unless email_credential.activated? -%>
77
- <div>アクティベーション待ち</div>
77
+ <div><%=h p_("MultiAuth", "Waiting for activation") %></div>
78
78
  <%- end -%>
79
79
  </td>
80
- <td><%= link_to(icon16("icons/fam/key.png", "パスワード変更") + h(" パスワード変更"), :controller => "credentials/email", :action => "edit_password", :email_credential_id => email_credential.id) %></td>
81
- <td><%= link_to(delete_icon + h(" 削除"), :controller => "credentials/email", :action => "delete", :email_credential_id => email_credential.id) %></td>
80
+ <td><%= link_to(icon16("icons/fam/key.png", p_("MultiAuth", "Update password")) + h(" " + p_("MultiAuth", "Update password")), :controller => "credentials/email", :action => "edit_password", :email_credential_id => email_credential.id) %></td>
81
+ <td><%= link_to(delete_icon + h(" " + p_("MultiAuth", "Delete")), :controller => "credentials/email", :action => "delete", :email_credential_id => email_credential.id) %></td>
82
82
  </tr>
83
83
  <%- } -%>
84
84
  <%- end -%>
@@ -1,9 +1,12 @@
1
1
 
2
- <%- @title = "OpenIDログイン情報の削除" -%>
2
+ <%- @title = p_("MultiAuth", "Delete OpenID authentication credential.") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
6
- <div>削除します。よろしいですか?</div>
6
+ <div>
7
+ <%=h p_("MultiAuth", "Delete OpenID authentication credential.") %>
8
+ <%=h p_("MultiAuth", "Are you sure?") %>
9
+ </div>
7
10
 
8
11
  <table>
9
12
  <tr>
@@ -13,5 +16,5 @@
13
16
  </table>
14
17
 
15
18
  <%- form_tag(:action => "destroy") { -%>
16
- <div><%= submit_tag("削除") %></div>
19
+ <div><%= submit_tag(p_("MultiAuth", "Delete")) %></div>
17
20
  <%- } -%>
@@ -1,5 +1,5 @@
1
1
 
2
- <%- @title = "OpenID認証情報の追加" -%>
2
+ <%- @title = p_("MultiAuth", "Add OpenID authentication credential") -%>
3
3
 
4
4
  <h1><%=h @title %></h1>
5
5
 
@@ -13,7 +13,7 @@
13
13
  </td>
14
14
  </tr>
15
15
  </table>
16
- <div><%= submit_tag("追加") %></div>
16
+ <div><%= submit_tag(p_("MultiAuth", "Add")) %></div>
17
17
  <%- } -%>
18
18
 
19
19
  <%- unless production? -%>
@@ -1,14 +1,14 @@
1
-
2
- <%-
3
- item = proc { |num, html|
4
- %|<li class="#{step == num ? "active" : "inactive"}">| + html + %|</li>|
5
- }
6
- -%>
7
-
8
- <ol id="email-signup-progress">
9
- <%= item[1, "ログイン情報の入力"] %>
10
- <%= item[2, "ログイン情報の確認"] %>
11
- <%= item[3, "仮登録の完了"] %>
12
- <%= item[4, "本登録の確認"] %>
13
- <%= item[5, "本登録の完了"] %>
14
- </ol>
1
+
2
+ <%-
3
+ item = proc { |num, html|
4
+ %|<li class="#{step == num ? "active" : "inactive"}">| + html + %|</li>|
5
+ }
6
+ -%>
7
+
8
+ <ol id="email-signup-progress">
9
+ <%= item[1, p_("MultiAuth", "Input login info")] %>
10
+ <%= item[2, p_("MultiAuth", "Confirm login info")] %>
11
+ <%= item[3, p_("MultiAuth", "Pre-registration completed")] %>
12
+ <%= item[4, p_("MultiAuth", "Registration confirmation")] %>
13
+ <%= item[5, p_("MultiAuth", "Registration completed")] %>
14
+ </ol>
@@ -1,9 +1,9 @@
1
1
 
2
- <%- @title = "サインアップ" -%>
2
+ <%- @title = p_("MultiAuth", "Signup") -%>
3
3
 
4
- <h1>本登録完了</h1>
4
+ <h1><%=h p_("MultiAuth", "Registration completed") %></h1>
5
5
 
6
6
  <%= render(:partial => "progress", :locals => {:step => 5}) %>
7
7
 
8
- <div>登録が完了しました。</div>
9
- <div><%= link_to(h("ログインする"), :controller => "auth/email") %></div>
8
+ <div><%=h p_("MultiAuth", "Registration completed") %></div>
9
+ <div><%= link_to(h(p_("MultiAuth", "Login")), :controller => "auth/email") %></div>
@@ -1,27 +1,27 @@
1
1
 
2
- <%- @title = "サインアップ" -%>
2
+ <%- @title = p_("MultiAuth", "Signup") -%>
3
3
 
4
- <h1>本登録確認</h1>
4
+ <h1><%=h p_("MultiAuth", "Registration confirmation") %></h1>
5
5
 
6
6
  <%= render(:partial => "progress", :locals => {:step => 4}) %>
7
7
 
8
8
  <%- if @credential -%>
9
- <div>有効なアクティベーションキー</div>
9
+ <div><%=h p_("MultiAuth", "Valid activation token") %></div>
10
10
  <%- if @activated -%>
11
- <div>アクティベート済み</div>
11
+ <div><%=h p_("MultiAuth", "Activated") %></div>
12
12
  <%- else -%>
13
- <div>未アクティベート</div>
13
+ <div><%=h p_("MultiAuth", "Inactivated") %></div>
14
14
  <table>
15
15
  <tr>
16
- <th>メールアドレス</th>
16
+ <th><%=h s_("EmailCredential|Email") %></th>
17
17
  <td><%=h @credential.email %></td>
18
18
  </tr>
19
19
  </table>
20
20
  <%- form_tag(:action => "activate") { -%>
21
21
  <%= hidden_field_tag("activation_token", @credential.activation_token) %>
22
- <%= submit_tag("本登録") %>
22
+ <%= submit_tag(p_("MultiAuth", "Regist")) %>
23
23
  <%- } -%>
24
24
  <%- end -%>
25
25
  <%- else -%>
26
- <div>無効なアクティベーションキー</div>
26
+ <div><%=h p_("MultiAuth", "Invalid activation token") %></div>
27
27
  <%- end -%>
@@ -1,14 +1,16 @@
1
1
 
2
- <%- @title = "サインアップ" -%>
2
+ <%- @title = p_("MultiAuth", "Signup") -%>
3
3
 
4
- <h1>仮登録完了</h1>
4
+ <h1><%=h p_("MultiAuth", "Pre-registration completed") %></h1>
5
5
 
6
6
  <%= render(:partial => "progress", :locals => {:step => 3}) %>
7
7
 
8
- <%=h @signup_form.email %>宛にメールを送信しました。
8
+ <p>
9
+ <%=h p_("MultiAuth", "Sent a mail to %{email}." % { :email => @signup_form.email } ) %>
10
+ </p>
9
11
 
10
12
  <%- unless production? -%>
11
13
  <div class="debug">
12
- <%= link_to(h("アクティベーション"), :action => "activation", :activation_token => @credential.activation_token) %>
14
+ <%= link_to(h("Activation"), :action => "activation", :activation_token => @credential.activation_token) %>
13
15
  </div>
14
16
  <%- end -%>