lato 3.11.13 → 3.12.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: 7baced60fcb66e212666ae63936af3b4ac2e251e6f8aff2cedc08888defe3cde
4
- data.tar.gz: 81bf058b8f8e0c9cd84ca0508e0747bf4fc7d1e9cdb49c2a6d96c36392985743
3
+ metadata.gz: 829951858f3b05e35085c7a93641f831234b14e685967574c949f6f9505fe965
4
+ data.tar.gz: 0ad3dc08123b049e43138f6867e9d2b09413b247119ba2e8e55646276a8a0a72
5
5
  SHA512:
6
- metadata.gz: b0765b08353b74ad25b94c4dc31f905949ab0b02ff5aa47abf85d9f48cc68cda9cbccf4a4970bc4f46d7db9c062469a320e76df5dd182d979e6d9a1c04d01a50
7
- data.tar.gz: 2864f98cdb5082b304aed65a45b9394be794a37229fbf1b511cdb253d9b614c4baae26ec5c1219584563a1d642de015f70bc22a3c6cb8250c92e217a2dfe432d
6
+ metadata.gz: 1f284b80289bc433efd01dcd6cb0928576cdb458ee953045811d3c9953ee297f5a5431eb96644d18190a9b19b62fe5954db864791712311aa9705a7ce08a1ac0
7
+ data.tar.gz: 270452d1c4703d4c0bba1e259a66c0f12a95f4387499f1244107f8154d3a4b62e6fa3b7c2af04c224693e3bc206062e82e551be360b93096ec7fb6ac904fdf03
@@ -16,11 +16,11 @@ module Lato
16
16
  }
17
17
 
18
18
  # manage default sort by parameter
19
- params[:sort_by] = default_sort_by if params[:sort_by].blank? && default_sort_by
19
+ params["#{key}_sort_by"] = default_sort_by if params["#{key}_sort_by"].blank? && default_sort_by
20
20
 
21
21
  # manage sort by parameter
22
- unless params[:sort_by].blank?
23
- sort_by_splitted = params[:sort_by].split('|')
22
+ unless params["#{key}_sort_by"].blank?
23
+ sort_by_splitted = params["#{key}_sort_by"].split('|')
24
24
  sort_by_column = sort_by_splitted.first
25
25
  sort_by_order = sort_by_splitted.last
26
26
 
@@ -32,8 +32,8 @@ module Lato
32
32
  end
33
33
 
34
34
  # manage search by parameter
35
- unless params[:search].blank?
36
- search = params[:search].to_s
35
+ unless params["#{key}_search"].blank?
36
+ search = params["#{key}_search"].to_s
37
37
  if collection.respond_to?(:lato_index_search)
38
38
  collection = collection.lato_index_search(search)
39
39
  else
@@ -49,9 +49,9 @@ module Lato
49
49
  end
50
50
 
51
51
  # manage pagination
52
- if pagination || params[:page] || params[:per_page]
53
- page = params[:page]&.to_i || 1
54
- per_page = params[:per_page]&.to_i || (pagination.is_a?(Integer) ? pagination : 25)
52
+ if pagination || params["#{key}_page"] || params["#{key}_per_page"]
53
+ page = params["#{key}_page"]&.to_i || 1
54
+ per_page = params["#{key}_per_page"]&.to_i || (pagination.is_a?(Integer) ? pagination : 25)
55
55
  per_page = 100 if per_page > 100
56
56
  collection = collection.page(page).per(per_page)
57
57
  end
@@ -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="<%= "#{key}_search" %>" class="form-control" placeholder="<%= I18n.t('lato.search_for') %>: <%= searchable_columns.map { |c| collection.model.human_attribute_name(c) }.to_sentence %>" value="<%= params["#{key}_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"
@@ -114,13 +114,13 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
114
114
  }) %></span>
115
115
  <% if sortable_columns.include?(column) %>
116
116
  <div class="btn-group ms-3 lato-index-col-sort">
117
- <div class="position-relative btn btn-sm <%= params[:sort_by] == "#{column}|ASC" ? 'btn-primary' : 'btn-outline-primary' %>">
118
- <input type="submit" name="sort_by" value="<%= column %>|ASC" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0">
117
+ <div class="position-relative btn btn-sm <%= params["#{key}_sort_by"] == "#{column}|ASC" ? 'btn-primary' : 'btn-outline-primary' %>">
118
+ <input type="submit" name="<%= "#{key}_sort_by" %>" value="<%= column %>|ASC" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0">
119
119
  <i class="bi bi-sort-up"></i>
120
120
  </div>
121
121
 
122
- <div class="position-relative btn btn-sm <%= params[:sort_by] == "#{column}|DESC" ? 'btn-primary' : 'btn-outline-primary' %>">
123
- <input type="submit" name="sort_by" value="<%= column %>|DESC" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0">
122
+ <div class="position-relative btn btn-sm <%= params["#{key}_sort_by"] == "#{column}|DESC" ? 'btn-primary' : 'btn-outline-primary' %>">
123
+ <input type="submit" name="<%= "#{key}_sort_by" %>" value="<%= column %>|DESC" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0">
124
124
  <i class="bi bi-sort-down"></i>
125
125
  </div>
126
126
  </div>
@@ -152,16 +152,16 @@ collection_total = collection.respond_to?(:total_count) ? collection.total_count
152
152
  <td colspan="<%= columns.length %>">
153
153
  <div class="d-flex justify-content-between align-items-center">
154
154
  <% if collection.respond_to?(:total_pages) %>
155
- <div><%= paginate collection %></div>
155
+ <div><%= paginate collection, param_name: "#{key}_page" %></div>
156
156
  <% else %>
157
157
  <div></div>
158
158
  <% end %>
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="<%= "#{key}_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
- <option value="<%= option %>" <%= option == params[:per_page].to_i ? 'selected' : '' %>>
164
+ <option value="<%= option %>" <%= option == params["#{key}_per_page"].to_i ? 'selected' : '' %>>
165
165
  <%= option %> <%= I18n.t('lato.per_page').downcase %>
166
166
  </option>
167
167
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no,interactive-widget=resizes-content">
6
6
  <title><%= @layout_page_title %></title>
7
7
  <%= csrf_meta_tags %>
8
8
  <%= csp_meta_tag %>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.11.13"
2
+ VERSION = "3.12.0"
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.13
4
+ version: 3.12.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: 2025-04-21 00:00:00.000000000 Z
11
+ date: 2025-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails