pg_rails 7.1.1.pre.3 → 7.1.1.pre.4
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 +1 -2
- data/pg_engine/app/controllers/concerns/pg_engine/resource.rb +2 -2
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +7 -0
- data/pg_engine/app/decorators/pg_engine/base_record_decorator.rb +4 -0
- data/pg_engine/app/views/pg_engine/base/index.html.slim +5 -4
- data/pg_layout/app/javascript/utils/cookies.js +3 -0
- data/pg_layout/app/javascript/utils/utils.ts +22 -0
- data/pg_rails/lib/version.rb +1 -1
- data/pg_scaffold/lib/generators/pg_slim/templates/index.html.slim +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34465452a5982269db6136a0000c16c78bb9576b57f7d4f3476940a76d28cae7
|
4
|
+
data.tar.gz: 77ecad87cb6e8ae5f99b5d73a40bbf60efb8f94a56782d253294904382b8ac3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b790cb222b1a4ed7acae49253e7a55700584e612750ad763449d68089dc294f66822a8eb9db4dc89303dcf3a3d20e2360944a222191fa53413ba3182806e8a8
|
7
|
+
data.tar.gz: cea1c5777acd0791fc8d32c3e28815881334e753f43e3608542e1d1181b03bfa980c154cfd2662d3c9927b30dab3a4acf0d3d2efeb3d2af0bb5b5a875d1d2bb3
|
@@ -64,8 +64,7 @@ input[type=datetime-local], input[type=datetime] {
|
|
64
64
|
padding: 0.25rem 1rem;
|
65
65
|
}
|
66
66
|
}
|
67
|
-
.listado
|
68
|
-
// FIXME: rompe porque es una tabla y tiene que tener su propio display
|
67
|
+
.listado .actions-wrapper {
|
69
68
|
display: flex;
|
70
69
|
justify-content: flex-end;
|
71
70
|
gap: 4px;
|
@@ -24,7 +24,7 @@ module PgEngine
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def show
|
27
|
-
add_breadcrumb instancia_modelo, instancia_modelo.target_object
|
27
|
+
add_breadcrumb instancia_modelo.to_s_short, instancia_modelo.target_object
|
28
28
|
|
29
29
|
pg_respond_show
|
30
30
|
end
|
@@ -34,7 +34,7 @@ module PgEngine
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def edit
|
37
|
-
add_breadcrumb instancia_modelo, instancia_modelo.target_object
|
37
|
+
add_breadcrumb instancia_modelo.to_s_short, instancia_modelo.target_object
|
38
38
|
add_breadcrumb 'Editando'
|
39
39
|
end
|
40
40
|
|
@@ -112,6 +112,7 @@ module PgEngine
|
|
112
112
|
|
113
113
|
protected
|
114
114
|
|
115
|
+
# rubocop:disable Metrics/AbcSize
|
115
116
|
def render_my_component(component, status)
|
116
117
|
respond_to do |format|
|
117
118
|
format.html do
|
@@ -128,11 +129,17 @@ module PgEngine
|
|
128
129
|
status:
|
129
130
|
end
|
130
131
|
|
132
|
+
format.json do
|
133
|
+
html = component.render_in(view_context)
|
134
|
+
render json: { html: }, status:
|
135
|
+
end
|
136
|
+
|
131
137
|
format.any do
|
132
138
|
head status
|
133
139
|
end
|
134
140
|
end
|
135
141
|
end
|
142
|
+
# rubocop:enable Metrics/AbcSize
|
136
143
|
|
137
144
|
def not_authorized(_arg_required_for_active_admin)
|
138
145
|
respond_to do |format|
|
@@ -22,6 +22,10 @@ module PgEngine
|
|
22
22
|
object.as_json(options).tap { |o| o[:to_s] = to_s }
|
23
23
|
end
|
24
24
|
|
25
|
+
def to_s_short
|
26
|
+
truncate(object.to_s)
|
27
|
+
end
|
28
|
+
|
25
29
|
# rubocop:disable Style/MissingRespondToMissing
|
26
30
|
def method_missing(method_name, *args, &)
|
27
31
|
valor = object.attributes[method_name.to_s]
|
@@ -53,10 +53,11 @@ div
|
|
53
53
|
- atributos_para_listar.each do |att|
|
54
54
|
td.text-nowrap = object.send(att)
|
55
55
|
td.text-nowrap.text-end.ps-5
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
.actions-wrapper
|
57
|
+
= object.extra_actions(size: :sm) if object.respond_to? :extra_actions
|
58
|
+
= object.show_link
|
59
|
+
= object.edit_link(text: '', klass: 'btn-light')
|
60
|
+
= object.destroy_link
|
60
61
|
|
61
62
|
.ps-3.justify-content-center
|
62
63
|
= paginate(@collection)
|
@@ -1,5 +1,7 @@
|
|
1
|
+
// TODO: borrar deprecated file
|
1
2
|
export default class {
|
2
3
|
setCookie (cname, cvalue, exdays) {
|
4
|
+
console.log('DEPRECATED setCookie')
|
3
5
|
const d = new Date()
|
4
6
|
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000))
|
5
7
|
const expires = 'expires=' + d.toUTCString()
|
@@ -7,6 +9,7 @@ export default class {
|
|
7
9
|
}
|
8
10
|
|
9
11
|
getCookie (cname) {
|
12
|
+
console.log('DEPRECATED getCookie')
|
10
13
|
const name = cname + '='
|
11
14
|
const ca = document.cookie.split(';')
|
12
15
|
for (let i = 0; i < ca.length; i++) {
|
@@ -1,3 +1,25 @@
|
|
1
|
+
export function setCookie (cname, cvalue, exdays) {
|
2
|
+
const d = new Date()
|
3
|
+
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000))
|
4
|
+
const expires = 'expires=' + d.toUTCString()
|
5
|
+
document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/'
|
6
|
+
}
|
7
|
+
|
8
|
+
export function getCookie (cname) {
|
9
|
+
const name = cname + '='
|
10
|
+
const ca = document.cookie.split(';')
|
11
|
+
for (let i = 0; i < ca.length; i++) {
|
12
|
+
let c = ca[i]
|
13
|
+
while (c.charAt(0) === ' ') {
|
14
|
+
c = c.substring(1)
|
15
|
+
}
|
16
|
+
if (c.indexOf(name) === 0) {
|
17
|
+
return c.substring(name.length, c.length)
|
18
|
+
}
|
19
|
+
}
|
20
|
+
return ''
|
21
|
+
}
|
22
|
+
|
1
23
|
export function round (value) {
|
2
24
|
return Math.round(value * 100) / 100
|
3
25
|
}
|
data/pg_rails/lib/version.rb
CHANGED
@@ -41,9 +41,10 @@ div
|
|
41
41
|
- atributos_para_listar.each do |att|
|
42
42
|
th = object.send(att)
|
43
43
|
td.text-nowrap.text-end.ps-5
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
.actions-wrapper
|
45
|
+
= object.show_link
|
46
|
+
= object.edit_link(text: '', klass: 'btn-light')
|
47
|
+
= object.destroy_link
|
47
48
|
|
48
49
|
.ps-3.justify-content-center
|
49
50
|
= paginate(@collection)
|
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.1.1.pre.
|
4
|
+
version: 7.1.1.pre.4
|
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-07-
|
11
|
+
date: 2024-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|