lato 3.14.3 → 3.14.6

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: 4bd28a8dd385f29b03486c0822cbcf41984a4b37f41961a572c1be884db52fc4
4
- data.tar.gz: f67713eae56568be454d1bb6a42850daa3469ef3dda0a289d931b1d16217855f
3
+ metadata.gz: 2c6664ab48177f66d9fb4290210f2d8390fe5b9c6bbbfd7ce90640edac41ed20
4
+ data.tar.gz: 7aae0d3c205a4207dce4499ff73870d0fd08c360a145fff08763c8e5181e0a25
5
5
  SHA512:
6
- metadata.gz: 5df4ec19f91131f7e05d59db50e376e00b91f42931e059a4c39cb366ae502bfb1d899958a3fb6baabe12f6672e7c6205f7c84e376870a3e5f7ddef1c721c89c5
7
- data.tar.gz: 6944543a605c6fcd65ff8fb8cb1261b77953c84c3645789f524866db4725bbb828628db746c77e697c2d4a39c08aa4401a004fb094076165a84abe3f7ec679e2
6
+ metadata.gz: 157174be653d6fb1030c1963ad66f77e54ec9d4bf69896ee7e29dd781dfb31744d1cb5a5782d73c604da161852fcb26f6ecdaf9ad8d3e43caf7898089d63fda9
7
+ data.tar.gz: 397e59f83ea024e125d97ded46a4616835ba8878bc0ab1f8c85d55d5e6d6e2d46ea682137db3171f987221da43ae2347d76699c4f51bafcb092a64da793a4341
@@ -51,6 +51,12 @@ document.addEventListener('turbo:before-cache', (e) => {
51
51
  document.body.style.paddingRight = ''
52
52
  document.body.style.overflow = ''
53
53
 
54
+ // close sidebar submenus
55
+ document.querySelectorAll('aside .nav-item .collapse.show').forEach((el) => {
56
+ if (el.querySelector('.nav-link.active')) return // keep open if contains active link
57
+ el.classList.remove('show')
58
+ })
59
+
54
60
  // close nav menu (for mobile)
55
61
  document.querySelector('.navbar-toggler').classList.add('collapsed')
56
62
  document.querySelector('.navbar-collapse').classList.remove('show')
@@ -61,6 +61,11 @@ aside {
61
61
  max-height: 100vh;
62
62
  position: sticky;
63
63
  top: 0;
64
+
65
+ .dropdown-toggle::after {
66
+ position: absolute;
67
+ right: 0.5rem;
68
+ }
64
69
  }
65
70
 
66
71
  main, aside {
@@ -293,7 +293,6 @@ module Lato
293
293
  "remoteip" => request.remote_ip
294
294
  })
295
295
  result = JSON.parse(response.body)
296
- Rails.logger.info("[hCaptcha] Verification remoteip: #{request.remote_ip}")
297
296
  Rails.logger.info("[hCaptcha] Verification result: #{result}")
298
297
  unless result["success"]
299
298
  @user.errors.add(:base, "hCaptcha verification failed")
@@ -21,11 +21,21 @@ module Lato
21
21
  # Sidebar
22
22
  ##
23
23
 
24
- def lato_sidebar_nav_item(key, path, &block)
24
+ def lato_sidebar_nav_item(key, path, external: false, children: nil, &block)
25
25
  active = request.path == path
26
26
  active = @sidebar_key == key if @sidebar_key
27
+
28
+ # se ci sono children, verifico se uno di questi è attivo e assegno a active la key del child attivo
29
+ if children && children.is_a?(Array)
30
+ children.each do |child|
31
+ if request.path == child[:path] || (@sidebar_key && @sidebar_key == (child[:key] || key))
32
+ active = child[:key] || key
33
+ break
34
+ end
35
+ end
36
+ end
27
37
 
28
- render 'lato/components/sidebar_nav_item', active: active, path: path do
38
+ render 'lato/components/sidebar_nav_item', key: key, active: active, path: path, external: external, children: children do
29
39
  yield if block
30
40
  end
31
41
  end
@@ -1,5 +1,51 @@
1
- <li class="nav-item border-bottom py-2">
2
- <%= link_to path, class: ['nav-link', (active ? 'active' : 'link-dark')] do %>
3
- <%= yield %>
4
- <% end %>
5
- </li>
1
+ <%
2
+
3
+ # Controlla se ci sono children da visualizzare
4
+ has_children = children&.any?
5
+
6
+ # Se non ci sono children, comportamento normale
7
+ unless has_children
8
+ link_to_options = {
9
+ class: ['nav-link position-relative', (active ? 'active' : 'link-dark')].join(' '),
10
+ }
11
+ link_to_options[:target] = '_blank' if external
12
+ end
13
+
14
+ %>
15
+
16
+ <% if has_children %>
17
+ <!-- Menu con dropdown per children -->
18
+ <li class="nav-item border-bottom py-2">
19
+ <div class="nav-link position-relative dropdown">
20
+ <a href="#" class="link-dark text-decoration-none dropdown-toggle d-flex align-items-center"
21
+ data-bs-toggle="collapse"
22
+ data-bs-target="#sidebar-nav-item-dropdown-<%= key || 'item' %>"
23
+ aria-expanded="<%= active ? 'true' : 'false' %>">
24
+ <%= yield %>
25
+ </a>
26
+
27
+ <div class="collapse <%= 'show' if active %>" id="sidebar-nav-item-dropdown-<%= key || 'item' %>">
28
+ <ul class="list-unstyled mt-2 border-start border-1 ps-2">
29
+ <% children.each do |child| %>
30
+ <li class="py-1">
31
+ <%= link_to child[:path], class: ['nav-link py-1', (active == child[:key] ? 'active' : 'link-dark')].join(' ') do %>
32
+ <%= child[:label] %>
33
+ <% end %>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ </div>
38
+ </div>
39
+ </li>
40
+ <% else %>
41
+ <!-- Menu normale senza children -->
42
+ <li class="nav-item border-bottom py-2">
43
+ <%= link_to path, link_to_options do %>
44
+ <%= yield %>
45
+
46
+ <% if external %>
47
+ <i class="bi bi-arrow-up-right position-absolute end-0 top-50 translate-middle-y me-2" style="font-size: 0.75rem"></i>
48
+ <% end %>
49
+ <% end %>
50
+ </li>
51
+ <% end %>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.14.3"
2
+ VERSION = "3.14.6"
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: 3.14.3
4
+ version: 3.14.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-27 00:00:00.000000000 Z
11
+ date: 2025-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails