lato 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/lato/account_controller.rb +2 -2
- data/app/models/lato/user.rb +19 -1
- data/app/views/lato/account/_alert-accepted-privacy-policy-version.html.erb +1 -1
- data/app/views/lato/account/_alert-accepted-terms-and-conditions-version.html.erb +1 -1
- data/lib/lato/config.rb +2 -2
- data/lib/lato/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad4feff73a5b285980cad936d0fee7d95760fb60849a99bd0c3d0176142e3a21
|
4
|
+
data.tar.gz: 3adc8605691d718271b8d166e6ed47117a8c18c608087b90cbec8695c1cbf2be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eb0a4e4238e1785feaff6835fa58a23d5005ec42f3e089ad78b9ad4bb5acc1ec23d20a845a092857178fa25081ed9191880b248c4cfc0af24447af9032de3ec
|
7
|
+
data.tar.gz: a679295a0941f082ebb1a51c836a22c23f9a75a43484797f05842f0f8bc871a417555d0cfcb3b27992656c3019fc5afb160a729a7af8d921ce89d1ad2552e80e
|
@@ -57,7 +57,7 @@ module Lato
|
|
57
57
|
|
58
58
|
def update_accepted_privacy_policy_version_action
|
59
59
|
respond_to do |format|
|
60
|
-
if @session.user.
|
60
|
+
if @session.user.update_accepted_privacy_policy_version(params.require(:user).permit(:confirm))
|
61
61
|
format.html { redirect_to lato.account_path }
|
62
62
|
format.json { render json: @session.user }
|
63
63
|
else
|
@@ -69,7 +69,7 @@ module Lato
|
|
69
69
|
|
70
70
|
def update_accepted_terms_and_conditions_version_action
|
71
71
|
respond_to do |format|
|
72
|
-
if @session.user.
|
72
|
+
if @session.user.update_accepted_terms_and_conditions_version(params.require(:user).permit(:confirm))
|
73
73
|
format.html { redirect_to lato.account_path }
|
74
74
|
format.json { render json: @session.user }
|
75
75
|
else
|
data/app/models/lato/user.rb
CHANGED
@@ -46,7 +46,7 @@ module Lato
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def valid_accepted_terms_and_conditions_version?
|
49
|
-
@valid_accepted_terms_and_conditions_version ||= accepted_terms_and_conditions_version >= Lato.config.
|
49
|
+
@valid_accepted_terms_and_conditions_version ||= accepted_terms_and_conditions_version >= Lato.config.legal_terms_and_conditions_version
|
50
50
|
end
|
51
51
|
|
52
52
|
# Helpers
|
@@ -162,5 +162,23 @@ module Lato
|
|
162
162
|
|
163
163
|
update(params.permit(:password, :password_confirmation))
|
164
164
|
end
|
165
|
+
|
166
|
+
def update_accepted_privacy_policy_version(params)
|
167
|
+
unless params[:confirm]
|
168
|
+
errors.add(:base, 'Per accettare la privacy policy devi selezionare la checkbox di conferma')
|
169
|
+
return
|
170
|
+
end
|
171
|
+
|
172
|
+
update(accepted_privacy_policy_version: Lato.config.legal_privacy_policy_version)
|
173
|
+
end
|
174
|
+
|
175
|
+
def update_accepted_terms_and_conditions_version(params)
|
176
|
+
unless params[:confirm]
|
177
|
+
errors.add(:base, 'Per accettare i termini e condizioni devi selezionare la checkbox di conferma')
|
178
|
+
return
|
179
|
+
end
|
180
|
+
|
181
|
+
update(accepted_terms_and_conditions_version: Lato.config.legal_terms_and_conditions_version)
|
182
|
+
end
|
165
183
|
end
|
166
184
|
end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</p>
|
10
10
|
<%= form_with model: @session.user, url: lato.account_update_accepted_privacy_policy_version_action_path, data: { turbo_frame: '_self' } do |form| %>
|
11
11
|
<%= lato_form_errors @session.user, class: %w[mb-3] %>
|
12
|
-
<%= lato_form_item_input_check form, :
|
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 %>
|
13
13
|
|
14
14
|
<div class="mt-3">
|
15
15
|
<%= lato_form_submit form, 'Conferma' %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</p>
|
10
10
|
<%= form_with model: @session.user, url: lato.account_update_accepted_terms_and_conditions_version_action_path, data: { turbo_frame: '_self' } do |form| %>
|
11
11
|
<%= lato_form_errors @session.user, class: %w[mb-3] %>
|
12
|
-
<%= lato_form_item_input_check form, :
|
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 %>
|
13
13
|
|
14
14
|
<div class="mt-3">
|
15
15
|
<%= lato_form_submit form, 'Conferma' %>
|
data/lib/lato/config.rb
CHANGED
@@ -36,9 +36,9 @@ module Lato
|
|
36
36
|
@email_from = 'lato@example.com'
|
37
37
|
|
38
38
|
@legal_privacy_policy_url = '#'
|
39
|
-
@legal_privacy_policy_version =
|
39
|
+
@legal_privacy_policy_version = 3
|
40
40
|
@legal_terms_and_conditions_url = '#'
|
41
|
-
@legal_terms_and_conditions_version =
|
41
|
+
@legal_terms_and_conditions_version = 2
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/lato/version.rb
CHANGED