lato 3.11.9 → 3.11.10
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 +4 -4
- data/app/assets/javascripts/lato/controllers/lato_account_form_user_controller.js +25 -0
- data/app/assets/javascripts/lato/controllers/lato_form_controller.js +1 -0
- data/app/assets/javascripts/lato/controllers/lato_index_controller.js +5 -1
- data/app/views/lato/account/_form-user.html.erb +3 -3
- data/lib/lato/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddd7c01a9cc4fe2d157455aef4dbd490520bfc6202e3fe6b9886bb9c50424ab6
|
4
|
+
data.tar.gz: 65074da85897c91205dc2f4163d7a9f1d8f8a28625f96a6114b28dd596e04b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e58f5ab69f0a9bd43ccecf90451ff7784925bf29261348a221ab6ebb0e33b06fc2887fb7799390ecad4b3b80c7e6095facd4c5b6503b7c0c1e366de7d806eb4
|
7
|
+
data.tar.gz: 3bcd8581b91971c86df3fcd7166ddef1978a899759533017ec915107ac019b79f03ee04f45d12841dabf80f4ef1864a274fd645239e2d75a845b1c2ad7c2d294
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = [
|
5
|
+
'emailInput',
|
6
|
+
'validateEmailLink'
|
7
|
+
]
|
8
|
+
|
9
|
+
connect() {
|
10
|
+
if (this.hasEmailInputTarget) this.emailInputOriginalValue = this.emailInputTarget.value
|
11
|
+
}
|
12
|
+
|
13
|
+
onEmailKeyUp(e) {
|
14
|
+
if (!this.hasEmailInputTarget || !this.hasValidateEmailLinkTarget) return
|
15
|
+
|
16
|
+
const newEmailInputValue = this.emailInputTarget.value
|
17
|
+
if (this.emailInputOriginalValue !== newEmailInputValue) {
|
18
|
+
this.validateEmailLinkTarget.classList.add('opacity-50')
|
19
|
+
this.validateEmailLinkTarget.style.pointerEvents = 'none'
|
20
|
+
} else {
|
21
|
+
this.validateEmailLinkTarget.classList.remove('opacity-50')
|
22
|
+
this.validateEmailLinkTarget.style.pointerEvents = 'auto'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -9,8 +9,12 @@ export default class extends Controller {
|
|
9
9
|
connect() {
|
10
10
|
}
|
11
11
|
|
12
|
+
/**
|
13
|
+
* Events
|
14
|
+
*/
|
15
|
+
|
16
|
+
// This event is used to reset the pagination when the user types in the search input to start a new search.
|
12
17
|
onSearchKeyUp(e) {
|
13
|
-
// Search the input with name "page" inside this.element and force value to 1
|
14
18
|
const pageInput = this.element.querySelector('input[name="page"]')
|
15
19
|
if (pageInput) pageInput.value = 1
|
16
20
|
}
|
@@ -5,7 +5,7 @@ user ||= Lato::User.new
|
|
5
5
|
%>
|
6
6
|
|
7
7
|
<%= turbo_frame_tag 'account_form-user' do %>
|
8
|
-
<%= form_with model: user, url: lato.account_update_user_action_path, data: { turbo_frame: '_self', controller: 'lato-form' } do |form| %>
|
8
|
+
<%= form_with model: user, url: lato.account_update_user_action_path, data: { turbo_frame: '_self', controller: 'lato-form lato-account-form-user' } do |form| %>
|
9
9
|
<%= lato_form_notices class: %w[mb-3] %>
|
10
10
|
<%= lato_form_errors user, class: %w[mb-3] %>
|
11
11
|
|
@@ -23,7 +23,7 @@ user ||= Lato::User.new
|
|
23
23
|
<div class="col col-12 col-lg-4 mb-3">
|
24
24
|
<%= lato_form_item_label form, :email %>
|
25
25
|
<div class="input-group mb-3">
|
26
|
-
<%= lato_form_item_input_email form, :email, required: true %>
|
26
|
+
<%= lato_form_item_input_email form, :email, required: true, data: { lato_account_form_user_target: 'emailInput', action: 'keyup->lato-account-form-user#onEmailKeyUp' } %>
|
27
27
|
<% if user.email_verified_at %>
|
28
28
|
<button
|
29
29
|
class="btn btn-outline-success"
|
@@ -31,7 +31,7 @@ user ||= Lato::User.new
|
|
31
31
|
aria-label="<%= I18n.t('lato.email_verified') %>"
|
32
32
|
><%= I18n.t('lato.email_verified') %></span>
|
33
33
|
<% else %>
|
34
|
-
<%= link_to I18n.t('lato.verify_email'), account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self' }, aria: { label: I18n.t('lato.verify_email') } %>
|
34
|
+
<%= link_to I18n.t('lato.verify_email'), account_request_verify_email_action_path, class: 'btn btn-warning', data: { turbo_method: :patch, turbo_frame: '_self', lato_account_form_user_target: 'validateEmailLink' }, aria: { label: I18n.t('lato.verify_email') } %>
|
35
35
|
<% end %>
|
36
36
|
</div>
|
37
37
|
</div>
|
data/lib/lato/version.rb
CHANGED
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: 3.11.
|
4
|
+
version: 3.11.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- app/assets/javascripts/lato/application.js
|
155
155
|
- app/assets/javascripts/lato/controllers/application.js
|
156
156
|
- app/assets/javascripts/lato/controllers/index.js
|
157
|
+
- app/assets/javascripts/lato/controllers/lato_account_form_user_controller.js
|
157
158
|
- app/assets/javascripts/lato/controllers/lato_action_controller.js
|
158
159
|
- app/assets/javascripts/lato/controllers/lato_aside_opener_controller.js
|
159
160
|
- app/assets/javascripts/lato/controllers/lato_confirm_controller.js
|