pg_rails 7.1.9 → 7.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/assets/stylesheets/pg_rails_b5.scss +5 -0
- data/pg_engine/app/controllers/pg_engine/require_sign_in.rb +2 -0
- data/pg_engine/app/lib/pg_engine/filtros_builder.rb +14 -5
- data/pg_engine/app/views/pg_engine/base/index.html.slim +2 -3
- data/pg_engine/config/initializers/ransack_memory.rb +4 -0
- data/pg_engine/lib/pg_engine.rb +1 -0
- data/pg_rails/lib/version.rb +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 671c1939e1e9cae615f0b025c14af1b2c7e25d725782bc28aa7a0416c6b9138b
|
4
|
+
data.tar.gz: 9ef68287946ee5aa453beec59bb1ffbcfd6a5acee7bac7c34b993313535b158c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c0900adc13bfb4955f46da877756864940b6e00e5a3a3f65b9c07d6792b068b5acb5d9baa3fc674bb51ab722f21c826e10c564644d60fae52780214c7c2493
|
7
|
+
data.tar.gz: 90a1bdfb038b4c9d0c5004ff854384669aa537e1efa1895c9f4bf9756a2deef9083552a152a870db0e43bf01c48b247ad8e6b10fe051cc40ee838c3b080437dc
|
@@ -231,7 +231,7 @@ module PgEngine
|
|
231
231
|
map = scope.map { |o| [o.to_s, o.id] }
|
232
232
|
|
233
233
|
content_tag :div, class: 'col-auto' do
|
234
|
-
content_tag :div, class:
|
234
|
+
content_tag :div, class: "filter #{active_class(campo)}" do
|
235
235
|
suf = extraer_sufijo(campo)
|
236
236
|
if suf.in? %w[in]
|
237
237
|
@form.select campo, map, { multiple: true }, placeholder:, 'data-controller': 'selectize',
|
@@ -249,7 +249,7 @@ module PgEngine
|
|
249
249
|
key.value]
|
250
250
|
end
|
251
251
|
content_tag :div, class: 'col-auto' do
|
252
|
-
content_tag :div, class:
|
252
|
+
content_tag :div, class: "filter #{active_class(campo)}" do
|
253
253
|
suf = extraer_sufijo(campo)
|
254
254
|
if suf.in? %w[in]
|
255
255
|
@form.select(campo, map, { multiple: true }, placeholder:, class: 'form-control form-control-sm pg-input-lg', 'data-controller': 'selectize')
|
@@ -262,7 +262,7 @@ module PgEngine
|
|
262
262
|
|
263
263
|
def filtro_texto(campo, placeholder = '')
|
264
264
|
content_tag :div, class: 'col-auto' do
|
265
|
-
content_tag :div, class:
|
265
|
+
content_tag :div, class: "filter #{active_class(campo)}" do
|
266
266
|
@form.search_field(
|
267
267
|
campo, class: 'form-control form-control-sm allow-enter-submit', placeholder:, autocomplete: 'off'
|
268
268
|
)
|
@@ -276,7 +276,7 @@ module PgEngine
|
|
276
276
|
include_blank = "¿#{placeholder.titleize}?"
|
277
277
|
|
278
278
|
content_tag :div, class: 'col-auto' do
|
279
|
-
content_tag :div, class:
|
279
|
+
content_tag :div, class: "filter #{active_class(campo)}" do
|
280
280
|
@form.select campo.to_sym, map, { include_blank: }, class: 'form-select form-select-sm pg-input-lg'
|
281
281
|
end
|
282
282
|
end
|
@@ -284,7 +284,7 @@ module PgEngine
|
|
284
284
|
|
285
285
|
def filtro_fecha(campo, placeholder = '')
|
286
286
|
content_tag :div, class: 'col-auto' do
|
287
|
-
content_tag :div, class:
|
287
|
+
content_tag :div, class: "filter #{active_class(campo)}" do
|
288
288
|
label_tag(nil, placeholder, class: 'text-body-secondary') +
|
289
289
|
@form.date_field(
|
290
290
|
campo, class: 'form-control form-control-sm d-inline-block w-auto ms-1', placeholder:, autocomplete: 'off'
|
@@ -293,6 +293,15 @@ module PgEngine
|
|
293
293
|
end
|
294
294
|
end
|
295
295
|
|
296
|
+
def active_class(campo)
|
297
|
+
if parametros_controller[:q] &&
|
298
|
+
[parametros_controller[:q][campo.to_sym]].flatten.compact_blank.any?
|
299
|
+
'active'
|
300
|
+
else
|
301
|
+
''
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
296
305
|
def parametros_controller
|
297
306
|
params
|
298
307
|
end
|
@@ -30,9 +30,8 @@
|
|
30
30
|
span.d-none.d-sm-inline
|
31
31
|
|  
|
32
32
|
span.text Buscar
|
33
|
-
=
|
34
|
-
|
35
|
-
| Limpiar
|
33
|
+
= clear_filter(title: 'Limpiar', class: 'btn btn-sm btn-secondary col-auto')
|
34
|
+
|
36
35
|
div
|
37
36
|
- if @collection.any?
|
38
37
|
.table-responsive
|
@@ -0,0 +1,4 @@
|
|
1
|
+
RansackMemory::Core.config = {
|
2
|
+
param: :q, # this means the default Ransack param name for searching. You can change it
|
3
|
+
session_key_format: '%controller_name%_%action_name%_%request_format%' # this means how the key used to store the information to the session will be stored. Currently it interpolates request parameters. You can customize it and use these vars to build a key that fits your needs
|
4
|
+
}
|
data/pg_engine/lib/pg_engine.rb
CHANGED
data/pg_rails/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.
|
4
|
+
version: 7.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
@@ -528,6 +528,20 @@ dependencies:
|
|
528
528
|
- - "~>"
|
529
529
|
- !ruby/object:Gem::Version
|
530
530
|
version: 2.3.6
|
531
|
+
- !ruby/object:Gem::Dependency
|
532
|
+
name: ransack_memory
|
533
|
+
requirement: !ruby/object:Gem::Requirement
|
534
|
+
requirements:
|
535
|
+
- - "~>"
|
536
|
+
- !ruby/object:Gem::Version
|
537
|
+
version: '0.1'
|
538
|
+
type: :runtime
|
539
|
+
prerelease: false
|
540
|
+
version_requirements: !ruby/object:Gem::Requirement
|
541
|
+
requirements:
|
542
|
+
- - "~>"
|
543
|
+
- !ruby/object:Gem::Version
|
544
|
+
version: '0.1'
|
531
545
|
- !ruby/object:Gem::Dependency
|
532
546
|
name: view_component
|
533
547
|
requirement: !ruby/object:Gem::Requirement
|
@@ -704,6 +718,7 @@ files:
|
|
704
718
|
- pg_engine/config/initializers/cable_ready.rb
|
705
719
|
- pg_engine/config/initializers/devise.rb
|
706
720
|
- pg_engine/config/initializers/ransack.rb
|
721
|
+
- pg_engine/config/initializers/ransack_memory.rb
|
707
722
|
- pg_engine/config/initializers/rollbar.rb
|
708
723
|
- pg_engine/config/initializers/simple_form_monkey_patch.rb
|
709
724
|
- pg_engine/config/initializers/zeitwerk.rb
|