lato 0.1.25 → 0.1.27

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/assets/config/lato_manifest.js +2 -2
  4. data/app/controllers/lato/account_controller.rb +3 -3
  5. data/app/controllers/lato/application_controller.rb +22 -1
  6. data/app/controllers/lato/authentication_controller.rb +67 -10
  7. data/app/helpers/lato/application_helper.rb +7 -0
  8. data/app/helpers/lato/components_helper.rb +8 -2
  9. data/app/jobs/lato/application_job.rb +3 -1
  10. data/app/mailers/lato/invitation_mailer.rb +21 -0
  11. data/app/mailers/lato/user_mailer.rb +12 -0
  12. data/app/models/lato/invitation.rb +82 -0
  13. data/app/models/lato/log/user_signin.rb +8 -0
  14. data/app/models/lato/log.rb +14 -0
  15. data/app/models/lato/operation.rb +7 -1
  16. data/app/models/lato/user.rb +53 -20
  17. data/app/views/lato/account/_alert-accepted-privacy-policy-version.html.erb +5 -3
  18. data/app/views/lato/account/_alert-accepted-terms-and-conditions-version.html.erb +5 -3
  19. data/app/views/lato/account/_form-destroy.html.erb +2 -2
  20. data/app/views/lato/account/_form-password.html.erb +3 -3
  21. data/app/views/lato/account/_form-user.html.erb +3 -3
  22. data/app/views/lato/account/index.html.erb +7 -8
  23. data/app/views/lato/authentication/_fields-registration.html.erb +37 -0
  24. data/app/views/lato/authentication/_form-accept-invitation.html.erb +18 -0
  25. data/app/views/lato/authentication/_form-recover-password.html.erb +1 -1
  26. data/app/views/lato/authentication/_form-signin.html.erb +2 -2
  27. data/app/views/lato/authentication/_form-signup.html.erb +2 -32
  28. data/app/views/lato/authentication/_form-update-password.html.erb +4 -4
  29. data/app/views/lato/authentication/accept_invitation.html.erb +10 -0
  30. data/app/views/lato/authentication/recover_password.html.erb +2 -2
  31. data/app/views/lato/authentication/signin.html.erb +2 -2
  32. data/app/views/lato/authentication/signout.html.erb +3 -3
  33. data/app/views/lato/authentication/signup.html.erb +2 -2
  34. data/app/views/lato/authentication/update_password.html.erb +2 -2
  35. data/app/views/lato/components/_index.html.erb +50 -23
  36. data/app/views/lato/components/_navbar_nav_locales_item.html.erb +8 -0
  37. data/app/views/lato/mailer/invitation/invite_mail.html.erb +17 -0
  38. data/app/views/lato/mailer/user/email_verification_mail.html.erb +17 -1
  39. data/app/views/lato/mailer/user/password_update_mail.html.erb +17 -1
  40. data/app/views/layouts/lato/_feedbacks.html.erb +16 -1
  41. data/app/views/layouts/lato/_footer.html.erb +2 -2
  42. data/app/views/layouts/lato/_mailer-head_content.html.erb +7 -2
  43. data/app/views/layouts/lato/_navbar-nav_content.html.erb +6 -4
  44. data/app/views/layouts/lato/application.html.erb +3 -0
  45. data/config/importmap.rb +2 -5
  46. data/config/locales/en.yml +47 -1
  47. data/config/locales/it.yml +50 -1
  48. data/config/routes.rb +4 -0
  49. data/db/migrate/20221229233844_add_locale_to_lato_user.rb +5 -0
  50. data/db/migrate/20230109054412_create_lato_log_user_signins.rb +10 -0
  51. data/db/migrate/20230109061533_create_lato_invitations.rb +11 -0
  52. data/lib/lato/btstrap.rb +1 -1
  53. data/lib/lato/config.rb +2 -2
  54. data/lib/lato/version.rb +1 -1
  55. data/lib/tasks/lato_tasks.rake +3 -1
  56. metadata +14 -2
@@ -1,18 +1,20 @@
1
1
  <%= turbo_frame_tag 'account_alert-accepted-privacy-policy-version' do %>
2
2
  <% unless @session.user.valid_accepted_privacy_policy_version? %>
3
3
  <div class="alert alert-info mb-4">
4
- <h2 class="alert-heading">Aggiornamento privacy policy</h2>
4
+ <h2 class="alert-heading"><%= I18n.t('lato.privacy_policy_update_title') %></h2>
5
+ <% if I18n.locale == :it %>
5
6
  <p>
6
7
  Ciao <%= @session.user.first_name %>,<br>
7
8
  Ti informiamo che è stato rilasciato un <b>aggiornamento della nostra privacy policy</b>.<br>
8
9
  Per continuare a utilizzare <%= Lato.config.application_title %> è necessario prendere visione e accettare la nuova privacy policy.<br>
9
10
  </p>
11
+ <% end %>
10
12
  <%= form_with model: @session.user, url: lato.account_update_accepted_privacy_policy_version_action_path, data: { turbo_frame: '_self' } do |form| %>
11
13
  <%= lato_form_errors @session.user, class: %w[mb-3] %>
12
- <%= lato_form_item_input_check form, :confirm, "Dichiaro di aver letto e accettato la <a href=#{Lato.config.legal_privacy_policy_url} target=_blank>privacy policy</a>.", checked: false, required: true %>
14
+ <%= lato_form_item_input_check form, :confirm, I18n.t('lato.privacy_policy_checkbox', link: link_to(I18n.t('lato.privacy_policy'), Lato.config.legal_privacy_policy_url)), checked: false, required: true %>
13
15
 
14
16
  <div class="mt-3">
15
- <%= lato_form_submit form, 'Conferma' %>
17
+ <%= lato_form_submit form, I18n.t('lato.confirm') %>
16
18
  </div>
17
19
  <% end %>
18
20
  </div>
@@ -1,18 +1,20 @@
1
1
  <%= turbo_frame_tag 'account_alert-accepted-terms-and-conditions-version' do %>
2
2
  <% unless @session.user.valid_accepted_terms_and_conditions_version? %>
3
3
  <div class="alert alert-info mb-4">
4
- <h2 class="alert-heading">Aggiornamento termini e condizioni</h2>
4
+ <h2 class="alert-heading"><%= I18n.t('lato.terms_and_conditions_update_title') %></h2>
5
+ <% if I18n.locale == :it %>
5
6
  <p>
6
7
  Ciao <%= @session.user.first_name %>,<br>
7
8
  Ti informiamo che è stato rilasciato un <b>aggiornamento dei nostri termini e condizioni</b> di utilizzo.<br>
8
9
  Per continuare a utilizzare <%= Lato.config.application_title %> è necessario prendere visione e accettare i nuovi termini.<br>
9
10
  </p>
11
+ <% end %>
10
12
  <%= form_with model: @session.user, url: lato.account_update_accepted_terms_and_conditions_version_action_path, data: { turbo_frame: '_self' } do |form| %>
11
13
  <%= lato_form_errors @session.user, class: %w[mb-3] %>
12
- <%= lato_form_item_input_check form, :confirm, "Dichiaro di aver letto e accettato i <a href=#{Lato.config.legal_terms_and_conditions_url} target=_blank>termini e condizioni</a> di utilizzo.", checked: false, required: true %>
14
+ <%= lato_form_item_input_check form, :confirm, I18n.t('lato.terms_and_conditions_checkbox', link: link_to(I18n.t('lato.terms_and_conditions'), Lato.config.legal_terms_and_conditions_url)), checked: false, required: true %>
13
15
 
14
16
  <div class="mt-3">
15
- <%= lato_form_submit form, 'Conferma' %>
17
+ <%= lato_form_submit form, I18n.t('lato.confirm') %>
16
18
  </div>
17
19
  <% end %>
18
20
  </div>
@@ -10,12 +10,12 @@ user ||= Lato::User.new
10
10
  <%= lato_form_errors user, class: %w[mb-3] %>
11
11
 
12
12
  <div class="mb-3">
13
- <%= lato_form_item_label form, :email_confirmation, 'Indirizzo email di registrazione' %>
13
+ <%= lato_form_item_label form, :email_confirmation, I18n.t('lato.signup_email') %>
14
14
  <%= lato_form_item_input_email form, :email_confirmation, required: true %>
15
15
  </div>
16
16
 
17
17
  <div class="d-flex justify-content-end">
18
- <%= lato_form_submit form, 'Elimina account', class: %w[btn-danger] %>
18
+ <%= lato_form_submit form, I18n.t('lato.account_delete_confirm'), class: %w[btn-danger] %>
19
19
  </div>
20
20
  <% end %>
21
21
  <% end %>
@@ -11,18 +11,18 @@ user ||= Lato::User.new
11
11
 
12
12
  <div class="row">
13
13
  <div class="col col-12 col-lg-6 mb-3">
14
- <%= lato_form_item_label form, :password, 'Nuova password' %>
14
+ <%= lato_form_item_label form, :password, I18n.t('lato.new_password') %>
15
15
  <%= lato_form_item_input_password form, :password, required: true %>
16
16
  </div>
17
17
 
18
18
  <div class="col col-12 col-lg-6 mb-3">
19
- <%= lato_form_item_label form, :password_confirmation, 'Conferma nuova password' %>
19
+ <%= lato_form_item_label form, :password_confirmation, I18n.t('lato.confirm_new_password') %>
20
20
  <%= lato_form_item_input_password form, :password_confirmation, required: true %>
21
21
  </div>
22
22
  </div>
23
23
 
24
24
  <div class="d-flex justify-content-end">
25
- <%= lato_form_submit form, 'Aggiorna', class: %w[btn-success] %>
25
+ <%= lato_form_submit form, I18n.t('lato.update'), class: %w[btn-success] %>
26
26
  </div>
27
27
  <% end %>
28
28
  <% end %>
@@ -25,16 +25,16 @@ user ||= Lato::User.new
25
25
  <div class="input-group mb-3">
26
26
  <%= lato_form_item_input_email form, :email, required: true %>
27
27
  <% if user.email_verified_at %>
28
- <button class="btn btn-outline-success" style="pointer-events: none">Verificato</span>
28
+ <button class="btn btn-outline-success" style="pointer-events: none"><%= I18n.t('lato.email_verified') %></span>
29
29
  <% else %>
30
- <%= link_to 'Verifica email', account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self' } %>
30
+ <%= link_to I18n.t('lato.verify_email'), account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self' } %>
31
31
  <% end %>
32
32
  </div>
33
33
  </div>
34
34
  </div>
35
35
 
36
36
  <div class="d-flex justify-content-end">
37
- <%= lato_form_submit form, 'Aggiorna', class: %w[btn-success] %>
37
+ <%= lato_form_submit form, I18n.t('lato.update'), class: %w[btn-success] %>
38
38
  </div>
39
39
  <% end %>
40
40
  <% end %>
@@ -1,11 +1,11 @@
1
- <%= lato_page_head 'Account' %>
1
+ <%= lato_page_head I18n.t('lato.account') %>
2
2
 
3
3
  <%= render 'lato/account/alert-accepted-privacy-policy-version' %>
4
4
  <%= render 'lato/account/alert-accepted-terms-and-conditions-version' %>
5
5
 
6
6
  <div class="card mb-4">
7
7
  <div class="card-header">
8
- <h2 class="fs-4 mb-0">Informazioni account</h2>
8
+ <h2 class="fs-4 mb-0"><%= I18n.t('lato.account_informations') %></h2>
9
9
  </div>
10
10
  <div class="card-body">
11
11
  <%= render 'lato/account/form-user', user: @session.user %>
@@ -25,7 +25,7 @@
25
25
 
26
26
  <div class="card mb-4">
27
27
  <div class="card-header">
28
- <h2 class="fs-4 mb-0">Aggiornamento password</h2>
28
+ <h2 class="fs-4 mb-0"><%= I18n.t('lato.update_password') %></h2>
29
29
  </div>
30
30
  <div class="card-body">
31
31
  <%= render 'lato/account/form-password', user: @session.user %>
@@ -46,17 +46,16 @@
46
46
 
47
47
  <div class="card mb-4">
48
48
  <div class="card-header">
49
- <h2 class="fs-4 mb-0">Cancellazione account</h2>
49
+ <h2 class="fs-4 mb-0"><%= I18n.t('lato.account_delete') %></h2>
50
50
  </div>
51
51
  <div class="card-body">
52
52
  <div class="alert alert-warning">
53
- <h4 class="alert-heading">Attenzione</h4>
53
+ <h4 class="alert-heading"><%= I18n.t('lato.warning') %></h4>
54
54
  <p>
55
- Cancellando il tuo account <b>saranno automaticamente eliminati definitivamente tutti i dati</b> ad esso associati.<br>
56
- Confermando l'eliminazione non ci sarà più modo di recuperare le informazioni perse.
55
+ <%= raw I18n.t('lato.account_delete_details') %>
57
56
  </p>
58
57
  <p class="mb-0">
59
- Digita il tuo indirizzo email di registrazione e premi "Elimina account" per procedere con l'operazione.
58
+ <%= raw I18n.t('lato.account_delete_guide') %>
60
59
  </p>
61
60
  </div>
62
61
 
@@ -0,0 +1,37 @@
1
+ <%
2
+
3
+ email_readonly ||= false
4
+
5
+ %>
6
+
7
+ <div class="row">
8
+ <div class="col col-12 col-md-6 mb-3">
9
+ <%= lato_form_item_label form, :first_name %>
10
+ <%= lato_form_item_input_text form, :first_name, required: true %>
11
+ </div>
12
+
13
+ <div class="col col-12 col-md-6 mb-3">
14
+ <%= lato_form_item_label form, :last_name %>
15
+ <%= lato_form_item_input_text form, :last_name, required: true %>
16
+ </div>
17
+
18
+ <div class="col col-12 mb-3">
19
+ <%= lato_form_item_label form, :email %>
20
+ <%= lato_form_item_input_email form, :email, required: true, readonly: email_readonly %>
21
+ </div>
22
+
23
+ <div class="col col-12 col-md-6 mb-3">
24
+ <%= lato_form_item_label form, :password %>
25
+ <%= lato_form_item_input_password form, :password, required: true %>
26
+ </div>
27
+
28
+ <div class="col col-12 col-md-6 mb-3">
29
+ <%= lato_form_item_label form, :password_confirmation %>
30
+ <%= lato_form_item_input_password form, :password_confirmation, required: true %>
31
+ </div>
32
+ </div>
33
+
34
+ <div class="mb-3 text-muted" style="font-size: 14px;">
35
+ <%= lato_form_item_input_check form, :accepted_privacy_policy_version, I18n.t('lato.privacy_policy_checkbox', link: link_to(I18n.t('lato.privacy_policy'), Lato.config.legal_privacy_policy_url)), required: true %>
36
+ <%= lato_form_item_input_check form, :accepted_terms_and_conditions_version, I18n.t('lato.terms_and_conditions_checkbox', link: link_to(I18n.t('lato.terms_and_conditions'), Lato.config.legal_terms_and_conditions_url)), required: true %>
37
+ </div>
@@ -0,0 +1,18 @@
1
+ <%
2
+
3
+ user ||= Lato::User.new
4
+ invitation ||= Lato::Invitation.new
5
+
6
+ %>
7
+
8
+ <%= turbo_frame_tag 'authentication_form-signup' do %>
9
+ <%= form_with model: user, url: lato.authentication_accept_invitation_action_path(id: invitation.id, accepted_code: invitation.accepted_code), data: { turbo_frame: '_self', controller: 'lato-form' } do |form| %>
10
+ <%= lato_form_errors user, class: %w[mb-3] %>
11
+
12
+ <%= render 'lato/authentication/fields-registration', form: form, email_readonly: true %>
13
+
14
+ <div class="d-flex justify-content-end">
15
+ <%= lato_form_submit form, I18n.t('lato.confirm') %>
16
+ </div>
17
+ <% end %>
18
+ <% end %>
@@ -14,7 +14,7 @@ user ||= Lato::User.new
14
14
  </div>
15
15
 
16
16
  <div>
17
- <%= lato_form_submit form, I18n.t('labels.next'), class: %w[d-block w-100] %>
17
+ <%= lato_form_submit form, I18n.t('lato.next'), class: %w[d-block w-100] %>
18
18
  </div>
19
19
  <% end %>
20
20
  <% end %>
@@ -20,11 +20,11 @@ user ||= Lato::User.new
20
20
  </div>
21
21
 
22
22
  <div>
23
- <%= lato_form_submit form, I18n.t('labels.signin'), class: %w[d-block w-100] %>
23
+ <%= lato_form_submit form, I18n.t('lato.signin'), class: %w[d-block w-100] %>
24
24
  </div>
25
25
  <% unless Lato.config.auth_disable_signup %>
26
26
  <div class="text-center mt-3 mb-3">
27
- <%= I18n.t('labels.or').downcase %> <%= link_to I18n.t('labels.create_free_account').downcase, lato.authentication_signup_path %>
27
+ <%= I18n.t('lato.or').downcase %> <%= link_to I18n.t('lato.create_free_account').downcase, lato.authentication_signup_path %>
28
28
  </div>
29
29
  <% end %>
30
30
  <% end %>
@@ -8,40 +8,10 @@ user ||= Lato::User.new
8
8
  <%= form_with model: user, url: lato.authentication_signup_action_path, data: { turbo_frame: '_self', controller: 'lato-form' } do |form| %>
9
9
  <%= lato_form_errors user, class: %w[mb-3] %>
10
10
 
11
- <div class="row">
12
- <div class="col col-12 col-md-6 mb-3">
13
- <%= lato_form_item_label form, :first_name %>
14
- <%= lato_form_item_input_text form, :first_name, required: true %>
15
- </div>
16
-
17
- <div class="col col-12 col-md-6 mb-3">
18
- <%= lato_form_item_label form, :last_name %>
19
- <%= lato_form_item_input_text form, :last_name, required: true %>
20
- </div>
21
-
22
- <div class="col col-12 mb-3">
23
- <%= lato_form_item_label form, :email %>
24
- <%= lato_form_item_input_email form, :email, required: true %>
25
- </div>
26
-
27
- <div class="col col-12 col-md-6 mb-3">
28
- <%= lato_form_item_label form, :password %>
29
- <%= lato_form_item_input_password form, :password, required: true %>
30
- </div>
31
-
32
- <div class="col col-12 col-md-6 mb-3">
33
- <%= lato_form_item_label form, :password_confirmation %>
34
- <%= lato_form_item_input_password form, :password_confirmation, required: true %>
35
- </div>
36
- </div>
37
-
38
- <div class="mb-3 text-muted" style="font-size: 14px;">
39
- <%= lato_form_item_input_check form, :accepted_privacy_policy_version, I18n.t('labels.privacy_policy_checkbox', link: link_to(I18n.t('labels.privacy_policy'), Lato.config.legal_privacy_policy_url)), required: true %>
40
- <%= lato_form_item_input_check form, :accepted_terms_and_conditions_version, I18n.t('labels.terms_and_conditions_checkbox', link: link_to(I18n.t('labels.terms_and_conditions'), Lato.config.legal_terms_and_conditions_url)), required: true %>
41
- </div>
11
+ <%= render 'lato/authentication/fields-registration', form: form %>
42
12
 
43
13
  <div class="d-flex justify-content-end">
44
- <%= lato_form_submit form, I18n.t('labels.signup') %>
14
+ <%= lato_form_submit form, I18n.t('lato.signup') %>
45
15
  </div>
46
16
  <% end %>
47
17
  <% end %>
@@ -9,22 +9,22 @@ user ||= Lato::User.new
9
9
  <%= lato_form_errors user, class: %w[mb-3] %>
10
10
 
11
11
  <div class="mb-3">
12
- <%= lato_form_item_label form, :code, 'Codice ricevuto via email' %>
12
+ <%= lato_form_item_label form, :code, I18n.t('lato.recover_password_code') %>
13
13
  <%= lato_form_item_input_text form, :code, required: true %>
14
14
  </div>
15
15
 
16
16
  <div class="mb-3">
17
- <%= lato_form_item_label form, :password, 'Nuova password' %>
17
+ <%= lato_form_item_label form, :password, I18n.t('lato.new_password') %>
18
18
  <%= lato_form_item_input_password form, :password, required: true %>
19
19
  </div>
20
20
 
21
21
  <div class="mb-3">
22
- <%= lato_form_item_label form, :password_confirmation, 'Conferma nuova password' %>
22
+ <%= lato_form_item_label form, :password_confirmation, I18n.t('lato.confirm_new_password') %>
23
23
  <%= lato_form_item_input_password form, :password_confirmation, required: true %>
24
24
  </div>
25
25
 
26
26
  <div class="d-flex justify-content-end">
27
- <%= lato_form_submit form, I18n.t('labels.confirm') %>
27
+ <%= lato_form_submit form, I18n.t('lato.confirm') %>
28
28
  </div>
29
29
  <% end %>
30
30
  <% end %>
@@ -0,0 +1,10 @@
1
+ <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
+ <div class="card w-100" style="max-width: 550px">
3
+ <div class="card-header">
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('lato.accept_invitation') %></h1>
5
+ </div>
6
+ <div class="card-body">
7
+ <%= render 'lato/authentication/form-accept-invitation', user: @user, invitation: @invitation %>
8
+ </div>
9
+ </div>
10
+ </div>
@@ -1,13 +1,13 @@
1
1
  <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
2
  <div class="card w-100" style="max-width: 400px">
3
3
  <div class="card-header">
4
- <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.recover_password') %></h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('lato.recover_password') %></h1>
5
5
  </div>
6
6
  <div class="card-body">
7
7
  <%= render 'lato/authentication/form-recover-password', user: @user %>
8
8
  </div>
9
9
  <div class="card-footer text-center">
10
- <%= link_to I18n.t('labels.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('lato.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
11
11
  </div>
12
12
  </div>
13
13
  </div>
@@ -1,14 +1,14 @@
1
1
  <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
2
  <div class="card w-100" style="max-width: 400px">
3
3
  <div class="card-header">
4
- <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.signin') %></h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('lato.signin') %></h1>
5
5
  </div>
6
6
  <div class="card-body">
7
7
  <%= render 'lato/authentication/form-signin', user: @user %>
8
8
  </div>
9
9
  <% unless Lato.config.auth_disable_recover_password %>
10
10
  <div class="card-footer text-center">
11
- <%= link_to I18n.t('labels.forgot_your_password?'), lato.authentication_recover_password_path, class: 'text-muted' %>
11
+ <%= link_to I18n.t('lato.forgot_your_password?'), lato.authentication_recover_password_path, class: 'text-muted' %>
12
12
  </div>
13
13
  <% end %>
14
14
  </div>
@@ -1,10 +1,10 @@
1
1
  <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
2
  <div class="card w-100" style="max-width: 350px">
3
3
  <div class="card-body text-center">
4
- <p><%= @session.user.first_name %>, Sei sicuro di voler uscire dal tuo account?</p>
4
+ <p><%= I18n.t 'lato.signout_confirmation_request', user: @session.user.first_name %></p>
5
5
  <div>
6
- <%= link_to 'Annulla', lato.root_path, class: %w[btn btn-primary me-2] %>
7
- <%= link_to 'Si, Esci', lato.authentication_signout_action_path, class: %w[btn btn-danger ms-2], data: { turbo_method: :delete } %>
6
+ <%= link_to I18n.t('lato.cancel'), lato.root_path, class: %w[btn btn-primary me-2] %>
7
+ <%= link_to I18n.t('lato.confirm'), lato.authentication_signout_action_path, class: %w[btn btn-danger ms-2], data: { turbo_method: :delete } %>
8
8
  </div>
9
9
  </div>
10
10
  </div>
@@ -1,13 +1,13 @@
1
1
  <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
2
  <div class="card w-100" style="max-width: 550px">
3
3
  <div class="card-header">
4
- <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.signup') %></h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('lato.signup') %></h1>
5
5
  </div>
6
6
  <div class="card-body">
7
7
  <%= render 'lato/authentication/form-signup', user: @user %>
8
8
  </div>
9
9
  <div class="card-footer">
10
- <%= link_to I18n.t('labels.already_have_an_account?'), lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('lato.already_have_an_account?'), lato.authentication_signin_path, class: 'text-muted' %>
11
11
  </div>
12
12
  </div>
13
13
  </div>
@@ -1,13 +1,13 @@
1
1
  <div class="w-100 h-100 d-flex justify-content-center align-items-center" style="min-height: calc(100vh - 54px - 2rem)">
2
2
  <div class="card w-100" style="max-width: 400px">
3
3
  <div class="card-header">
4
- <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.update_password') %></h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('lato.update_password') %></h1>
5
5
  </div>
6
6
  <div class="card-body">
7
7
  <%= render 'lato/authentication/form-update-password', user: @user %>
8
8
  </div>
9
9
  <div class="card-footer text-center">
10
- <%= link_to I18n.t('labels.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('lato.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
11
11
  </div>
12
12
  </div>
13
13
  </div>
@@ -6,32 +6,59 @@
6
6
  <%= hidden_field_tag k, v %>
7
7
  <% end %>
8
8
 
9
- <% if false && browser.device.mobile? %>
10
- <!-- Free for custom mobile version -->
11
- <% else %>
12
-
13
- <% if custom_actions.any? || searchable_columns.any? %>
14
- <div class="d-flex justify-content-between mb-3">
15
- <% if searchable_columns.any? %>
16
- <div class="input-group">
17
- <input type="text" name="search" class="form-control" placeholder="<%= I18n.t('labels.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>">
18
- <button class="btn btn-outline-primary" type="submit"><i class="bi bi-search"></i></button>
19
- </div>
20
- <% else %>
21
- <div></div>
22
- <% end %>
9
+ <% if custom_actions.any? || searchable_columns.any? %>
10
+ <div class="d-flex justify-content-between mb-3">
11
+ <% if searchable_columns.any? %>
12
+ <div class="input-group">
13
+ <input type="text" name="search" class="form-control" placeholder="<%= I18n.t('lato.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>">
14
+ <button class="btn btn-outline-primary" type="submit"><i class="bi bi-search"></i></button>
15
+ </div>
16
+ <% else %>
17
+ <div></div>
18
+ <% end %>
23
19
 
24
- <div class="btn-group ms-2">
25
- <% if custom_actions.any? %>
26
- <% custom_actions.each do |action_key, action_params| %>
27
- <%= link_to action_params[:path], { class: 'btn btn-primary' }.merge(action_params) do %>
28
- <i class="<%= action_params[:icon] %>"></i>
29
- <% end %>
20
+ <div class="btn-group ms-2">
21
+ <% if custom_actions.any? %>
22
+ <% custom_actions.each do |action_key, action_params| %>
23
+ <%= link_to action_params[:path], { class: 'btn btn-primary' }.merge(action_params) do %>
24
+ <i class="<%= action_params[:icon] %>"></i>
30
25
  <% end %>
31
26
  <% end %>
32
- </div>
27
+ <% end %>
33
28
  </div>
34
- <% end %>
29
+ </div>
30
+ <% end %>
31
+
32
+ <% if browser.device.mobile? %>
33
+
34
+ <ul class="list-group list-group-flush">
35
+ <% collection.each do |member| %>
36
+ <li class="list-group-item p-0 border-0">
37
+ <table class="table table-bordered">
38
+ <tbody>
39
+ <% columns.each do |column| %>
40
+ <tr>
41
+ <th><%= collection.model.human_attribute_name column %></th>
42
+ <td class="lato-index-col-<%= column %>">
43
+ <% viewer_function_name = "#{model_name_underscore}_#{column}" %>
44
+ <%= respond_to?(viewer_function_name) ? send(viewer_function_name, member) : member.send(column) %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ </li>
51
+ <% end %>
52
+ </ul>
53
+
54
+ <div class="d-flex flex-column align-items-center">
55
+ <span class="text-muted"><%= collection.count %> <%= I18n.t('lato.viewed_results').downcase %>
56
+ <% if collection.respond_to?(:total_pages) %>
57
+ <div class="mt-3"><%= paginate collection %></div>
58
+ <% end %>
59
+ </div>
60
+
61
+ <% else %>
35
62
 
36
63
  <div class="table-responsive">
37
64
  <table class="table table-striped table-bordered">
@@ -80,7 +107,7 @@
80
107
  <% else %>
81
108
  <div></div>
82
109
  <% end %>
83
- <span class="text-muted"><%= collection.count %> <%= I18n.t('labels.viewed_results').downcase %>
110
+ <span class="text-muted"><%= collection.count %> <%= I18n.t('lato.viewed_results').downcase %>
84
111
  </div>
85
112
  </td>
86
113
  </tr>
@@ -0,0 +1,8 @@
1
+ <li class="nav-item dropdown">
2
+ <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><%= flag ? locale_to_flag(I18n.locale) : I18n.locale.upcase %></a>
3
+ <ul class="dropdown-menu dropdown-menu-lg-end" style="min-width: auto;">
4
+ <% I18n.available_locales.each do |locale| %>
5
+ <li><%= link_to (flag ? locale_to_flag(locale) : locale.upcase), lato.switch_locale_path(locale: locale), class: 'dropdown-item', data: { turbo_method: :post } %></li>
6
+ <% end %>
7
+ </ul>
8
+ </li>
@@ -0,0 +1,17 @@
1
+ <% if I18n.locale == 'en' %>
2
+
3
+ You have received an invitation to use <%= Lato.config.application_title %>.
4
+ <br><br>
5
+ Click the following link to accept the invitation and complete the registration:
6
+ <br><br>
7
+ <%= link_to lato.authentication_accept_invitation_url(id: @invitation.id, accepted_code: @invitation.accepted_code), lato.authentication_accept_invitation_url(id: @invitation.id, accepted_code: @invitation.accepted_code) %>
8
+
9
+ <% else %>
10
+
11
+ Hai ricevuto un invito per utilizzare <%= Lato.config.application_title %>.
12
+ <br><br>
13
+ Clicca il seguente link per accettare l'invito e completare la registrazione:
14
+ <br><br>
15
+ <%= link_to lato.authentication_accept_invitation_url(id: @invitation.id, accepted_code: @invitation.accepted_code), lato.authentication_accept_invitation_url(id: @invitation.id, accepted_code: @invitation.accepted_code) %>
16
+
17
+ <% end %>
@@ -1,3 +1,17 @@
1
+ <% if I18n.locale == 'en' %>
2
+
3
+ To have access to all the features of <%= Lato.config.application_title %> you must confirm your email address.
4
+ <br><br>
5
+ Click the following link to confirm your email address:
6
+ <br><br>
7
+ <%= link_to lato.authentication_verify_email_url(id: @user.id, code: @code), lato.authentication_verify_email_url(id: @user.id, code: @code) %>
8
+ <br><br>
9
+ <small>
10
+ We remind you that the link is valid for 30 minutes. If the link is expired you can request a new one from the management page of your <%= Lato.config.application_title %> account.
11
+ </small>
12
+
13
+ <% else %>
14
+
1
15
  Per avere accesso a tutte le funzionalità di <%= Lato.config.application_title %> devi confermare il tuo indirizzo email.
2
16
  <br><br>
3
17
  Clicca il seguente link per completare la procedura di configurazione:
@@ -6,4 +20,6 @@ Clicca il seguente link per completare la procedura di configurazione:
6
20
  <br><br>
7
21
  <small>
8
22
  Ti ricordiamo che il link è valido per 30 minuti. Se il link risulta scaduto puoi richiederne uno nuovo dalla pagina di gestione del tuo account <%= Lato.config.application_title %>.
9
- </small>
23
+ </small>
24
+
25
+ <% end %>
@@ -1,3 +1,17 @@
1
+ <% if I18n.locale == 'en' %>
2
+
3
+ An update to your <%= Lato.config.application_title %> account password has been requested.
4
+ <br><br>
5
+ To complete the password update, enter the following code in the update form:
6
+ <br><br>
7
+ <b><%= @code %></b>
8
+ <br><br>
9
+ <small>
10
+ We remind you that the code is valid for 30 minutes. If you have not made any password update request ignore this email and do not share the code with anyone.
11
+ </small>
12
+
13
+ <% else %>
14
+
1
15
  È stato richiesto un aggiornamento della password del tuo account <%= Lato.config.application_title %>.
2
16
  <br><br>
3
17
  Per completare l'aggiornamento inserisci il seguente codice nel form di aggiornamento:
@@ -6,4 +20,6 @@ Per completare l'aggiornamento inserisci il seguente codice nel form di aggiorna
6
20
  <br><br>
7
21
  <small>
8
22
  Ti ricordiamo che il codice è valido per 30 minuti. Se non hai effettuato alcuna richiesta di aggiornamento password ignora questa email e non condividere il codice con nessuno.
9
- </small>
23
+ </small>
24
+
25
+ <% end %>
@@ -4,7 +4,7 @@
4
4
  <div data-controller="lato-feedback" id="feedbackNotice" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
5
5
  <div class="toast-header">
6
6
  <i class="bi bi-check-circle-fill text-success me-2"></i>
7
- <strong class="me-auto">Operazione completata</strong>
7
+ <strong class="me-auto"><%= I18n.t('lato.operation_completed') %></strong>
8
8
  <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
9
9
  </div>
10
10
  <div class="toast-body">
@@ -13,4 +13,19 @@
13
13
  </div>
14
14
  </div>
15
15
  <% end %>
16
+
17
+ <% if alert %>
18
+ <div class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
19
+ <div data-controller="lato-feedback" id="feedbackAlert" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
20
+ <div class="toast-header">
21
+ <i class="bi bi-check-circle-fill text-danger me-2"></i>
22
+ <strong class="me-auto"><%= I18n.t('lato.operation_failed') %></strong>
23
+ <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
24
+ </div>
25
+ <div class="toast-body">
26
+ <%= alert %>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <% end %>
16
31
  </div>
@@ -4,8 +4,8 @@
4
4
  © <%= Date.today.year %> - <%= link_to Lato.config.application_company_name, Lato.config.application_company_url, target: '_blank' %>
5
5
  </div>
6
6
  <div class="mt-2 mt-md-0">
7
- <%= link_to I18n.t('labels.privacy_policy'), Lato.config.legal_privacy_policy_url %> -
8
- <%= link_to I18n.t('labels.terms_and_conditions'), Lato.config.legal_terms_and_conditions_url %>
7
+ <%= link_to I18n.t('lato.privacy_policy'), Lato.config.legal_privacy_policy_url %> -
8
+ <%= link_to I18n.t('lato.terms_and_conditions'), Lato.config.legal_terms_and_conditions_url %>
9
9
  </div>
10
10
  </div>
11
11
  </div>