pg_rails 7.6.21.pre.11 → 7.6.22.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_associable/app/helpers/pg_associable/form_builder_methods.rb +1 -0
- data/pg_engine/app/assets/images/test/factura-logo-navbar-1.png +0 -0
- data/pg_engine/app/assets/images/test/factura-logo-xl-light.png +0 -0
- data/pg_engine/app/assets/images/test/factura-mail-footer-lg.png +0 -0
- data/pg_engine/app/assets/images/test/factura-mail-footer-sm.png +0 -0
- data/pg_engine/app/assets/images/test/icon/factura-favicon-32x32.png +0 -0
- data/pg_engine/app/assets/images/test/icon/procura-favicon-32x32.png +0 -0
- data/pg_engine/app/assets/images/test/procura-logo-navbar-1.png +0 -0
- data/pg_engine/app/assets/images/test/procura-logo-xl-light.png +0 -0
- data/pg_engine/app/assets/images/test/procura-mail-footer-lg.png +0 -0
- data/pg_engine/app/assets/images/test/procura-mail-footer-sm.png +0 -0
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +2 -0
- data/pg_engine/app/controllers/pg_engine/base_users_controller.rb +2 -0
- data/pg_engine/app/controllers/tenant/user_accounts_controller.rb +7 -16
- data/pg_engine/app/controllers/users/accounts_controller.rb +1 -1
- data/pg_engine/app/controllers/users/invitations_controller.rb +10 -4
- data/pg_engine/app/controllers/users/registrations_controller.rb +0 -2
- data/pg_engine/app/decorators/account_decorator.rb +3 -1
- data/pg_engine/app/decorators/pg_engine/base_record_decorator.rb +3 -2
- data/pg_engine/app/decorators/user_account_decorator.rb +4 -1
- data/pg_engine/app/helpers/pg_engine/flash_helper.rb +1 -1
- data/pg_engine/app/lib/pg_engine/default_url_options.rb +16 -12
- data/pg_engine/app/mailers/pg_engine/base_devise_mailer.rb +4 -0
- data/pg_engine/app/mailers/pg_engine/base_mailer.rb +17 -1
- data/pg_engine/app/models/account.rb +2 -6
- data/pg_engine/app/models/current.rb +1 -2
- data/pg_engine/app/models/email.rb +1 -1
- data/pg_engine/app/models/user.rb +6 -8
- data/pg_engine/app/models/user_account.rb +0 -4
- data/pg_engine/app/policies/account_policy.rb +9 -4
- data/pg_engine/app/policies/user_account_policy.rb +1 -5
- data/pg_engine/app/views/layouts/_logo.html.slim +8 -0
- data/pg_engine/app/views/users/accounts/show.html.slim +4 -3
- data/pg_engine/config/locales/es.rb +2 -0
- data/pg_engine/config/locales/es.yml +7 -2
- data/pg_engine/lib/pg_engine/active_job_extensions.rb +15 -0
- data/pg_engine/lib/pg_engine/configuracion.rb +2 -0
- data/pg_engine/lib/pg_engine/engine.rb +0 -3
- data/pg_engine/lib/pg_engine/site_brand.rb +39 -0
- data/pg_engine/lib/pg_engine/test/dummy_brand.rb +82 -0
- data/pg_engine/lib/pg_engine.rb +11 -1
- data/pg_engine/spec/factories/users.rb +6 -3
- data/pg_engine/spec/mailers/pg_engine/base_mailer_spec.rb +53 -0
- data/pg_engine/spec/requests/devise/invitations_spec.rb +13 -4
- data/pg_engine/spec/requests/users/accounts_spec.rb +19 -10
- data/pg_engine/spec/requests/users/base_controller_spec.rb +13 -12
- data/pg_engine/spec/requests/users/registrations_spec.rb +19 -18
- data/pg_engine/spec/requests/users/user_accounts_spec.rb +37 -1
- data/pg_layout/app/views/devise/invitations/new.html.erb +2 -1
- data/pg_layout/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/pg_layout/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +1 -1
- data/pg_layout/app/views/layouts/pg_layout/container_logo.html.slim +2 -3
- data/pg_layout/app/views/layouts/pg_layout/containerized.html.slim +2 -1
- data/pg_layout/app/views/layouts/pg_layout/devise_mailer.html.slim +3 -7
- data/pg_layout/app/views/layouts/pg_layout/devise_mailer.text.erb +2 -4
- data/pg_layout/app/views/layouts/pg_layout/mailer.html.slim +3 -7
- data/pg_layout/app/views/layouts/pg_layout/mailer.text.erb +2 -4
- data/pg_layout/app/views/pg_layout/_navbar.html.slim +7 -8
- data/pg_layout/app/views/pg_layout/_sidebar.html.slim +1 -1
- data/pg_layout/app/views/pg_layout/_sidebar_mobile.html.slim +1 -1
- data/pg_layout/app/views/pg_layout/_signed_in_links.html.slim +4 -4
- data/pg_rails/lib/version.rb +1 -1
- metadata +17 -2
@@ -0,0 +1,82 @@
|
|
1
|
+
module PgEngine
|
2
|
+
module Test
|
3
|
+
class DummyBrand < PgEngine::SiteBrand
|
4
|
+
def initialize(include_all: false) # rubocop:disable Metrics/MethodLength
|
5
|
+
super()
|
6
|
+
|
7
|
+
@default_site_brand = :factura
|
8
|
+
|
9
|
+
# FIXME: mover los pngs a pg_engine/ dentro de una carpeta test/
|
10
|
+
@options = {
|
11
|
+
landing_site_url: {
|
12
|
+
procura: 'https://bien.com.ar/procura',
|
13
|
+
factura: 'https://bien.com.ar/factura'
|
14
|
+
},
|
15
|
+
logo_navbar_url: {
|
16
|
+
procura: 'test/procura-logo-navbar-1.png',
|
17
|
+
factura: 'test/factura-logo-navbar-1.png'
|
18
|
+
},
|
19
|
+
logo_xl_url: {
|
20
|
+
procura: 'test/procura-logo-xl-light.png',
|
21
|
+
factura: 'test/factura-logo-xl-light.png'
|
22
|
+
},
|
23
|
+
favicon_prefix: {
|
24
|
+
procura: 'test/icon/procura-favicon',
|
25
|
+
factura: 'test/icon/factura-favicon'
|
26
|
+
},
|
27
|
+
mailer_devise_footer_image_src: {
|
28
|
+
factura: 'test/factura-mail-footer-lg.png',
|
29
|
+
procura: 'test/procura-mail-footer-lg.png'
|
30
|
+
},
|
31
|
+
mailer_base_footer_image_src: {
|
32
|
+
factura: 'test/factura-mail-footer-sm.png',
|
33
|
+
procura: 'test/procura-mail-footer-sm.png'
|
34
|
+
},
|
35
|
+
default_mail_from: {
|
36
|
+
procura: 'noreply@procura',
|
37
|
+
factura: 'noreply@factura'
|
38
|
+
},
|
39
|
+
name: {
|
40
|
+
procura: 'Procura Bien',
|
41
|
+
factura: 'Factura Bien'
|
42
|
+
},
|
43
|
+
default_mail_from_name: {
|
44
|
+
procura: 'Procura Bien',
|
45
|
+
factura: 'Factura Bien'
|
46
|
+
},
|
47
|
+
default_url_options: {
|
48
|
+
default: {}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
return unless Rails.env.development? || include_all
|
53
|
+
|
54
|
+
@options.merge!({
|
55
|
+
default_url_options: {
|
56
|
+
procura: {
|
57
|
+
host: 'procura.localhost',
|
58
|
+
port: '3000'
|
59
|
+
},
|
60
|
+
factura: {
|
61
|
+
host: 'factura.localhost',
|
62
|
+
port: '3000'
|
63
|
+
}
|
64
|
+
}
|
65
|
+
})
|
66
|
+
end
|
67
|
+
|
68
|
+
def account_plan_options
|
69
|
+
{ factura: 0, procura: 1 }
|
70
|
+
end
|
71
|
+
|
72
|
+
def detect(request)
|
73
|
+
return :procura if request.host.match(/procura/)
|
74
|
+
return :factura if request.host.match(/factura/)
|
75
|
+
|
76
|
+
pg_warn 'default site_brand assigned'
|
77
|
+
|
78
|
+
:factura
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
data/pg_engine/lib/pg_engine.rb
CHANGED
@@ -4,7 +4,9 @@ require_relative 'pg_engine/engine'
|
|
4
4
|
require_relative 'pg_engine/core_ext'
|
5
5
|
require_relative 'pg_engine/error'
|
6
6
|
require_relative 'pg_engine/configuracion'
|
7
|
+
require_relative 'pg_engine/site_brand'
|
7
8
|
require_relative 'pg_engine/navigator'
|
9
|
+
require_relative 'pg_engine/active_job_extensions'
|
8
10
|
require_relative 'pg_engine/email_observer'
|
9
11
|
require_relative 'pg_engine/mailgun/log_sync'
|
10
12
|
require_relative 'pg_engine/route_helpers'
|
@@ -84,12 +86,16 @@ end
|
|
84
86
|
|
85
87
|
module PgEngine
|
86
88
|
class << self
|
87
|
-
attr_writer :configuracion
|
89
|
+
attr_writer :configuracion, :site_brand
|
88
90
|
|
89
91
|
def configuracion
|
90
92
|
@configuracion ||= Configuracion.new
|
91
93
|
end
|
92
94
|
|
95
|
+
def site_brand
|
96
|
+
@site_brand || (raise PgEngine::Error, 'no site brand manager')
|
97
|
+
end
|
98
|
+
|
93
99
|
def config
|
94
100
|
configuracion
|
95
101
|
end
|
@@ -115,3 +121,7 @@ module PgEngine
|
|
115
121
|
@deprecator ||= ActiveSupport::Deprecation.new('7.5', 'PgEngine')
|
116
122
|
end
|
117
123
|
end
|
124
|
+
|
125
|
+
ActiveSupport.on_load(:active_job) do |base|
|
126
|
+
base.prepend PgEngine::ActiveJobExtensions
|
127
|
+
end
|
@@ -72,9 +72,12 @@ FactoryBot.define do
|
|
72
72
|
trait :owner do
|
73
73
|
after(:create) do |model|
|
74
74
|
model.user_accounts.create!(profiles: [:account__owner])
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
trait :guest do
|
79
|
+
after(:create) do |model|
|
80
|
+
model.user_accounts.create!(profiles: [])
|
78
81
|
end
|
79
82
|
end
|
80
83
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
class DummyMailer < ApplicationMailer
|
4
|
+
def test_mail
|
5
|
+
mail(to: 'fake@mail.com') do |format|
|
6
|
+
format.html { render inline: erb_template } # rubocop:disable Rails/RenderInline
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def erb_template
|
13
|
+
<<-ERB
|
14
|
+
<%= root_url %>
|
15
|
+
ERB
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe PgEngine::BaseMailer do
|
20
|
+
describe 'default_url_options' do
|
21
|
+
subject do
|
22
|
+
mail.deliver
|
23
|
+
end
|
24
|
+
|
25
|
+
let(:mail) { DummyMailer.test_mail }
|
26
|
+
|
27
|
+
# rubocop:disable Style/GlobalVars
|
28
|
+
before do
|
29
|
+
$site_brand_before = PgEngine.site_brand
|
30
|
+
PgEngine.site_brand = PgEngine::Test::DummyBrand.new(include_all: true)
|
31
|
+
end
|
32
|
+
|
33
|
+
after do
|
34
|
+
PgEngine.site_brand = $site_brand_before
|
35
|
+
end
|
36
|
+
# rubocop:enable Style/GlobalVars
|
37
|
+
|
38
|
+
it 'cuando elige el default' do
|
39
|
+
expect { subject }.to have_warned('Default site brand chosen')
|
40
|
+
expect(mail.body.encoded).to include 'factura.localhost'
|
41
|
+
expect(mail.header_fields.get_field(:from).value).to include 'Factura Bien'
|
42
|
+
expect(mail.header_fields.get_field(:from).value).to include 'noreply@factura'
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'cuando es un brand específico' do
|
46
|
+
Current.app_name = :procura
|
47
|
+
subject
|
48
|
+
expect(mail.body.encoded).to include 'procura.localhost'
|
49
|
+
expect(mail.header_fields.get_field(:from).value).to include 'Procura Bien'
|
50
|
+
expect(mail.header_fields.get_field(:from).value).to include 'noreply@procura'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
RSpec::Matchers.define_negated_matcher :not_change, :change
|
4
4
|
|
5
|
-
describe 'invite users to the platform and to an account' do
|
5
|
+
describe 'invite users to the platform and to an account #' do
|
6
6
|
let(:account) { ActsAsTenant.current_tenant }
|
7
7
|
|
8
8
|
describe 'send an invitation to the platform', :tpath_req do
|
@@ -108,7 +108,7 @@ describe 'invite users to the platform and to an account' do
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
describe '
|
111
|
+
describe 'when updating an invitation' do
|
112
112
|
let(:logged_user) { create :user, account: }
|
113
113
|
let(:user_account) do
|
114
114
|
logged_user.user_accounts.first
|
@@ -119,7 +119,7 @@ describe 'invite users to the platform and to an account' do
|
|
119
119
|
user_account.update(membership_status:, invitation_status: :ist_invited)
|
120
120
|
end
|
121
121
|
|
122
|
-
context '
|
122
|
+
context 'accepting an invite' do
|
123
123
|
subject do
|
124
124
|
put "/u/espacios/#{account.to_param}/update_invitation", params: { accept: 1 }
|
125
125
|
end
|
@@ -130,7 +130,16 @@ describe 'invite users to the platform and to an account' do
|
|
130
130
|
expect { subject }.to change { user_account.reload.invitation_status }.to('ist_accepted')
|
131
131
|
end
|
132
132
|
|
133
|
-
|
133
|
+
context 'and doesnt belong to the account' do
|
134
|
+
before do
|
135
|
+
user_account.destroy
|
136
|
+
end
|
137
|
+
|
138
|
+
it 'returns unauthorized' do
|
139
|
+
subject
|
140
|
+
expect(response).to have_http_status(:unauthorized)
|
141
|
+
end
|
142
|
+
end
|
134
143
|
end
|
135
144
|
|
136
145
|
context 'when rejecting an invite' do
|
@@ -9,7 +9,7 @@ describe 'Users::AccountsController' do
|
|
9
9
|
create_list :user, 2
|
10
10
|
end
|
11
11
|
|
12
|
-
describe 'show' do
|
12
|
+
describe '#show' do
|
13
13
|
it 'shows the owned account' do
|
14
14
|
get "/u/espacios/#{account.to_param}"
|
15
15
|
expect(response).to have_http_status(:ok)
|
@@ -21,7 +21,7 @@ describe 'Users::AccountsController' do
|
|
21
21
|
expect(response).to have_http_status(:unauthorized)
|
22
22
|
end
|
23
23
|
|
24
|
-
context 'when
|
24
|
+
context 'when is guest user' do
|
25
25
|
subject do
|
26
26
|
get "/u/espacios/#{other_account.to_param}"
|
27
27
|
end
|
@@ -38,23 +38,21 @@ describe 'Users::AccountsController' do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
context '
|
41
|
+
context 'and has access to user list' do
|
42
42
|
let(:profiles) { [:user_accounts__read] }
|
43
43
|
|
44
|
-
pending 'See the users'
|
45
|
-
|
46
44
|
it do
|
47
45
|
subject
|
48
|
-
|
49
|
-
expect(response.body).to have_text('Dejar
|
46
|
+
expect(response.body).to include('embedded__user_accounts')
|
47
|
+
expect(response.body).to have_text('Dejar el espacio')
|
50
48
|
end
|
51
49
|
end
|
52
50
|
|
53
51
|
context 'when its active and dont have user_accounts__read access' do
|
54
52
|
it do
|
55
53
|
subject
|
56
|
-
expect(response.body).
|
57
|
-
expect(response.body).to have_text('Dejar
|
54
|
+
expect(response.body).not_to include('embedded__user_accounts')
|
55
|
+
expect(response.body).to have_text('Dejar el espacio')
|
58
56
|
end
|
59
57
|
end
|
60
58
|
|
@@ -64,7 +62,7 @@ describe 'Users::AccountsController' do
|
|
64
62
|
it do
|
65
63
|
subject
|
66
64
|
expect(response.body).to have_text('Deshabilitado')
|
67
|
-
expect(response.body).to have_text('Dejar
|
65
|
+
expect(response.body).to have_text('Dejar el espacio')
|
68
66
|
end
|
69
67
|
end
|
70
68
|
|
@@ -79,6 +77,17 @@ describe 'Users::AccountsController' do
|
|
79
77
|
end
|
80
78
|
end
|
81
79
|
|
80
|
+
describe '#edit' do
|
81
|
+
let(:nombre) { Faker::Lorem.sentence }
|
82
|
+
|
83
|
+
it do
|
84
|
+
get "/u/espacios/#{account.to_param}/edit"
|
85
|
+
expect(response).to have_http_status(:ok)
|
86
|
+
patch "/u/espacios/#{account.to_param}", params: { account: { nombre: } }
|
87
|
+
expect(account.reload.nombre).to eq nombre
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
82
91
|
describe 'index' do
|
83
92
|
subject do
|
84
93
|
get '/u/espacios'
|
@@ -30,17 +30,18 @@ describe 'redirection' do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
33
|
+
# TODO: activar subdomains
|
34
|
+
# context 'when belongs to other account', pending: 'subdomains not ready' do
|
35
|
+
# before do
|
36
|
+
# create :account, subdomain: 'other'
|
37
|
+
# host! 'other.example.com'
|
38
|
+
# end
|
39
|
+
|
40
|
+
# it do
|
41
|
+
# get '/u/t/cosas'
|
42
|
+
|
43
|
+
# expect(response).to redirect_to new_user_session_path, tpath: false
|
44
|
+
# end
|
45
|
+
# end
|
45
46
|
end
|
46
47
|
end
|
@@ -70,24 +70,25 @@ describe 'registrations controller' do
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
73
|
+
# TODO: activar subdomains
|
74
|
+
# context 'cuando hay tenant' do
|
75
|
+
# before do
|
76
|
+
# host! 'bien.localhost.com'
|
77
|
+
# create :account, subdomain: 'bien'
|
78
|
+
# end
|
79
|
+
|
80
|
+
# it do
|
81
|
+
# expect { subject }.to change(User, :count).by(1)
|
82
|
+
# end
|
83
|
+
|
84
|
+
# it 'creates the user account', pending: 'subdomains not working' do
|
85
|
+
# expect { subject }.to change(UserAccount, :count).by(1)
|
86
|
+
# end
|
87
|
+
|
88
|
+
# it do
|
89
|
+
# expect { subject }.not_to change(Account, :count)
|
90
|
+
# end
|
91
|
+
# end
|
91
92
|
end
|
92
93
|
|
93
94
|
describe '#edit' do
|
@@ -10,7 +10,43 @@ describe 'user accounts', :tpath_req do
|
|
10
10
|
sign_in logged_user
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
describe '#index' do
|
14
|
+
subject do
|
15
|
+
get '/u/t/user_accounts'
|
16
|
+
end
|
17
|
+
|
18
|
+
it do
|
19
|
+
subject
|
20
|
+
expect(response).to have_http_status(:ok)
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when user is owner' do
|
24
|
+
it 'shows the permissions' do
|
25
|
+
subject
|
26
|
+
expect(response.body).to have_text('Permisos')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'when user is guest' do
|
31
|
+
before do
|
32
|
+
create :user, :owner
|
33
|
+
end
|
34
|
+
|
35
|
+
let!(:logged_user) { create :user, :guest }
|
36
|
+
|
37
|
+
it 'when cant see the user list returns unauthorized' do
|
38
|
+
subject
|
39
|
+
expect(response).to have_http_status(:unauthorized)
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'when can see user list dont shows the permissions' do
|
43
|
+
logged_user.user_account_for(account).update(profiles: [:user_accounts__read])
|
44
|
+
subject
|
45
|
+
expect(response).to have_http_status(:ok)
|
46
|
+
expect(response.body).to have_no_text('Permisos')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
14
50
|
|
15
51
|
describe 'show' do
|
16
52
|
it do
|
@@ -1,4 +1,5 @@
|
|
1
|
-
<h2><%=
|
1
|
+
<h2><%= UserAccount.new.decorate.submit_default_value %></h2>
|
2
|
+
|
2
3
|
<div style="max-width: 40em" data-controller="pg_form">
|
3
4
|
<%= pg_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %>
|
4
5
|
<div class="form-inputs">
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", inviter: @resource.invited_by, app_name:
|
1
|
+
<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", inviter: @resource.invited_by, app_name: PgEngine.site_brand.name) %></p>
|
2
2
|
|
3
3
|
<p><%= t("devise.mailer.invitation_instructions.follow_link") %></p>
|
4
4
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= t("devise.mailer.invitation_instructions.someone_invited_you", inviter: @resource.invited_by, app_name:
|
1
|
+
<%= t("devise.mailer.invitation_instructions.someone_invited_you", inviter: @resource.invited_by, app_name: PgEngine.site_brand.name) %>
|
2
2
|
|
3
3
|
<%= t("devise.mailer.invitation_instructions.follow_link") %>
|
4
4
|
|
@@ -1,9 +1,8 @@
|
|
1
1
|
- content_for :content do
|
2
2
|
.container-fluid.pt-4
|
3
3
|
.text-center
|
4
|
-
-
|
5
|
-
.
|
6
|
-
= image_tag @navbar.logo_xl_url, class: 'img-fluid', style: 'max-height: 4em'
|
4
|
+
.mb-4
|
5
|
+
= image_tag PgEngine.site_brand.logo_xl_url, class: 'img-fluid', style: 'max-height: 4em'
|
7
6
|
|
8
7
|
= content_for?(:container_logo_content) ? yield(:container_logo_content) : yield
|
9
8
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
- content_for :content do
|
2
|
-
|
2
|
+
- klass = modal_targeted? ? '' : (@container_class || 'container-fluid')
|
3
|
+
div class="pt-3 #{klass}" style=@container_style
|
3
4
|
= content_for?(:containerized_content) ? yield(:containerized_content) : yield
|
4
5
|
|
5
6
|
= render template: 'layouts/pg_layout/base'
|
@@ -3,10 +3,6 @@ html
|
|
3
3
|
center
|
4
4
|
= yield
|
5
5
|
|
6
|
-
-
|
7
|
-
|
8
|
-
=
|
9
|
-
- if @footer_image_src.present?
|
10
|
-
= image_tag @footer_image_src, alt: @footer_image_alt
|
11
|
-
- else
|
12
|
-
= @footer_image_alt
|
6
|
+
footer style="margin-top: 2em;"
|
7
|
+
= link_to PgEngine.site_brand.landing_site_url, rel: 'noreferrer', target: :_blank do
|
8
|
+
= image_tag @footer_image_src, alt: PgEngine.site_brand.name
|
@@ -2,10 +2,6 @@ html
|
|
2
2
|
body style="font-family: sans-serif"
|
3
3
|
= yield
|
4
4
|
|
5
|
-
-
|
6
|
-
|
7
|
-
=
|
8
|
-
- if @footer_image_src.present?
|
9
|
-
= image_tag @footer_image_src, alt: @footer_image_alt
|
10
|
-
- else
|
11
|
-
= @footer_image_alt
|
5
|
+
footer style="margin-top: 2em;"
|
6
|
+
= link_to PgEngine.site_brand.landing_site_url, rel: 'noreferrer', target: :_blank do
|
7
|
+
= image_tag @footer_image_src, alt: PgEngine.site_brand.name
|
@@ -1,21 +1,20 @@
|
|
1
1
|
nav class="navbar navbar-expand-#{@breakpoint_navbar_expand}" data-bs-theme="dark"
|
2
|
-
.container-fluid.
|
2
|
+
.container-fluid.gap-2
|
3
3
|
div
|
4
4
|
- unless @sidebar == false
|
5
5
|
button data-controller="navbar" data-action="navbar#expandNavbar" class="btn btn-outline-light me-2 d-none d-#{@breakpoint_navbar_expand}-inline-block"
|
6
6
|
i class="bi #{@navbar_chevron_class}"
|
7
|
-
-
|
8
|
-
|
9
|
-
= render @navbar.logo
|
7
|
+
span.ms-3
|
8
|
+
= render partial: 'layouts/logo'
|
10
9
|
- if user_signed_in? && @notifications_bell.present?
|
11
10
|
div class="d-#{@breakpoint_navbar_expand}-none"
|
12
11
|
= render @notifications_bell
|
13
|
-
|
12
|
+
.d-flex
|
13
|
+
- @navbar.extensiones.each do |extension|
|
14
|
+
= extension
|
14
15
|
- if user_signed_in?
|
15
16
|
.collapse.navbar-collapse.justify-content-end
|
16
17
|
= render partial: 'pg_layout/signed_in_links'
|
17
|
-
- @navbar.extensiones.each do |extension|
|
18
|
-
= extension
|
19
18
|
div class="d-#{@breakpoint_navbar_expand}-none"
|
20
19
|
- if user_signed_in?
|
21
20
|
a.d-flex.align-items-center.gap-2 href="#" data-bs-toggle="offcanvas" data-bs-target="#offcanvasExample" aria-controls="offcanvasExample"
|
@@ -38,7 +37,7 @@ nav class="navbar navbar-expand-#{@breakpoint_navbar_expand}" data-bs-theme="dar
|
|
38
37
|
= render NotificationComponent.with_collection(@notifications) if @notifications&.any?
|
39
38
|
- else
|
40
39
|
span.text-light.text-center
|
41
|
-
| No hay notificaciones
|
40
|
+
| No hay notificaciones
|
42
41
|
.text-center
|
43
42
|
button.btn.btn-link.text-light.btn-sm[type="button" data-bs-toggle="collapse" data-bs-target="#notifications-collapse"]
|
44
43
|
i.bi-chevron-up.fs-3
|
@@ -1,7 +1,7 @@
|
|
1
1
|
div id="sidebar" class="#{@navbar_opened_class} flex-shrink-0 d-none d-#{@breakpoint_navbar_expand}-block"
|
2
2
|
.mt-1
|
3
3
|
.m-3
|
4
|
-
= render
|
4
|
+
= render partial: 'layouts/logo'
|
5
5
|
ul.list-unstyled.ps-0.mt-5
|
6
6
|
- @navbar.sidebar.each do |entry|
|
7
7
|
- next if @navbar.hide_entry?(entry)
|
@@ -18,19 +18,19 @@ ul.navbar-nav.gap-3.align-items-center class="gap-#{@breakpoint_navbar_expand}-0
|
|
18
18
|
li = link_to ua.account, tenant_root_path(tid: ua.to_param), class: 'dropdown-item'
|
19
19
|
li
|
20
20
|
hr.dropdown-divider
|
21
|
-
li = link_to "Administrar #{Account.
|
21
|
+
li = link_to "Administrar #{Account.nombre_plural.downcase}", users_accounts_path(tid: nil), class: 'dropdown-item'
|
22
22
|
- elsif @other_active_accounts&.any?
|
23
23
|
li.nav-item.dropdown.d-flex
|
24
24
|
= link_to '#', class: 'nav-link dropdown-toggle py-0 d-flex align-items-center',
|
25
25
|
role: :button, 'data-bs-toggle': :dropdown, 'aria-expanded': 'false' do
|
26
26
|
i.bi.bi-bag-fill.me-2 style="font-size: 1.7em"
|
27
|
-
= Account.
|
27
|
+
= Account.nombre_plural
|
28
28
|
ul.dropdown-menu
|
29
29
|
- @other_active_accounts.each do |ua|
|
30
30
|
li = link_to ua.account, tenant_root_path(tid: ua.to_param), class: 'dropdown-item'
|
31
31
|
li
|
32
32
|
hr.dropdown-divider
|
33
|
-
li = link_to "Administrar #{Account.
|
33
|
+
li = link_to "Administrar #{Account.nombre_plural.downcase}", users_accounts_path(tid: nil), class: 'dropdown-item'
|
34
34
|
|
35
35
|
.vr.bg-white.mx-3.d-none class="d-#{@breakpoint_navbar_expand}-inline-block"
|
36
36
|
- if Current.user.present? && @notifications_bell.present?
|
@@ -47,7 +47,7 @@ ul.navbar-nav.gap-3.align-items-center class="gap-#{@breakpoint_navbar_expand}-0
|
|
47
47
|
= Current.user
|
48
48
|
ul.dropdown-menu
|
49
49
|
li = link_to 'Mi cuenta', edit_user_registration_path(tid: nil), class: 'dropdown-item'
|
50
|
-
li = link_to Account.
|
50
|
+
li = link_to Account.nombre_plural, users_accounts_path(tid: nil), class: 'dropdown-item'
|
51
51
|
- if Current.user.developer?
|
52
52
|
li = link_to 'Admin', admin_users_path, class: 'dropdown-item'
|
53
53
|
li = link_to 'Cerrar sesión', destroy_user_session_path(tid: nil),
|
data/pg_rails/lib/version.rb
CHANGED