lato 0.1.17 → 0.1.19

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: ab858e111115e6d96dccd40d65f12b249847b0c6ea90d82e9eaaf6027eb70c7e
4
- data.tar.gz: ccfc3c5ffed16097f8d8e10bace117d42376ae56798f5370dc2e3cc1ed7c4e4a
3
+ metadata.gz: ad4feff73a5b285980cad936d0fee7d95760fb60849a99bd0c3d0176142e3a21
4
+ data.tar.gz: 3adc8605691d718271b8d166e6ed47117a8c18c608087b90cbec8695c1cbf2be
5
5
  SHA512:
6
- metadata.gz: c6efd8f148357ae917cf2469a7e59024904c7b3c0b2d1112dfaa3dba69f9a9818c183f1620225d9d39ff7a004df7c15106622fba2f9819c3c3282d5ce38a45fb
7
- data.tar.gz: df91762636fc90ed103c2499992b659d810876f33ee202ecfcaee8fb55f999e8dba29a09c17d906af0d4493130cede3c42549227286c1ae73792c4c18d00fa23
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.update(params.require(:user).permit(:accepted_privacy_policy_version))
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.update(params.require(:user).permit(:accepted_terms_and_conditions_version))
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
@@ -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.legal_privacy_policy_version
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
@@ -7,9 +7,9 @@
7
7
  Ti informiamo che è stato rilasciato un <b>aggiornamento della nostra privacy policy</b>.<br>
8
8
  Per continuare a utilizzare <%= Lato.config.application_title %> è necessario prendere visione e accettare la nuova privacy policy.<br>
9
9
  </p>
10
- <%= form_with method: :patch, url: lato.account_update_accepted_privacy_policy_version_action_path, data: { turbo_frame: '_self' } do |form| %>
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, :accepted_privacy_policy_version, "Dichiaro di aver letto e accettato la <a href=#{Lato.config.legal_privacy_policy_url} target=_blank>privacy policy</a>.", checked: false, value: Lato.config.legal_privacy_policy_version, required: true %>
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' %>
@@ -7,9 +7,9 @@
7
7
  Ti informiamo che è stato rilasciato un <b>aggiornamento dei nostri termini e condizioni</b> di utilizzo.<br>
8
8
  Per continuare a utilizzare <%= Lato.config.application_title %> è necessario prendere visione e accettare i nuovi termini.<br>
9
9
  </p>
10
- <%= form_with method: :patch, url: lato.account_update_accepted_terms_and_conditions_version_action_path, data: { turbo_frame: '_self' } do |form| %>
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, :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.", checked: false, value: Lato.config.legal_terms_and_conditions_version, required: true %>
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 = 1
39
+ @legal_privacy_policy_version = 3
40
40
  @legal_terms_and_conditions_url = '#'
41
- @legal_terms_and_conditions_version = 1
41
+ @legal_terms_and_conditions_version = 2
42
42
  end
43
43
  end
44
44
  end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante