pg_rails 7.4.0 → 7.4.2
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/controllers/concerns/pg_engine/resource.rb +5 -0
- data/pg_engine/app/helpers/pg_engine/index_helper.rb +6 -0
- data/pg_engine/app/views/pg_engine/base/index.html.slim +1 -1
- data/pg_engine/lib/pg_engine.rb +2 -2
- data/pg_engine/spec/components/previews/alert_component_preview/tables.html.slim +16 -0
- data/pg_engine/spec/components/previews/alert_component_preview.rb +2 -0
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +1 -1
- data/pg_rails/lib/version.rb +1 -1
- data/pg_rails/scss/pg_rails.scss +14 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55cfb59ec05d90c2944001cb69e2625c8d4f8e8a1eb460427dca95daf25b4ba4
|
4
|
+
data.tar.gz: eb5c2a073a6a1d69a0307e2ae16e9550dc852e2a45bd28aebb2ccc0ef6b0d5d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890f2a67f70994285f1c5cefd90f8cd36c3604bcb368345e9e5331afa805fa99bb5f15e5bfd81e9e78e0948621f6356df0c855c22fb70d0c10722f974e0438f4
|
7
|
+
data.tar.gz: db292c14db052409f0b27c9d11fafce68471f387c633799a7caf2c9f3b49e59829ad14ee3d41976a133d3f5912c56a087fa54068974cd2b42194b97a1d8f4cee
|
@@ -21,6 +21,7 @@ module PgEngine
|
|
21
21
|
clazz.helper_method :current_page_size
|
22
22
|
clazz.helper_method :show_filters?
|
23
23
|
clazz.helper_method :available_page_sizes
|
24
|
+
clazz.helper_method :column_options_for
|
24
25
|
|
25
26
|
clazz.before_action do
|
26
27
|
# TODO: quitar esto, que se use el attr_accessor
|
@@ -65,6 +66,10 @@ module PgEngine
|
|
65
66
|
end
|
66
67
|
# rubocop:enable Metrics/PerceivedComplexity
|
67
68
|
|
69
|
+
def column_options_for(_object, _attribute)
|
70
|
+
{ class: 'text-nowrap' }
|
71
|
+
end
|
72
|
+
|
68
73
|
def referred_by?(object)
|
69
74
|
url_for(object.decorate.target_object) == request.referer
|
70
75
|
end
|
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
module PgEngine
|
4
4
|
module IndexHelper
|
5
|
+
def column_for(object, attribute)
|
6
|
+
content_tag :td, **column_options_for(object, attribute) do
|
7
|
+
object.send(attribute).to_s
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
def encabezado(input, options = {})
|
6
12
|
if input.is_a? Array
|
7
13
|
campo = input.first
|
@@ -31,7 +31,7 @@ div
|
|
31
31
|
- object = object.decorate
|
32
32
|
tr id="#{dom_id(object)}"
|
33
33
|
- atributos_para_listar.each do |att, _sort_field|
|
34
|
-
|
34
|
+
= column_for object, att
|
35
35
|
td.text-nowrap.text-end.ps-5
|
36
36
|
.actions-wrapper
|
37
37
|
= object.extra_actions(size: :sm) if object.respond_to? :extra_actions
|
data/pg_engine/lib/pg_engine.rb
CHANGED
@@ -94,10 +94,10 @@ module PgEngine
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def self.redis_url
|
97
|
+
def self.redis_url(host: '127.0.0.1', port: '6379')
|
98
98
|
env_value = ENV.fetch('TEST_ENV_NUMBER', nil)
|
99
99
|
db = (env_value.nil? ? 1 : (env_value.presence || 1)).to_i - 1
|
100
|
-
"redis
|
100
|
+
"redis://#{host}:#{port}/#{db}"
|
101
101
|
end
|
102
102
|
|
103
103
|
GOOGLE_FONTS_URL =
|
@@ -0,0 +1,16 @@
|
|
1
|
+
h1 Tables
|
2
|
+
|
3
|
+
table.table
|
4
|
+
tr
|
5
|
+
td = Faker::Lorem.sentence(word_count: 80)
|
6
|
+
td = Faker::Lorem.sentence(word_count: 40)
|
7
|
+
|
8
|
+
table.table
|
9
|
+
tr
|
10
|
+
td.column-truncate-30 = Faker::Lorem.sentence(word_count: 80)
|
11
|
+
td.column-truncate-70 = Faker::Lorem.sentence(word_count: 40)
|
12
|
+
|
13
|
+
table.table
|
14
|
+
tr
|
15
|
+
td.column-truncate-80 = Faker::Lorem.sentence(word_count: 80)
|
16
|
+
td = Faker::Lorem.sentence(word_count: 4)
|
@@ -28,7 +28,7 @@ html
|
|
28
28
|
meta name="cable-history-timestamp" content="#{Time.now.to_i}"
|
29
29
|
= csrf_meta_tags
|
30
30
|
= csp_meta_tag
|
31
|
-
- if defined?
|
31
|
+
- if defined?(AnyCable::Rails)
|
32
32
|
= action_cable_with_jwt_meta_tag
|
33
33
|
|
34
34
|
= stylesheet_link_tag 'application', 'data-turbo-track': 'reload'
|
data/pg_rails/lib/version.rb
CHANGED
data/pg_rails/scss/pg_rails.scss
CHANGED
@@ -63,6 +63,20 @@ $breadcrumb-margin-bottom: 0;
|
|
63
63
|
padding-right: 0.75rem !important;
|
64
64
|
}
|
65
65
|
|
66
|
+
$values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100;
|
67
|
+
|
68
|
+
@for $i from 1 through length($values) {
|
69
|
+
$value: nth($values, $i);
|
70
|
+
$perc: #{percenage($value)};
|
71
|
+
|
72
|
+
.column-truncate-#{$value} {
|
73
|
+
max-width: 0;
|
74
|
+
width: percentage($value * 0.01);
|
75
|
+
overflow: hidden;
|
76
|
+
text-overflow: ellipsis;
|
77
|
+
white-space: nowrap;
|
78
|
+
}
|
79
|
+
}
|
66
80
|
|
67
81
|
$warning-border-emphasis: shade-color($yellow, 60%);
|
68
82
|
.btn-toolbar .btn-warning {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.4.
|
4
|
+
version: 7.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -809,6 +809,7 @@ files:
|
|
809
809
|
- pg_engine/spec/components/previews/alert_component_preview/default.html.slim
|
810
810
|
- pg_engine/spec/components/previews/alert_component_preview/dismisible.html.slim
|
811
811
|
- pg_engine/spec/components/previews/alert_component_preview/list_group.html.slim
|
812
|
+
- pg_engine/spec/components/previews/alert_component_preview/tables.html.slim
|
812
813
|
- pg_engine/spec/components/previews/alert_component_preview/tooltips.html.slim
|
813
814
|
- pg_engine/spec/components/previews/internal_error_preview.rb
|
814
815
|
- pg_engine/spec/components/previews/internal_error_preview/default.html.slim
|