smart_table 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/helpers/smart_table/smart_table_helper.rb +7 -6
- data/lib/smart_table/version.rb +1 -1
- data/smart_table-0.0.7.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 224c0be14daa5e13ef122e4aeea2066df005abd593bd452960ae8f36d6ed3f11
|
4
|
+
data.tar.gz: e3cb3b5ff817ddf96700c39cdc036f06b1f89ed94bcbf8e50903e5d2887f0b55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1d77e21f232f87f2e26f7f95e42c7b2aaa44c047bb5062f09ea2ea3625b21b8fbf6223f30fcce367c85cc0749c9a1949ef865e551a1e62a45ab361d0b71d99b
|
7
|
+
data.tar.gz: 928f648e82098247902534638b3c812a75c990d38e82cae55df9223d4a0e8e048690e71209c48fb038437bc549a74dba8ad48bc03d33b7e7f8ec1ba3da977609
|
data/Gemfile.lock
CHANGED
@@ -25,7 +25,7 @@ module SmartTable
|
|
25
25
|
paginatable_array = Kaminari.
|
26
26
|
paginate_array(records.to_a, total_count: total_records_count).
|
27
27
|
page(get_cached_smart_table_params.page_number).
|
28
|
-
per(get_cached_smart_table_params.page_size)
|
28
|
+
per(get_cached_smart_table_params.page_size || 99999999) # kaminari needs a page size. If you pass nil it will use the default. So we use a very big number to represent no limit
|
29
29
|
|
30
30
|
html_elements = []
|
31
31
|
|
@@ -112,20 +112,21 @@ module SmartTable
|
|
112
112
|
page_sizes.uniq!
|
113
113
|
page_sizes.sort!
|
114
114
|
|
115
|
-
if page_sizes.last >= total_records_count
|
115
|
+
if page_sizes.last >= total_records_count
|
116
116
|
page_sizes.reject! {|size| size > total_records_count}
|
117
|
-
page_sizes << SHOW_ALL
|
118
117
|
end
|
118
|
+
|
119
|
+
page_sizes << SHOW_ALL
|
119
120
|
|
120
121
|
content_tag(:div, class: 'text-center') do
|
121
122
|
(
|
122
123
|
record_model_name.pluralize + ' ' +
|
123
124
|
I18n.t('smart_table.per_page') + ': ' +
|
124
125
|
page_sizes.map do |page_size|
|
125
|
-
|
126
|
-
|
126
|
+
human_page_size = (page_size == SHOW_ALL ? I18n.t('smart_table.show_all') : page_size.to_s)
|
127
|
+
if page_size == get_cached_smart_table_params.page_size || page_size == SHOW_ALL && get_cached_smart_table_params.page_size.nil?
|
128
|
+
human_page_size
|
127
129
|
else
|
128
|
-
human_page_size = (page_size == SHOW_ALL ? I18n.t('smart_table.show_all') : page_size.to_s)
|
129
130
|
link_to human_page_size, current_request_url_with_merged_query_params(PAGE_SIZE_PARAM => page_size, PAGE_PARAM => 1)
|
130
131
|
end
|
131
132
|
end.join(' ')
|
data/lib/smart_table/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Gubert
|
@@ -186,6 +186,7 @@ files:
|
|
186
186
|
- "./lib/smart_table/config.rb"
|
187
187
|
- "./lib/smart_table/engine.rb"
|
188
188
|
- "./lib/smart_table/version.rb"
|
189
|
+
- "./smart_table-0.0.7.gem"
|
189
190
|
- "./smart_table.gemspec"
|
190
191
|
- "./spec/dummy_app/Rakefile"
|
191
192
|
- "./spec/dummy_app/app/assets/config/manifest.js"
|