pg_rails 7.3.1 → 7.3.3
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/pg_engine/devise_controller.rb +3 -0
- data/pg_engine/app/decorators/pg_engine/base_record_decorator.rb +12 -6
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +8 -3
- data/pg_rails/lib/version.rb +1 -1
- data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fed6890bca7d59c4f1050a017f8268a137520f41464181a4b2ea56b2e44c5ae
|
4
|
+
data.tar.gz: f87ebe6627025fb2759466ba0539ce7b5b7ecf683fb2e56c49a29a69cb18d4ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7674b3fe89df77f6435356ef54cc181e20163b036c4ede84812aa056605071fd2bc0d2293fa03ec5a2fbda29b9b5bb42da9cd00109843579eb7f158a7cc4bc19
|
7
|
+
data.tar.gz: b8070967ee5b9f6ac03861a78c85313dd65ad42f5675851efc0b9742d1449820925c5cb1416e8f69257a4db2a04ec2df5977a30bb8d0ab9c8dd1aedbe8f7ada0
|
@@ -64,11 +64,13 @@ module PgEngine
|
|
64
64
|
def edit_link(text: ' Modificar', klass: 'btn-warning')
|
65
65
|
return unless Pundit.policy!(Current.user, object).edit?
|
66
66
|
|
67
|
+
modal = object.class.default_modal
|
68
|
+
|
67
69
|
helpers.content_tag :span, rel: :tooltip, title: 'Modificar' do
|
68
70
|
helpers.link_to edit_object_url,
|
69
71
|
class: "btn btn-sm #{klass}",
|
70
|
-
'data-turbo-frame': 'modal_content',
|
71
|
-
'data-turbo-stream':
|
72
|
+
'data-turbo-frame': modal ? 'modal_content' : '_top',
|
73
|
+
'data-turbo-stream': modal do
|
72
74
|
helpers.content_tag(:span, nil, class: clase_icono('pencil')) + text
|
73
75
|
end
|
74
76
|
end
|
@@ -77,11 +79,13 @@ module PgEngine
|
|
77
79
|
def show_link(text: '', klass: 'btn-light')
|
78
80
|
return unless Pundit.policy!(Current.user, object).show?
|
79
81
|
|
82
|
+
modal = object.class.default_modal
|
83
|
+
|
80
84
|
helpers.content_tag :span, rel: :tooltip, title: 'Ver' do
|
81
85
|
helpers.link_to object_url,
|
82
86
|
class: "btn btn-sm #{klass}",
|
83
|
-
'data-turbo-frame': 'modal_content',
|
84
|
-
'data-turbo-stream':
|
87
|
+
'data-turbo-frame': modal ? 'modal_content' : '_top',
|
88
|
+
'data-turbo-stream': modal do
|
85
89
|
helpers.content_tag(:span, nil, class: clase_icono('eye-fill')) + text
|
86
90
|
end
|
87
91
|
end
|
@@ -101,11 +105,13 @@ module PgEngine
|
|
101
105
|
def new_link(klass: 'btn-warning')
|
102
106
|
return unless Pundit.policy!(Current.user, object).new?
|
103
107
|
|
108
|
+
modal = object.class.default_modal
|
109
|
+
|
104
110
|
helpers.content_tag :span, rel: :tooltip, title: submit_default_value do
|
105
111
|
helpers.link_to(new_object_url,
|
106
112
|
class: "btn btn-sm #{klass}",
|
107
|
-
'data-turbo-frame': 'modal_content',
|
108
|
-
'data-turbo-stream':
|
113
|
+
'data-turbo-frame': modal ? 'modal_content' : '_top',
|
114
|
+
'data-turbo-stream': modal) do
|
109
115
|
helpers.content_tag(:span, nil,
|
110
116
|
class: clase_icono('plus').to_s) + "<span class='d-none d-sm-inline'> #{submit_default_value}</span>".html_safe
|
111
117
|
end
|
@@ -59,9 +59,7 @@ html
|
|
59
59
|
div
|
60
60
|
= render partial: 'pg_layout/navbar' if @navbar.present?
|
61
61
|
div
|
62
|
-
|
63
|
-
= turbo_frame_tag current_turbo_frame || 'top',
|
64
|
-
**{ 'data-turbo-action': (turbo_frame? ? nil : :advance) }.compact do
|
62
|
+
- captured_content = capture do
|
65
63
|
- if user_signed_in? && breadcrumbs.any?
|
66
64
|
.d-flex.d-print-none
|
67
65
|
.d-flex.flex-grow-1.px-3.py-1[
|
@@ -103,6 +101,13 @@ html
|
|
103
101
|
hacer un container con position absolute para los toasts
|
104
102
|
= yield(:filtros)
|
105
103
|
= content
|
104
|
+
- if @no_main_frame
|
105
|
+
= captured_content
|
106
|
+
- else
|
107
|
+
/ FIXME: rename to main, use a constant
|
108
|
+
= turbo_frame_tag current_turbo_frame || 'top',
|
109
|
+
**{ 'data-turbo-action': (turbo_frame? ? nil : :advance) }.compact do
|
110
|
+
= captured_content
|
106
111
|
|
107
112
|
div style="width:100%; height: 10em"
|
108
113
|
.d-flex.gap-1.justify-content-center.opacity-50 data-controller="theme"
|
data/pg_rails/lib/version.rb
CHANGED
@@ -170,6 +170,7 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
170
170
|
<% else -%>
|
171
171
|
post :create, params: { <%= nombre_tabla_completo_singular %>: valid_attributes }
|
172
172
|
<% end -%>
|
173
|
+
# FIXME: redirect to target object
|
173
174
|
expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= class_name %>.last])
|
174
175
|
end
|
175
176
|
end
|
@@ -218,6 +219,7 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
218
219
|
<% else -%>
|
219
220
|
put :update, params: { id: <%= file_name %>.to_param, <%= nombre_tabla_completo_singular %>: valid_attributes }
|
220
221
|
<% end -%>
|
222
|
+
# FIXME: redirect to target object
|
221
223
|
expect(response).to redirect_to([:<%= ns_prefix.first %>, <%= file_name %>])
|
222
224
|
end
|
223
225
|
end
|