lato 3.11.8 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f05b67d482485eda6335b24f463fa5fd8de9b339ad75e2f01919179d18d64300
4
- data.tar.gz: 6141f29a7f830da8a61060b5d13f10b1f4dc2304bf7e191e1004c7425c4a746b
3
+ metadata.gz: ddd7c01a9cc4fe2d157455aef4dbd490520bfc6202e3fe6b9886bb9c50424ab6
4
+ data.tar.gz: 65074da85897c91205dc2f4163d7a9f1d8f8a28625f96a6114b28dd596e04b62
5
5
  SHA512:
6
- metadata.gz: 9291584af35ac2a3a9af5e1b1decf622ca5b9f677901c37e6dd30c70c3008e0e1bc6cd2f0ced9028c9c901d6c2097b39ad94bd86b8165515515be244eb4b239c
7
- data.tar.gz: d094a873bdb96294c3d002c8963850a0cc7b3c3c6d905e89728c12e41dc7e4ae687858c7f031c5ac73f7224fe458c52e3d6a8e3c7acf743d05bf32093c325a84
6
+ metadata.gz: 5e58f5ab69f0a9bd43ccecf90451ff7784925bf29261348a221ab6ebb0e33b06fc2887fb7799390ecad4b3b80c7e6095facd4c5b6503b7c0c1e366de7d806eb4
7
+ data.tar.gz: 3bcd8581b91971c86df3fcd7166ddef1978a899759533017ec915107ac019b79f03ee04f45d12841dabf80f4ef1864a274fd645239e2d75a845b1c2ad7c2d294
data/README.md CHANGED
@@ -2,21 +2,27 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/lato.svg)](https://badge.fury.io/rb/lato)
4
4
 
5
- Lato is a Rails Engine to deliver a full featured web panel for your Rails application.
5
+ Lato is a Rails Engine to deliver a full featured web panel for your [Rails](https://rubyonrails.org/) application.
6
6
 
7
7
  This gem includes:
8
8
  - User management with full authentication (signin, signup, recover password, email validation, Google Authenticator multi-factor authentication, ETH wallet connection);
9
- - Web panel UI (Navbar, Sidebar, Body) with Bootstrap;
9
+ - Web panel UI (Navbar, Sidebar, Body) with [Bootstrap](https://getbootstrap.com/) and [Bootstrap Icons](https://icons.getbootstrap.com/) integrated;
10
10
  - Some UI components ready to use integrated with Rails (data tables, forms, modals, async job executions);
11
11
 
12
12
  The gem is designed to be easily **customizable and extendable**. You can fully customize the UI and the functionalities of the panel. You can also add new functionalities and components to the panel on the main application or develop new engines to extend the panel.
13
13
 
14
- The gem is ready to be used with the **latest Rails 7+** features like **ESM import maps**, **Turbo** and **Stimulus**.
14
+ The gem is ready to be used with the **latest Rails 7+** features like **[ESM import maps](https://github.com/rails/importmap-rails)**, **[Turbo](https://turbo.hotwired.dev/)** and **[Stimulus](https://stimulus.hotwired.dev)**.
15
15
 
16
16
  The front-end is designed to be responsive, mobile friendly and accessible.
17
17
 
18
18
  <img src="./preview.gif" alt="Lato preview" width="100%">
19
19
 
20
+ ## Full documentation (🇮🇹 Italian only)
21
+
22
+ The full documentation is available at: 👉 👉 [THIS LINK](http://lato.gregoriogalante.com/) 👈 👈
23
+
24
+ You can also use the [Lato AI Agent](http://lato.gregoriogalante.com/AI.html) directly on your browser to generate code and get helps with the gem.
25
+
20
26
  ## Eco-system
21
27
  The idea behind Lato is to create an eco-system of engines that can improve the functionalities of the panel. The following engines are already available:
22
28
 
@@ -28,13 +34,13 @@ Add required dependencies to your application's Gemfile:
28
34
 
29
35
  ```ruby
30
36
  # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
31
- gem "importmap-rails" # NOTE: Probably already installed in default rails 7 project
37
+ gem "importmap-rails" # NOTE: Probably already installed in default rails 7+ project
32
38
 
33
39
  # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
34
- gem "turbo-rails" # NOTE: Probably already installed in default rails 7 project
40
+ gem "turbo-rails" # NOTE: Probably already installed in default rails 7+ project
35
41
 
36
42
  # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
37
- gem "stimulus-rails" # NOTE: Probably already installed in default rails 7 project
43
+ gem "stimulus-rails" # NOTE: Probably already installed in default rails 7+ project
38
44
 
39
45
  # Use Sass to process CSS
40
46
  gem "sassc-rails"
@@ -116,11 +122,23 @@ $ rails db:seed
116
122
  $ foreman start -f Procfile.dev
117
123
  ```
118
124
 
119
- ## Publish
125
+ ### Publish
126
+
127
+ This script will publish the gem to rubygems.org. Make sure you have the correct permissions and that you are logged in to your rubygems account.
120
128
 
121
129
  ```shell
122
130
  $ ruby ./bin/publish.rb
123
131
  ```
124
132
 
133
+ ### Generate documentation
134
+
135
+ This script will generate the documentation for the gem by exporting the Rails rendered views to HTML files. The documentation will be generated in the **docs** folder.
136
+
137
+ Make sure to have the server running on port 3000 before running the script.
138
+
139
+ ```shell
140
+ $ ruby ./bin/generate_docs.rb
141
+ ```
142
+
125
143
  ## License
126
144
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -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
+ }
@@ -27,6 +27,7 @@ export default class extends Controller {
27
27
  * Events
28
28
  */
29
29
 
30
+ // This event is used to remove the Bootstrap invalid class from the input when the user starts typing.
30
31
  onInputChange(e) {
31
32
  e.target.classList.remove('is-invalid')
32
33
  }
@@ -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>
@@ -7,7 +7,7 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
7
7
 
8
8
  <%= turbo_frame_tag "lato_index_#{key}_#{model_name_underscore}", class: "lato-index #{browser.device.mobile? ? 'lato-index-mob' : 'lato-index-desk'}" do %>
9
9
 
10
- <%= form_tag request.path, method: :get, data: { controller: 'lato_form lato_index', turbo_frame: '_self' } do %>
10
+ <%= form_tag request.path, method: :get, data: { controller: 'lato-form lato-index', turbo_frame: '_self' } do %>
11
11
  <%= hidden_field_tag :key, key %>
12
12
  <% params.each do |k, v| %>
13
13
  <%= hidden_field_tag k, v %>
@@ -17,7 +17,7 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
17
17
  <div class="d-flex mb-3">
18
18
  <% if searchable_columns.any? %>
19
19
  <div class="input-group">
20
- <input type="text" name="search" class="form-control" placeholder="<%= I18n.t('lato.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>" data-action="keyup->lato_index#onSearchKeyUp" aria-label="<%= I18n.t('lato.search') %>">
20
+ <input type="text" name="search" class="form-control" placeholder="<%= I18n.t('lato.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params[:search] %>" data-action="keyup->lato-index#onSearchKeyUp" aria-label="<%= I18n.t('lato.search') %>">
21
21
  <button
22
22
  class="btn btn-outline-primary"
23
23
  type="submit"
@@ -159,7 +159,7 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
159
159
  <div class="d-flex justify-content-end align-items-center">
160
160
  <span class="text-muted"><%= collection_total %> <%= I18n.t('lato.total_results').downcase %></span>
161
161
  <% if pagination_options %>
162
- <select name="per_page" class="ms-3 form-select form-select-sm w-auto" data-action="change->lato_form#submit" aria-label="<%= I18n.t('lato.per_page_description') %>">
162
+ <select name="per_page" class="ms-3 form-select form-select-sm w-auto" data-action="change->lato-form#submit" aria-label="<%= I18n.t('lato.per_page_description') %>">
163
163
  <% pagination_options.each do |option| %>
164
164
  <option value="<%= option %>" <%= option == params[:per_page].to_i ? 'selected' : '' %>>
165
165
  <%= option %> <%= I18n.t('lato.per_page').downcase %>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.11.8"
2
+ VERSION = "3.11.10"
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.11.8
4
+ version: 3.11.10
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-04-15 00:00:00.000000000 Z
11
+ date: 2025-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -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