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,2 +1,7 @@
1
- Salve <%= @user.first_name %>,
2
- <br><br>
1
+ <% if I18n.locale == 'en' %>
2
+ Hello,
3
+ <br><br>
4
+ <% else %>
5
+ Salve,
6
+ <br><br>
7
+ <% end %>
@@ -1,15 +1,17 @@
1
1
  <% if @session.valid? %>
2
2
  <%= lato_navbar_nav_item :account, lato.account_path do %>
3
- <%= I18n.t('labels.account') %>
3
+ <%= I18n.t('lato.account') %>
4
4
  <% end %>
5
5
  <%= lato_navbar_nav_item :authentication_logout, lato.authentication_signout_path do %>
6
- <%= I18n.t('labels.signout') %>
6
+ <%= I18n.t('lato.signout') %>
7
7
  <% end %>
8
8
  <% else %>
9
9
  <%= lato_navbar_nav_item :authentication_signin, lato.authentication_signin_path do %>
10
- <%= I18n.t('labels.signin') %>
10
+ <%= I18n.t('lato.signin') %>
11
11
  <% end %>
12
12
  <%= lato_navbar_nav_item :authentication_signup, lato.authentication_signup_path do %>
13
- <%= I18n.t('labels.signup') %>
13
+ <%= I18n.t('lato.signup') %>
14
14
  <% end %>
15
15
  <% end %>
16
+
17
+ <%= lato_navbar_nav_locales_item(flag: true) %>
@@ -7,6 +7,9 @@
7
7
  <%= csrf_meta_tags %>
8
8
  <%= csp_meta_tag %>
9
9
 
10
+ <!-- TEMPORARY FIX: Popper js not working using bootstrap-gem -->
11
+ <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
12
+
10
13
  <%= stylesheet_link_tag Lato.config.assets_stylesheet_entry, media: "all" %>
11
14
  <%= javascript_importmap_tags %>
12
15
  </head>
data/config/importmap.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  pin "lato/application", to: "lato/application.js"
2
2
  pin_all_from Lato::Engine.root.join("app/assets/javascripts/lato/controllers"), under: "controllers", to: "lato/controllers"
3
3
 
4
- pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
5
- pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
6
- pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
7
- pin "bootstrap", to: "bootstrap.min.js", preload: true
8
- pin "@popperjs/core", to: "popper.js", preload: true
4
+ pin "bootstrap", to: "bootstrap.js", preload: true
5
+ # pin "@popperjs/core", to: "popper.js", preload: true
@@ -1,5 +1,5 @@
1
1
  en:
2
- labels:
2
+ lato:
3
3
  account: Account
4
4
  signout: Logout
5
5
  signin: Login
@@ -14,12 +14,41 @@ en:
14
14
  terms_and_conditions_checkbox: I accept the %{link}
15
15
  recover_password: Recover password
16
16
  next: Next
17
+ cancel: Cancel
17
18
  back_to_login: Back to login
18
19
  there_are_some_errors: There are some errors
19
20
  update_password: Update password
20
21
  confirm: Confirm
21
22
  search_for: Search for
22
23
  viewed_results: Results viewed
24
+ account_informations: Account informations
25
+ verify_email: Verify email
26
+ email_verified: Verified
27
+ update: Update
28
+ new_password: New password
29
+ confirm_new_password: Confirm new password
30
+ account_delete: Delete account
31
+ warning: Warning
32
+ account_delete_details: Deleting your account <b>will automatically delete all data associated</b> with it. By confirming the deletion there will be no way to recover the lost information.
33
+ account_delete_guide: Type in your registration email address and press "Delete Account" to proceed with the operation.
34
+ account_delete_confirm: Delete account
35
+ signup_email: Account email address
36
+ signout_confirmation_request: "%{user}, Are you sure to leave?"
37
+ recover_password_code: Code received by email
38
+ operation_completed: Operation completed
39
+ operation_failed: Operation failed
40
+ privacy_policy_update_title: Privacy policy update
41
+ terms_and_conditions_update_title: Terms and conditions update
42
+ accept_invitation: Accept invitation
43
+
44
+ account_controller:
45
+ update_user_action_notice: Account information properly updated
46
+ request_verify_email_action_notice: We have sent you an email with the steps to follow to complete the procedure
47
+ update_password_action_notice: Passwords updated successfully
48
+ authentication_controller:
49
+ verify_email_action_notice: Successfully verified email address
50
+ update_password_action_notice: Your password has been successfully updated
51
+
23
52
  activerecord:
24
53
  attributes:
25
54
  lato/user:
@@ -33,6 +62,17 @@ en:
33
62
  models:
34
63
  lato/user:
35
64
  attributes:
65
+ base:
66
+ email_sending_error: Unable to send mail
67
+ email_verification_limit: Wait at least 2 minutes to try a new email verification attempt
68
+ email_verification_code_expired: Email verification code has expired
69
+ email_verification_code_invalid: Email verification code is invalid
70
+ password_update_code_expired: Verification code has expired
71
+ password_update_code_invalid: Verification code is invalid
72
+ privacy_policy_invalid: To accept the privacy policy you must select the confirmation checkbox
73
+ terms_and_conditions_invalid: To accept the terms and conditions you must select the confirmation checkbox
74
+ password:
75
+ not_correct: not correct
36
76
  email:
37
77
  taken: already used with another account
38
78
  not_registered: not registered
@@ -41,3 +81,9 @@ en:
41
81
  inclusion: not accepted
42
82
  accepted_terms_and_conditions_version:
43
83
  inclusion: not accepted
84
+ lato/invitation:
85
+ attributes:
86
+ base:
87
+ already_accepted: Invitation already accepted
88
+ email_sending_error: Unable to send mail
89
+ email_sending_limit: Wait at least 2 minutes to try a new invite attempt
@@ -1,7 +1,7 @@
1
1
  # Start from: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/it.yml
2
2
 
3
3
  it:
4
- labels:
4
+ lato:
5
5
  account: Account
6
6
  signout: Esci
7
7
  signin: Accedi
@@ -16,12 +16,41 @@ it:
16
16
  terms_and_conditions_checkbox: Dichiaro di aver letto e accettato i %{link} di utilizzo
17
17
  recover_password: Recupero password
18
18
  next: Prosegui
19
+ cancel: Annulla
19
20
  back_to_login: Torna al login
20
21
  there_are_some_errors: Si sono verificati i seguenti errori
21
22
  update_password: Aggiornamento password
22
23
  confirm: Conferma
23
24
  search_for: Ricerca per
24
25
  viewed_results: Risultati visualizzati
26
+ account_informations: Informazioni account
27
+ verify_email: Verifica email
28
+ email_verified: Verificato
29
+ update: Aggiorna
30
+ new_password: Nuova password
31
+ confirm_new_password: Conferma nuova password
32
+ account_delete: Cancellazione account
33
+ warning: Attenzione
34
+ account_delete_details: Cancellando il tuo account <b>saranno automaticamente eliminati definitivamente tutti i dati</b> ad esso associati.<br>Confermando l'eliminazione non ci sarà più modo di recuperare le informazioni perse.
35
+ account_delete_guide: Digita il tuo indirizzo email di registrazione e premi "Elimina account" per procedere con l'operazione.
36
+ account_delete_confirm: Elimina account
37
+ signup_email: Indirizzo email di registrazione
38
+ signout_confirmation_request: "%{user}, Sei sicuro di voler uscire dal tuo account?"
39
+ recover_password_code: Codice ricevuto via email
40
+ operation_completed: Operazione completata
41
+ operation_failed: Operazione fallita
42
+ privacy_policy_update_title: Aggiornamento privacy policy
43
+ terms_and_conditions_update_title: Aggiornamento termini e condizioni
44
+ accept_invitation: Accetta invito
45
+
46
+ account_controller:
47
+ update_user_action_notice: Informazioni account aggiornate correttamente
48
+ request_verify_email_action_notice: Ti abbiamo inviato una email con i passaggi da seguire per completare la procedura
49
+ update_password_action_notice: Password aggiornate correttamente
50
+ authentication_controller:
51
+ verify_email_action_notice: Indirizzo email verificato correttamente
52
+ update_password_action_notice: La tua password è stata aggiornata correttamente
53
+
25
54
  activerecord:
26
55
  attributes:
27
56
  lato/user:
@@ -40,6 +69,18 @@ it:
40
69
  models:
41
70
  lato/user:
42
71
  attributes:
72
+ base:
73
+ email_sending_error: Impossibile inviare mail
74
+ email_verification_limit: Attendi almeno 2 minuti per provare un nuovo tentativo di verifica email
75
+ email_verification_code_expired: Il codice di verifica email risulta scaduto
76
+ email_verification_code_invalid: Il codice di verifica email non risulta valido
77
+ password_update_code_expired: Il codice di verifica risulta scaduto
78
+ password_update_code_invalid: Il codice di verifica non risulta valido
79
+ privacy_policy_invalid: Per accettare la privacy policy devi selezionare la checkbox di conferma
80
+ terms_and_conditions_invalid: Per accettare i termini e condizioni devi selezionare la checkbox di conferma
81
+ invitation_invalid: Invito non valido
82
+ password:
83
+ not_correct: non corretta
43
84
  password_confirmation:
44
85
  confirmation: non corrisponde alla password
45
86
  email:
@@ -50,6 +91,14 @@ it:
50
91
  inclusion: non accettata
51
92
  accepted_terms_and_conditions_version:
52
93
  inclusion: non accettati
94
+ lato/invitation:
95
+ attributes:
96
+ base:
97
+ already_accepted: Invito già accettato dall'utente
98
+ email_sending_error: Impossibile inviare mail
99
+ email_sending_limit: Attendi almeno 2 minuti per provare un nuovo tentativo di invito email
100
+
101
+
53
102
  date:
54
103
  abbr_day_names:
55
104
  - dom
data/config/routes.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  Lato::Engine.routes.draw do
2
2
  root 'application#index'
3
3
 
4
+ post '/switch_locale/:locale', to: 'application#switch_locale', as: 'switch_locale'
5
+
4
6
  # Authentication
5
7
  ##
6
8
 
@@ -17,6 +19,8 @@ Lato::Engine.routes.draw do
17
19
  post 'recover_password_action', to: 'authentication#recover_password_action', as: :authentication_recover_password_action
18
20
  get 'update_password', to: 'authentication#update_password', as: :authentication_update_password
19
21
  patch 'update_password_action', to: 'authentication#update_password_action', as: :authentication_update_password_action
22
+ get 'accept_invitation', to: 'authentication#accept_invitation', as: :authentication_accept_invitation
23
+ post 'accept_invitation_action', to: 'authentication#accept_invitation_action', as: :authentication_accept_invitation_action
20
24
  end
21
25
 
22
26
  scope :account do
@@ -0,0 +1,5 @@
1
+ class AddLocaleToLatoUser < ActiveRecord::Migration[7.0]
2
+ def change
3
+ add_column :lato_users, :locale, :string
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateLatoLogUserSignins < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :lato_log_user_signins do |t|
4
+ t.string :ip_address
5
+ t.string :user_agent
6
+ t.references :lato_user, index: true, foreign_key: true
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreateLatoInvitations < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :lato_invitations do |t|
4
+ t.string :email
5
+ t.datetime :accepted_at
6
+ t.string :accepted_code
7
+ t.references :lato_user, index: true, foreign_key: true
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
data/lib/lato/btstrap.rb CHANGED
@@ -17,7 +17,7 @@ module Lato
17
17
 
18
18
  def initialize
19
19
  # Navbar defaults
20
- @navbar = 'navbar-light navbar-expand-lg fixed-top bg-light shadow-sm px-md-3'
20
+ @navbar = 'navbar-dark navbar-expand-lg fixed-top bg-primary shadow-sm px-md-3'
21
21
  @navbar_container = 'container-fluid'
22
22
  @navbar_collapse = 'justify-content-end'
23
23
 
data/lib/lato/config.rb CHANGED
@@ -37,9 +37,9 @@ module Lato
37
37
  @email_from = 'lato@example.com'
38
38
 
39
39
  @legal_privacy_policy_url = '#'
40
- @legal_privacy_policy_version = 3
40
+ @legal_privacy_policy_version = 1
41
41
  @legal_terms_and_conditions_url = '#'
42
- @legal_terms_and_conditions_version = 2
42
+ @legal_terms_and_conditions_version = 1
43
43
  end
44
44
  end
45
45
  end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.27"
3
3
  end
@@ -27,7 +27,9 @@ namespace :lato do
27
27
  FileUtils.copy(src_file_path, dest_file_path) unless File.exist? dest_file_path
28
28
  end
29
29
 
30
- # Copy "lato_user_application.rb" model concern from ghem to main application
30
+ # Copy "lato_user_application.rb" model concern from gem to main application
31
+ ##
32
+
31
33
  gem_concern_path = Lato::Engine.root.join('app', 'models', 'concerns', 'lato_user_application.rb').to_s
32
34
  app_concern_path = Rails.root.join('app', 'models', 'concerns', 'lato_user_application.rb').to_s
33
35
  FileUtils.copy(gem_concern_path, app_concern_path) unless File.exist? app_concern_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-22 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -130,9 +130,13 @@ files:
130
130
  - app/helpers/lato/components_helper.rb
131
131
  - app/jobs/lato/application_job.rb
132
132
  - app/mailers/lato/application_mailer.rb
133
+ - app/mailers/lato/invitation_mailer.rb
133
134
  - app/mailers/lato/user_mailer.rb
134
135
  - app/models/concerns/lato_user_application.rb
135
136
  - app/models/lato/application_record.rb
137
+ - app/models/lato/invitation.rb
138
+ - app/models/lato/log.rb
139
+ - app/models/lato/log/user_signin.rb
136
140
  - app/models/lato/operation.rb
137
141
  - app/models/lato/session.rb
138
142
  - app/models/lato/user.rb
@@ -142,11 +146,14 @@ files:
142
146
  - app/views/lato/account/_form-password.html.erb
143
147
  - app/views/lato/account/_form-user.html.erb
144
148
  - app/views/lato/account/index.html.erb
149
+ - app/views/lato/authentication/_fields-registration.html.erb
150
+ - app/views/lato/authentication/_form-accept-invitation.html.erb
145
151
  - app/views/lato/authentication/_form-recover-password.html.erb
146
152
  - app/views/lato/authentication/_form-signin.html.erb
147
153
  - app/views/lato/authentication/_form-signup.html.erb
148
154
  - app/views/lato/authentication/_form-update-password.html.erb
149
155
  - app/views/lato/authentication/_form-verify-email.html.erb
156
+ - app/views/lato/authentication/accept_invitation.html.erb
150
157
  - app/views/lato/authentication/recover_password.html.erb
151
158
  - app/views/lato/authentication/signin.html.erb
152
159
  - app/views/lato/authentication/signout.html.erb
@@ -155,9 +162,11 @@ files:
155
162
  - app/views/lato/authentication/verify_email.html.erb
156
163
  - app/views/lato/components/_index.html.erb
157
164
  - app/views/lato/components/_navbar_nav_item.html.erb
165
+ - app/views/lato/components/_navbar_nav_locales_item.html.erb
158
166
  - app/views/lato/components/_operation.html.erb
159
167
  - app/views/lato/components/_page_head.html.erb
160
168
  - app/views/lato/components/_sidebar_nav_item.html.erb
169
+ - app/views/lato/mailer/invitation/invite_mail.html.erb
161
170
  - app/views/lato/mailer/user/email_verification_mail.html.erb
162
171
  - app/views/lato/mailer/user/password_update_mail.html.erb
163
172
  - app/views/lato/operations/show.html.erb
@@ -181,6 +190,9 @@ files:
181
190
  - config/routes.rb
182
191
  - db/migrate/20221022205744_create_lato_users.rb
183
192
  - db/migrate/20221118072130_create_lato_operations.rb
193
+ - db/migrate/20221229233844_add_locale_to_lato_user.rb
194
+ - db/migrate/20230109054412_create_lato_log_user_signins.rb
195
+ - db/migrate/20230109061533_create_lato_invitations.rb
184
196
  - lib/lato.rb
185
197
  - lib/lato/btstrap.rb
186
198
  - lib/lato/config.rb