pg_rails 7.6.22 → 7.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +1 -12
- data/pg_engine/app/decorators/pg_engine/base_record_decorator.rb +7 -1
- data/pg_engine/app/helpers/pg_engine/pg_rails_helper.rb +8 -0
- data/pg_engine/app/helpers/pg_engine/route_helper.rb +8 -0
- data/pg_engine/app/views/layouts/_logo.html.slim +1 -2
- data/pg_engine/config/routes.rb +1 -0
- data/pg_engine/lib/pg_engine/site_brand.rb +1 -1
- data/pg_engine/lib/pg_engine/test/dummy_brand.rb +1 -1
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +9 -5
- data/pg_rails/lib/version.rb +1 -1
- 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: 97cc9ad4a85c63b07fdec127479fad2481b4b0e6bfd132ea2a88248f26469b22
|
4
|
+
data.tar.gz: '033854a368aca25c8b76e811a1a83c05a23ce9ad071115da6e8513b82bc2261a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94452ac22cfd17e8891af82d0412fe45b5acbbdc26d0870a61458098b5f59f4d45787a56210dc5e2d785bf933ecd6121797eb2ace0e15eb958a1e1e7ad11259
|
7
|
+
data.tar.gz: 96686a8d9857eb288f035a1c489f4935a837c50dc44c020c3ef51d5c7c7343bf02c7b7cc710bedb7d8f6782d1bcfb9d26406da5680d3a42565eb3ab93cb800bd
|
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module PgEngine
|
4
4
|
# rubocop:disable Rails/ApplicationController
|
5
|
-
# rubocop:disable Metrics/ClassLength
|
6
5
|
class BaseController < ActionController::Base
|
7
6
|
# Importante que esta línea esté al principio
|
8
7
|
protect_from_forgery with: :exception
|
@@ -56,6 +55,7 @@ module PgEngine
|
|
56
55
|
include RouteHelper
|
57
56
|
include PgAssociable::Helpers
|
58
57
|
include FrameHelper
|
58
|
+
include PgRailsHelper
|
59
59
|
|
60
60
|
class Redirect < PgEngine::Error
|
61
61
|
attr_accessor :url
|
@@ -126,16 +126,6 @@ module PgEngine
|
|
126
126
|
render_my_component(InternalErrorComponent.new, :ok)
|
127
127
|
end
|
128
128
|
|
129
|
-
helper_method :dev_user_or_env?
|
130
|
-
def dev_user_or_env?
|
131
|
-
Rails.env.development? || dev_user?
|
132
|
-
end
|
133
|
-
|
134
|
-
helper_method :dev_user?
|
135
|
-
def dev_user?
|
136
|
-
Current.user&.developer?
|
137
|
-
end
|
138
|
-
|
139
129
|
helper_method :mobile_device?
|
140
130
|
|
141
131
|
layout 'pg_layout/base'
|
@@ -231,5 +221,4 @@ module PgEngine
|
|
231
221
|
redirect_back fallback_location: root_path
|
232
222
|
end
|
233
223
|
end
|
234
|
-
# rubocop:enable Metrics/ClassLength
|
235
224
|
end
|
@@ -4,6 +4,8 @@
|
|
4
4
|
module PgEngine
|
5
5
|
class BaseRecordDecorator < Draper::Decorator
|
6
6
|
include ActionView::Helpers
|
7
|
+
include PgEngine::DefaultUrlOptions
|
8
|
+
include Rails.application.routes.url_helpers
|
7
9
|
include PrintHelper
|
8
10
|
include FormHelper
|
9
11
|
include RouteHelper
|
@@ -173,7 +175,11 @@ module PgEngine
|
|
173
175
|
end
|
174
176
|
|
175
177
|
def object_url
|
176
|
-
helpers
|
178
|
+
# FIXME: arreglar las urls generadas con "helpers"
|
179
|
+
# ver cómo se construye el view helper en los jobs
|
180
|
+
# y si se puede injectar el default url options ahí
|
181
|
+
# helpers.url_for(target_object)
|
182
|
+
url_for(target_object)
|
177
183
|
end
|
178
184
|
|
179
185
|
def nested_record
|
@@ -67,5 +67,13 @@ module PgEngine
|
|
67
67
|
def path_for(array)
|
68
68
|
url_for(array.push({ only_path: true }))
|
69
69
|
end
|
70
|
+
|
71
|
+
def context_root_path
|
72
|
+
if Current.tid.present?
|
73
|
+
tenant_root_path(tid: Current.tid)
|
74
|
+
else
|
75
|
+
(Current.user.present? ? users_root_path : root_path)
|
76
|
+
end
|
77
|
+
end
|
70
78
|
end
|
71
79
|
end
|
data/pg_engine/config/routes.rb
CHANGED
@@ -11,7 +11,7 @@ module PgEngine
|
|
11
11
|
def value_for(key)
|
12
12
|
options = @options[key.to_sym]
|
13
13
|
|
14
|
-
raise PgEngine::Error,
|
14
|
+
raise PgEngine::Error, "Key not found: #{key}" if options.nil?
|
15
15
|
|
16
16
|
if Current.app_name.present? && options.keys.include?(Current.app_name)
|
17
17
|
options[Current.app_name]
|
@@ -27,7 +27,10 @@ html
|
|
27
27
|
meta name="turbo-prefetch" content="#{ENV.fetch('TURBO_PREFETCH_ENABLE', 'false')}"
|
28
28
|
meta name="view-transition" content="same-origin"
|
29
29
|
meta name="cable-history-timestamp" content="#{Time.now.to_i}"
|
30
|
-
|
30
|
+
|
31
|
+
- unless @skip_csrf_meta_tags
|
32
|
+
= csrf_meta_tags
|
33
|
+
|
31
34
|
= csp_meta_tag
|
32
35
|
- if defined?(AnyCable::Rails)
|
33
36
|
= action_cable_with_jwt_meta_tag
|
@@ -114,10 +117,11 @@ html
|
|
114
117
|
= captured_content
|
115
118
|
|
116
119
|
div style="width:100%; height: 10em"
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
120
|
+
- if dev_user?
|
121
|
+
.d-flex.gap-1.justify-content-center.opacity-50 data-controller="theme"
|
122
|
+
| (Beta) Tema:
|
123
|
+
= link_to 'Claro', 'javascript:void(0)', 'data-action': 'theme#light'
|
124
|
+
= link_to 'Oscuro', 'javascript:void(0)', 'data-action': 'theme#dark'
|
121
125
|
= render partial: 'layouts/footer'
|
122
126
|
div style="width:100%; height: 10em"
|
123
127
|
= render_turbo_stream_title
|
data/pg_rails/lib/version.rb
CHANGED
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.6.
|
4
|
+
version: 7.6.23
|
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-11-
|
11
|
+
date: 2024-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|