lato 3.13.18 → 3.13.20

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: 9304badc09690e06e70b683dc178ffe057eb25a92a47bf9cea18954e0b796872
4
- data.tar.gz: e7ebd7677622026e4d3be1d5975f4060566ee88c464640b83e3c3eff7f627de8
3
+ metadata.gz: 43c75d3ab5790c836f1d6ad007aa55f276fd90ecba1d41083c42b850f6dec8e8
4
+ data.tar.gz: 34ad125ac70596240da15dd2f96fd2c9fc7bd00ddfbbfd64a9c26dcc9c3565e8
5
5
  SHA512:
6
- metadata.gz: 2383c56456d340cf749cea8b89441a9fef6f214296a23950872ce7d34830a068f077bd1283175f3e8da4fc25039128648322a1b0bd42b14849b7a37df2310ddc
7
- data.tar.gz: 62c77057415ddb510fb636a465bbfeef465688981a56eee17734ed4495ff57cfcf885bc1e918b2534e0afe085368dd1bd2da0b69cba03b2c6ede831da3b0d958
6
+ metadata.gz: fb6af077ec0c77e570ac3052cc42400cad24f1158304546b27a3320a82b1c6c05fd5354d66e1a8ee54fc62e44142000eb2b032212aaa4a95037e8aa9ef73b7d8
7
+ data.tar.gz: 89c41527c711d833ff01ca92a5b50992aab144ad83e3542a3eacd4553baddf717ba8f8d5beb70ff67a035aa3e082da9a520160df9bb8dbb5a90d0d2634a74616
@@ -3,6 +3,8 @@
3
3
  collection_test_istance = collection.model.new
4
4
  collection_total = skip_total_count ? nil : (collection.respond_to?(:total_count) ? collection.total_count : collection.count)
5
5
 
6
+ total_pages = nil
7
+ total_pages = collection.empty? ? params["#{key}_page"]&.to_i : 999_999_999 if skip_total_count
6
8
  %>
7
9
 
8
10
  <%= turbo_frame_tag "lato_index_#{key}_#{model_name_underscore}", class: "lato-index #{browser.device.mobile? ? 'lato-index-mob' : 'lato-index-desk'}" do %>
@@ -96,7 +98,7 @@ collection_total = skip_total_count ? nil : (collection.respond_to?(:total_count
96
98
  <span class="text-muted"><%= collection_total %> <%= I18n.t('lato.total_results').downcase %></span>
97
99
  <% end %>
98
100
  <% if collection.respond_to?(:total_pages) %>
99
- <div class="mt-3"><%= paginate collection, param_name: "#{key}_page" %></div>
101
+ <div class="mt-3"><%= paginate(collection, param_name: "#{key}_page", total_pages: total_pages, window: 1) %></div>
100
102
  <% end %>
101
103
  </div>
102
104
 
@@ -154,7 +156,7 @@ collection_total = skip_total_count ? nil : (collection.respond_to?(:total_count
154
156
  <td colspan="<%= columns.length %>">
155
157
  <div class="d-flex justify-content-between align-items-center">
156
158
  <% if collection.respond_to?(:total_pages) %>
157
- <div><%= paginate collection, param_name: "#{key}_page" %></div>
159
+ <div><%= paginate(collection, param_name: "#{key}_page", total_pages: total_pages) %></div>
158
160
  <% else %>
159
161
  <div></div>
160
162
  <% end %>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.13.18"
2
+ VERSION = "3.13.20"
3
3
  end
data/lib/lato.rb CHANGED
@@ -9,7 +9,6 @@ require "lato/engine"
9
9
  require "lato/config"
10
10
  require "lato/btstrap"
11
11
  require "lato/dependency_helper"
12
- require "lato/kaminari_extensions"
13
12
 
14
13
  module Lato
15
14
  class << self
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.13.18
4
+ version: 3.13.20
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-07-24 00:00:00.000000000 Z
11
+ date: 2025-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -273,7 +273,6 @@ files:
273
273
  - lib/lato/config.rb
274
274
  - lib/lato/dependency_helper.rb
275
275
  - lib/lato/engine.rb
276
- - lib/lato/kaminari_extensions.rb
277
276
  - lib/lato/version.rb
278
277
  - lib/tasks/lato_tasks.rake
279
278
  homepage: https://github.com/Lato-org/lato
@@ -1,13 +0,0 @@
1
- # NOTE: Hard fix taken from https://gist.github.com/sononum/6183139 from kaminari issue https://github.com/search?q=repo%3Akaminari%2Fkaminari%20def%20total_count&type=code
2
-
3
- module Kaminari
4
- module PageScopeMethods
5
- def total_count
6
- if ActiveRecord::Base.connection.adapter_name.downcase == "postgresql"
7
- @_hacked_total_count || (@_hacked_total_count = self.connection.execute("SELECT (reltuples)::integer FROM pg_class r WHERE relkind = 'r' AND relname ='#{table_name}'").first["reltuples"].to_i)
8
- else
9
- super
10
- end
11
- end
12
- end
13
- end