lato 3.10.12 → 3.11.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 890f6071431f470805aa8c253844356565814fbdc2ceb6152135fba2c02e79aa
|
4
|
+
data.tar.gz: 8eddac1dc91f0a5755ee40a115b45038c023393e7ffee6200e796968c79a1a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ece6a0739114376e060e78d5a05e967d76d5469363635d0f3912de92e1f1861ca7c6b862e666257b31a1beeec31d6387f03a6f9ebbe3ebffb366685929b6b4
|
7
|
+
data.tar.gz: 113ea99f5ba6a087dafdf6594d348ecb283451010766254b2c207c1ff68841791171482866e2df7b8f4d49a4a68f79755076b5a6a0a54870a71492dc8e738b69
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Lato
|
2
|
-
|
2
|
+
|
3
|
+
Lato is a Rails Engine to deliver a full featured web panel for your Rails application.
|
3
4
|
|
4
5
|
This gem includes:
|
5
6
|
- User management with full authentication (signin, signup, recover password);
|
@@ -77,7 +78,7 @@ end
|
|
77
78
|
### Extra tasks
|
78
79
|
Lato integrates by default a basic PWAs manifest and service worker. To re-generate them with all required assets follow these steps:
|
79
80
|
|
80
|
-
1. Complete the configuration of lato on a custom initializer (see [configuration](https://github.com/lato-
|
81
|
+
1. Complete the configuration of lato on a custom initializer (see [configuration](https://github.com/lato-org/lato/blob/main/lib/lato/config.rb) options for more details)
|
81
82
|
2. Add an icon.png file on **public/icon.png** with minimum size of 512x512px
|
82
83
|
3. Run the following commands:
|
83
84
|
|
@@ -91,7 +92,7 @@ $ rails lato:generate:pwa
|
|
91
92
|
Clone repository, install dependencies, run migrations and start:
|
92
93
|
|
93
94
|
```shell
|
94
|
-
$ git clone https://github.com/
|
95
|
+
$ git clone https://github.com/lato-org/lato
|
95
96
|
$ cd lato
|
96
97
|
$ bundle
|
97
98
|
$ rails db:migrate
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static targets = ['item']
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Stimulus
|
8
|
+
*/
|
9
|
+
|
10
|
+
connect() {
|
11
|
+
const localStorageStatus = localStorage.getItem('lato_guide')
|
12
|
+
this.status = localStorageStatus ? JSON.parse(localStorageStatus) : {}
|
13
|
+
this.storeStatus()
|
14
|
+
|
15
|
+
this.start()
|
16
|
+
}
|
17
|
+
|
18
|
+
start(e = null) {
|
19
|
+
if (e) e.preventDefault()
|
20
|
+
|
21
|
+
const targets = this.itemTargets.map(item => ({ element: item, key: item.dataset.guideKey, content: item.dataset.guideContent, index: parseInt(item.dataset.guideIndex) })).map(item => {
|
22
|
+
item.index = isNaN(item.index) ? 999 : item.index
|
23
|
+
return item
|
24
|
+
}).sort((a, b) => a.index - b.index)
|
25
|
+
|
26
|
+
this.showGuide(targets)
|
27
|
+
}
|
28
|
+
|
29
|
+
async showGuide(targets) {
|
30
|
+
for (let i = 0; i < targets.length; i++) {
|
31
|
+
const item = targets[i]
|
32
|
+
if (this.status[item.key]) continue
|
33
|
+
|
34
|
+
await this.showGuideItem(item, i === targets.length - 1)
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
async showGuideItem(item, isLast = false) {
|
39
|
+
if (this.status[item.key]) return
|
40
|
+
|
41
|
+
return new Promise((resolve) => {
|
42
|
+
const tooltipCloseId = `guide-close-${Math.random().toString(36).substring(7)}`
|
43
|
+
const tooltipTitle = `
|
44
|
+
<div class="px-3 py-3">
|
45
|
+
<p class="mb-1">${item.content}</p>
|
46
|
+
<a id="${tooltipCloseId}" class="btn btn-light btn-sm mt-2">${isLast ? 'Close' : 'Next'}</a>
|
47
|
+
</div>
|
48
|
+
`
|
49
|
+
|
50
|
+
const tooltip = new bootstrap.Tooltip(item.element, { title: tooltipTitle, trigger: 'manual', html: true })
|
51
|
+
item.element.addEventListener('shown.bs.tooltip', () => {
|
52
|
+
setTimeout(() => {
|
53
|
+
document.getElementById(tooltipCloseId).addEventListener('click', () => {
|
54
|
+
tooltip.hide()
|
55
|
+
this.status[item.key] = true
|
56
|
+
this.storeStatus()
|
57
|
+
resolve()
|
58
|
+
})
|
59
|
+
}, 250)
|
60
|
+
})
|
61
|
+
tooltip.show()
|
62
|
+
})
|
63
|
+
}
|
64
|
+
|
65
|
+
storeStatus(e = null) {
|
66
|
+
if (e) e.preventDefault()
|
67
|
+
localStorage.setItem('lato_guide', JSON.stringify(this.status))
|
68
|
+
}
|
69
|
+
|
70
|
+
resetStatus(e = null) {
|
71
|
+
if (e) e.preventDefault()
|
72
|
+
this.status = {}
|
73
|
+
this.storeStatus()
|
74
|
+
this.start()
|
75
|
+
}
|
76
|
+
}
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</head>
|
26
26
|
<body
|
27
27
|
class="controller-<%= controller_name %> action-<%= action_name %> <%= @layout_body_classes.join(' ') %>"
|
28
|
-
data-controller="lato-action"
|
28
|
+
data-controller="lato-action lato-guide"
|
29
29
|
>
|
30
30
|
<header>
|
31
31
|
<%= render 'layouts/lato/navbar' %>
|
data/lib/lato/config.rb
CHANGED
@@ -32,7 +32,7 @@ module Lato
|
|
32
32
|
@application_title = 'Lato'
|
33
33
|
@application_version = '1.0.0'
|
34
34
|
@application_company_name = 'Lato Team'
|
35
|
-
@application_company_url = 'https://github.com/
|
35
|
+
@application_company_url = 'https://github.com/lato-org'
|
36
36
|
@application_brand_color = '#03256c'
|
37
37
|
|
38
38
|
@auth_disable_signup = false
|
data/lib/lato/version.rb
CHANGED
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.
|
4
|
+
version: 3.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregorio Galante
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- app/assets/javascripts/lato/controllers/lato_confirm_controller.js
|
160
160
|
- app/assets/javascripts/lato/controllers/lato_feedback_controller.js
|
161
161
|
- app/assets/javascripts/lato/controllers/lato_form_controller.js
|
162
|
+
- app/assets/javascripts/lato/controllers/lato_guide_controller.js
|
162
163
|
- app/assets/javascripts/lato/controllers/lato_hello_controller.js
|
163
164
|
- app/assets/javascripts/lato/controllers/lato_input_autocomplete2_controller.js
|
164
165
|
- app/assets/javascripts/lato/controllers/lato_input_autocomplete_controller.js
|