lato 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e341af1abdc45fd1bd1676413dda8067d5d4e304162595688d39238a1ac0f76b
4
- data.tar.gz: 260f04739041cbbabf4228ea860acca5be4a1a8c66c82832267b4f468eded4aa
3
+ metadata.gz: 9de0f3c577de71281285308e350bed0073176c965ebf547b2f25444b878c1d08
4
+ data.tar.gz: 3af1560ba719db9e0c70207691390bdc5f531753e6f03c7c68c26fbc9956a2cc
5
5
  SHA512:
6
- metadata.gz: 511960e3a047e5d80547ac0b83ddf4ca4270bf3248ba608c62c72da1ecf5cf330eb7f79a06e3e9ea47e99e9364d5da643da114f36836419bb99349d30554245c
7
- data.tar.gz: 9e5e79926336ec3a85c1304214cfad71b41d93aedd2623a128a0f9735b24f2a8dfcdf94aa2c33166a8e91f51a4ea309965fc979bf4dcd0fed522b5460370c8b7
6
+ metadata.gz: 7881dc95427a4bc0dd67a1639acb8522f68dcbda8fc03cbe435e4bc1ccfdd6012b55eedb445f37e9ccc1e43b400e27290379396cb749d700f518eb1bb7c1c454
7
+ data.tar.gz: a50fef0983d22202e8b82a5981bddac638d2adcacf0399bd34c7f0fe188fb0e9cb15583c9b3977cc723714bc50bb4315394498722cb349730376351419af53cd
@@ -5,6 +5,7 @@ module Lato
5
5
  before_action :find_user, only: %i[verify_email verify_email_action update_password update_password_action]
6
6
  before_action :hide_sidebar
7
7
  before_action :lock_signup_if_disabled, only: %i[signup signup_action]
8
+ before_action :lock_recover_password_if_disabled, only: %i[recover_password recover_password_action update_password update_password_action]
8
9
 
9
10
  def signin
10
11
  @user = Lato::User.new
@@ -117,5 +118,11 @@ module Lato
117
118
 
118
119
  respond_to_with_404
119
120
  end
121
+
122
+ def lock_recover_password_if_disabled
123
+ return unless Lato.config.auth_disable_recover_password
124
+
125
+ respond_to_with_404
126
+ end
120
127
  end
121
128
  end
@@ -111,7 +111,7 @@ module Lato
111
111
  end
112
112
 
113
113
  content_tag :div, options do
114
- concat content_tag(:span, 'Si sono verificati i seguenti errori:')
114
+ concat content_tag(:span, "#{I18n.t('labels.there_are_some_errors')}:")
115
115
  concat errors_list
116
116
  concat button_tag('', type: 'button', class: 'btn-close', data: { bs_dismiss: 'alert' }) unless options[:fixed]
117
117
  end
@@ -118,7 +118,7 @@ module Lato
118
118
 
119
119
  def destroy_with_confirmation(params)
120
120
  unless params[:email_confirmation] == email
121
- errors.add(:email, 'non corretto')
121
+ errors.add(:email, :not_correct)
122
122
  return
123
123
  end
124
124
 
@@ -128,7 +128,7 @@ module Lato
128
128
  def request_recover_password(params)
129
129
  user = Lato::User.find_by(email: params[:email])
130
130
  unless user
131
- errors.add(:email, 'non registrato')
131
+ errors.add(:email, :not_registered)
132
132
  return
133
133
  end
134
134
 
@@ -9,12 +9,12 @@ 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, :email, 'Inserisci la tua email' %>
12
+ <%= lato_form_item_label form, :email %>
13
13
  <%= lato_form_item_input_email form, :email, required: true %>
14
14
  </div>
15
15
 
16
16
  <div>
17
- <%= lato_form_submit form, 'Prosegui', class: %w[d-block w-100] %>
17
+ <%= lato_form_submit form, I18n.t('labels.next'), class: %w[d-block w-100] %>
18
18
  </div>
19
19
  <% end %>
20
20
  <% end %>
@@ -10,21 +10,21 @@ 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, 'Email' %>
13
+ <%= lato_form_item_label form, :email %>
14
14
  <%= lato_form_item_input_email form, :email, required: true %>
15
15
  </div>
16
16
 
17
17
  <div class="mb-3">
18
- <%= lato_form_item_label form, :password, 'Password' %>
18
+ <%= lato_form_item_label form, :password %>
19
19
  <%= lato_form_item_input_password form, :password, required: true %>
20
20
  </div>
21
21
 
22
22
  <div>
23
- <%= lato_form_submit form, 'Accedi', class: %w[d-block w-100] %>
23
+ <%= lato_form_submit form, I18n.t('labels.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
- oppure <%= link_to 'crea un account gratuito', lato.authentication_signup_path %>
27
+ <%= I18n.t('labels.or').downcase %> <%= link_to I18n.t('labels.create_free_account').downcase, lato.authentication_signup_path %>
28
28
  </div>
29
29
  <% end %>
30
30
  <% end %>
@@ -10,38 +10,38 @@ user ||= Lato::User.new
10
10
 
11
11
  <div class="row">
12
12
  <div class="col col-12 col-md-6 mb-3">
13
- <%= lato_form_item_label form, :first_name, 'Nome' %>
13
+ <%= lato_form_item_label form, :first_name %>
14
14
  <%= lato_form_item_input_text form, :first_name, required: true %>
15
15
  </div>
16
16
 
17
17
  <div class="col col-12 col-md-6 mb-3">
18
- <%= lato_form_item_label form, :last_name, 'Cognome' %>
18
+ <%= lato_form_item_label form, :last_name %>
19
19
  <%= lato_form_item_input_text form, :last_name, required: true %>
20
20
  </div>
21
21
 
22
22
  <div class="col col-12 mb-3">
23
- <%= lato_form_item_label form, :email, 'Email' %>
23
+ <%= lato_form_item_label form, :email %>
24
24
  <%= lato_form_item_input_email form, :email, required: true %>
25
25
  </div>
26
26
 
27
27
  <div class="col col-12 col-md-6 mb-3">
28
- <%= lato_form_item_label form, :password, 'Password' %>
28
+ <%= lato_form_item_label form, :password %>
29
29
  <%= lato_form_item_input_password form, :password, required: true %>
30
30
  </div>
31
31
 
32
32
  <div class="col col-12 col-md-6 mb-3">
33
- <%= lato_form_item_label form, :password_confirmation, 'Conferma password' %>
33
+ <%= lato_form_item_label form, :password_confirmation %>
34
34
  <%= lato_form_item_input_password form, :password_confirmation, required: true %>
35
35
  </div>
36
36
  </div>
37
37
 
38
38
  <div class="mb-3 text-muted" style="font-size: 14px;">
39
- <%= lato_form_item_input_check form, :accepted_privacy_policy_version, "Dichiaro di aver letto e accettato la <a href=#{Lato.config.legal_privacy_policy_url} target=_blank>privacy policy</a>.", required: true %>
40
- <%= lato_form_item_input_check form, :accepted_terms_and_conditions_version, "Dichiaro di aver letto e accettato i <a href=#{Lato.config.legal_terms_and_conditions_url} target=_blank>termini e condizioni</a> di utilizzo.", required: true %>
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
41
  </div>
42
42
 
43
43
  <div class="d-flex justify-content-end">
44
- <%= lato_form_submit form, 'Registrati' %>
44
+ <%= lato_form_submit form, I18n.t('labels.signup') %>
45
45
  </div>
46
46
  <% end %>
47
47
  <% end %>
@@ -24,7 +24,7 @@ user ||= Lato::User.new
24
24
  </div>
25
25
 
26
26
  <div class="d-flex justify-content-end">
27
- <%= lato_form_submit form, 'Conferma' %>
27
+ <%= lato_form_submit form, I18n.t('labels.confirm') %>
28
28
  </div>
29
29
  <% end %>
30
30
  <% end %>
@@ -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">Recupero password</h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.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 'Torna al login', lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('labels.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
11
11
  </div>
12
12
  </div>
13
13
  </div>
@@ -1,13 +1,15 @@
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">Accedi</h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.signin') %></h1>
5
5
  </div>
6
6
  <div class="card-body">
7
7
  <%= render 'lato/authentication/form-signin', user: @user %>
8
8
  </div>
9
- <div class="card-footer text-center">
10
- <%= link_to 'Hai dimenticato la password?', lato.authentication_recover_password_path, class: 'text-muted' %>
11
- </div>
9
+ <% unless Lato.config.auth_disable_recover_password %>
10
+ <div class="card-footer text-center">
11
+ <%= link_to I18n.t('labels.forgot_your_password?'), lato.authentication_recover_password_path, class: 'text-muted' %>
12
+ </div>
13
+ <% end %>
12
14
  </div>
13
15
  </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">Registrati</h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.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 'Hai già un account?', lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('labels.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">Aggiornamento password</h1>
4
+ <h1 class="fs-3 mb-0 text-center"><%= I18n.t('labels.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 'Torna al login', lato.authentication_signin_path, class: 'text-muted' %>
10
+ <%= link_to I18n.t('labels.back_to_login'), lato.authentication_signin_path, class: 'text-muted' %>
11
11
  </div>
12
12
  </div>
13
13
  </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 'Privacy policy', Lato.config.legal_privacy_policy_url %> -
8
- <%= link_to 'Termini e condizioni', Lato.config.legal_terms_and_conditions_url %>
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 %>
9
9
  </div>
10
10
  </div>
11
11
  </div>
@@ -1,15 +1,15 @@
1
1
  <% if @session.valid? %>
2
2
  <%= lato_navbar_nav_item :account, lato.account_path do %>
3
- Account
3
+ <%= I18n.t('labels.account') %>
4
4
  <% end %>
5
5
  <%= lato_navbar_nav_item :authentication_logout, lato.authentication_signout_path do %>
6
- Esci
6
+ <%= I18n.t('labels.signout') %>
7
7
  <% end %>
8
8
  <% else %>
9
9
  <%= lato_navbar_nav_item :authentication_signin, lato.authentication_signin_path do %>
10
- Accedi
10
+ <%= I18n.t('labels.signin') %>
11
11
  <% end %>
12
12
  <%= lato_navbar_nav_item :authentication_signup, lato.authentication_signup_path do %>
13
- Registrati
13
+ <%= I18n.t('labels.signup') %>
14
14
  <% end %>
15
15
  <% end %>
@@ -0,0 +1,41 @@
1
+ en:
2
+ labels:
3
+ account: Account
4
+ signout: Logout
5
+ signin: Login
6
+ signup: Signup
7
+ forgot_your_password?: Forgot your password?
8
+ already_have_an_account?: Already have an account?
9
+ or: Or
10
+ create_free_account: Create free account
11
+ privacy_policy: Privacy policy
12
+ privacy_policy_checkbox: I accept the %{link}
13
+ terms_and_conditions: Terms and conditions
14
+ terms_and_conditions_checkbox: I accept the %{link}
15
+ recover_password: Recover password
16
+ next: Next
17
+ back_to_login: Back to login
18
+ there_are_some_errors: There are some errors
19
+ update_password: Update password
20
+ confirm: Confirm
21
+ activerecord:
22
+ attributes:
23
+ lato/user:
24
+ first_name: First name
25
+ last_name: Last name
26
+ password_confirmation: Confirm password
27
+ email: Email
28
+ accepted_privacy_policy_version: Privacy policy
29
+ accepted_terms_and_conditions_version: Terms and conditions
30
+ errors:
31
+ models:
32
+ lato/user:
33
+ attributes:
34
+ email:
35
+ taken: already used with another account
36
+ not_registered: not registered
37
+ not_correct: not correct
38
+ accepted_privacy_policy_version:
39
+ inclusion: not accepted
40
+ accepted_terms_and_conditions_version:
41
+ inclusion: not accepted
@@ -1,6 +1,25 @@
1
1
  # Start from: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/it.yml
2
2
 
3
3
  it:
4
+ labels:
5
+ account: Account
6
+ signout: Esci
7
+ signin: Accedi
8
+ signup: Registrati
9
+ forgot_your_password?: Hai dimenticato la password?
10
+ already_have_an_account?: Hai già un account?
11
+ or: Oppure
12
+ create_free_account: Crea un account gratuito
13
+ privacy_policy: Privacy policy
14
+ privacy_policy_checkbox: Dichiaro di aver letto e accettato la %{link}
15
+ terms_and_conditions: Termini e condizioni
16
+ terms_and_conditions_checkbox: Dichiaro di aver letto e accettato i %{link} di utilizzo
17
+ recover_password: Recupero password
18
+ next: Prosegui
19
+ back_to_login: Torna al login
20
+ there_are_some_errors: Si sono verificati i seguenti errori
21
+ update_password: Aggiornamento password
22
+ confirm: Conferma
4
23
  activerecord:
5
24
  attributes:
6
25
  lato/user:
@@ -23,6 +42,8 @@ it:
23
42
  confirmation: non corrisponde alla password
24
43
  email:
25
44
  taken: già utilizzato da un altro account
45
+ not_registered: non registrata
46
+ not_correct: non corretta
26
47
  accepted_privacy_policy_version:
27
48
  inclusion: non accettata
28
49
  accepted_terms_and_conditions_version:
data/lib/lato/config.rb CHANGED
@@ -10,7 +10,7 @@ module Lato
10
10
  attr_accessor :session_lifetime, :session_root_path
11
11
 
12
12
  # Authentication configs
13
- attr_accessor :auth_disable_signup
13
+ attr_accessor :auth_disable_signup, :auth_disable_recover_password
14
14
 
15
15
  # Assets configs
16
16
  attr_accessor :assets_stylesheet_entry
@@ -27,6 +27,7 @@ module Lato
27
27
  @application_company_url = 'https://github.com/Lato-GAM'
28
28
 
29
29
  @auth_disable_signup = false
30
+ @auth_disable_recover_password = false
30
31
 
31
32
  @assets_stylesheet_entry = 'application'
32
33
 
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.21"
2
+ VERSION = "0.1.23"
3
3
  end
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.21
4
+ version: 0.1.23
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-11 00:00:00.000000000 Z
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -176,6 +176,7 @@ files:
176
176
  - app/views/layouts/lato/application.html.erb
177
177
  - app/views/layouts/lato/mailer.html.erb
178
178
  - config/importmap.rb
179
+ - config/locales/en.yml
179
180
  - config/locales/it.yml
180
181
  - config/routes.rb
181
182
  - db/migrate/20221022205744_create_lato_users.rb