pg_rails 7.0.8.pre.alpha.21 → 7.0.8.pre.alpha.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/pg_engine/app/controllers/admin/users_controller.rb +1 -1
  3. data/pg_engine/app/controllers/pg_engine/base_controller.rb +3 -1
  4. data/pg_engine/app/controllers/pg_engine/devise_controller.rb +6 -6
  5. data/pg_engine/app/controllers/users/confirmations_controller.rb +17 -0
  6. data/pg_engine/app/controllers/users/registrations_controller.rb +23 -3
  7. data/pg_engine/app/views/pg_engine/base/index.html.slim +22 -20
  8. data/pg_engine/config/initializers/rollbar.rb +2 -2
  9. data/pg_engine/config/locales/es.yml +14 -0
  10. data/pg_engine/config/routes.rb +4 -1
  11. data/pg_engine/lib/pg_engine/engine.rb +4 -6
  12. data/pg_engine/lib/tasks/auto_anotar_modelos.rake +1 -1
  13. data/pg_engine/spec/controllers/users/confirmations_controller_spec.rb +33 -0
  14. data/pg_engine/spec/controllers/users/registrations_controller_spec.rb +32 -0
  15. data/pg_layout/app/javascript/application.js +13 -2
  16. data/pg_layout/app/views/devise/registrations/edit.html.erb +6 -0
  17. data/pg_layout/app/views/devise/registrations/new.html.erb +23 -21
  18. data/pg_layout/app/views/devise/sessions/new.html.erb +2 -1
  19. data/pg_layout/app/views/devise/shared/_links.html.erb +30 -19
  20. data/pg_layout/app/views/layouts/pg_layout/{layout.html.slim → base.html.slim} +1 -1
  21. data/pg_layout/app/views/layouts/pg_layout/containerized.html.slim +5 -0
  22. data/pg_layout/app/views/layouts/pg_layout/devise.html.slim +10 -24
  23. data/pg_layout/app/views/pg_layout/_flash.html.slim +1 -2
  24. data/pg_layout/app/views/pg_layout/_navbar.html.erb +6 -3
  25. data/pg_layout/app/views/pg_layout/_rollbar.html.erb +2 -2
  26. data/pg_rails/lib/version.rb +1 -1
  27. metadata +6 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 242457a4da70f56123b7fd123f88c96a3b84aa25b958e2d49df70329b018a2f3
4
- data.tar.gz: 4e8e95c37063829636412299ae87e7ee683e62977d0afa8dbec310b1492bd46f
3
+ metadata.gz: 791fd0883c4eaa68bdcdac6f07a6fe6a9aa7d8a3766fb4f6e46d655bb20ff502
4
+ data.tar.gz: b95cb120a61526e67b647c7531eaf8b306edd9ef7dab778e6f90f33134547415
5
5
  SHA512:
6
- metadata.gz: 4ac18ede797969e3e60579bdb3b47494e7b34879a4446ce583fb282b8ea99644d5f6efc9617f853b46554aa83f853a0dd8b21e15edbed41f5fffacb927c66fe1
7
- data.tar.gz: a425dda11bfe7c0ba6aa63ec71e81ad9bb42bad11991b3bba914e2dd5966f50bb613296c87eec92051a301330de07ec4a8d028796dac1077f958dc0fbb3c7ff7
6
+ metadata.gz: 2cc9a7cb7e04cda3597faf07a4fdd22832bdf9cf4abb299f762eec83eb87338ee4e4b65b1381d5b75ace96787e8c71356ed27f9ada651d1553c6b1055fe62fdf
7
+ data.tar.gz: 41d07925fd7565e2ce348df8c747502c2cdf78540bfa6e672dfb2e1fb753885e1dbbff249106d1fea13218f69b587d6053dbbec29302fbeaa83823b946a369ee
@@ -36,7 +36,7 @@ module Admin
36
36
  usuario = User.find(params[:id])
37
37
  sign_in(:user, usuario)
38
38
  end
39
- redirect_to '/'
39
+ redirect_to after_sign_in_path_for(usuario)
40
40
  end
41
41
  # :nocov:
42
42
 
@@ -18,7 +18,7 @@ module PgEngine
18
18
 
19
19
  helper_method :mobile_device?
20
20
 
21
- layout 'pg_layout/layout'
21
+ layout 'pg_layout/base'
22
22
 
23
23
  # Los flash_types resultantes serían:
24
24
  # [:alert, :notice, :warning, :success]
@@ -67,6 +67,8 @@ module PgEngine
67
67
  end
68
68
  format.html do
69
69
  if request.path == root_path
70
+ # TODO!: renderear un 500.html y pg_err
71
+ sign_out(current_user) if current_user.present?
70
72
  render plain: 'Not authorized'
71
73
  else
72
74
  go_back('Not authorized')
@@ -4,15 +4,15 @@ module PgEngine
4
4
 
5
5
  layout :layout_by_resource
6
6
 
7
+ protected
8
+
7
9
  def layout_by_resource
8
- if controller_name == 'registrations' && action_name.in?(%w[edit update])
9
- 'pg_layout/layout'
10
- else
11
- 'pg_layout/devise'
12
- end
10
+ edit_registration? ? 'pg_layout/devise' : 'pg_layout/containerized'
13
11
  end
14
12
 
15
- protected
13
+ def edit_registration?
14
+ !(controller_name == 'registrations' && action_name.in?(%w[edit update]))
15
+ end
16
16
 
17
17
  def configure_permitted_parameters
18
18
  devise_parameter_sanitizer.permit(:sign_up, keys: %i[nombre apellido])
@@ -0,0 +1,17 @@
1
+ module Users
2
+ class ConfirmationsController < Devise::ConfirmationsController
3
+ # GET /resource/confirmation?confirmation_token=abcdef
4
+ def show # rubocop:disable Metrics/AbcSize
5
+ self.resource = resource_class.confirm_by_token(params[:confirmation_token])
6
+ yield resource if block_given?
7
+
8
+ if resource.errors.empty?
9
+ flash[:toast] = false
10
+ set_flash_message!(:notice, :confirmed)
11
+ respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) }
12
+ else
13
+ respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,8 +1,28 @@
1
1
  module Users
2
2
  class RegistrationsController < Devise::RegistrationsController
3
- def after_inactive_sign_up_path_for(resource)
4
- flash[:toast] = false
5
- super(resource)
3
+ # POST /resource
4
+ def create
5
+ build_resource(sign_up_params)
6
+
7
+ resource.save
8
+ yield resource if block_given?
9
+ if resource.persisted?
10
+ expire_data_after_sign_in!
11
+ render_message
12
+ else
13
+ clean_up_passwords resource
14
+ set_minimum_password_length
15
+ respond_with resource
16
+ end
17
+ end
18
+
19
+ def render_message
20
+ msg = <<~HTML
21
+ <div class="alert alert-info">
22
+ #{I18n.t 'devise.registrations.signed_up_but_unconfirmed'}
23
+ </div>
24
+ HTML
25
+ render turbo_stream: turbo_stream.update('form-signup', msg)
6
26
  end
7
27
  end
8
28
  end
@@ -1,27 +1,29 @@
1
1
  - content_for(:title, @clase_modelo.nombre_plural)
2
2
  - content_for :actions do
3
- button.btn.btn-sm.btn-outline-primary[type="button" data-bs-toggle="collapse"
4
- data-bs-target="#filtros" aria-expanded="false"
5
- aria-controls="filtros"]
6
- span.bi.bi-funnel-fill
7
- span.d-none.d-sm-inline Filtrar
8
- .ms-1
3
+ - if @filtros.present?
4
+ button.btn.btn-sm.btn-outline-primary[type="button" data-bs-toggle="collapse"
5
+ data-bs-target="#filtros" aria-expanded="false"
6
+ aria-controls="filtros"]
7
+ span.bi.bi-funnel-fill
8
+ span.d-none.d-sm-inline Filtrar
9
+ .ms-1
9
10
  = @clase_modelo.new.decorate.new_link
10
11
 
11
- .collapse.border-bottom#filtros class="#{ 'show' if any_filter? }"
12
- .d-flex.align-items-center.p-2
13
- .px-2.d-none.d-sm-inline-block
14
- span.bi.bi-funnel-fill
15
- = form_tag nil, class: '', method: :get do
16
- .row.g-1
17
- = @filtros.filtros_html
18
- .col-auto
19
- = button_tag class: 'btn btn-sm btn-primary col-auto' do
20
- span.bi.bi-search
21
- .col-auto
22
- = link_to namespaced_path(@clase_modelo, clean: true),
23
- class: 'btn btn-sm btn-secondary col-auto' do
24
- | Limpiar
12
+ - if @filtros.present?
13
+ .collapse.border-bottom#filtros class="#{ 'show' if any_filter? }"
14
+ .d-flex.align-items-center.p-2
15
+ .px-2.d-none.d-sm-inline-block
16
+ span.bi.bi-funnel-fill
17
+ = form_tag nil, class: '', method: :get do
18
+ .row.g-1
19
+ = @filtros.filtros_html
20
+ .col-auto
21
+ = button_tag class: 'btn btn-sm btn-primary col-auto' do
22
+ span.bi.bi-search
23
+ .col-auto
24
+ = link_to namespaced_path(@clase_modelo, clean: true),
25
+ class: 'btn btn-sm btn-secondary col-auto' do
26
+ | Limpiar
25
27
 
26
28
  div
27
29
  - if @collection.any?
@@ -2,10 +2,10 @@ Rollbar.configure do |config|
2
2
  # Without configuration, Rollbar is enabled in all environments.
3
3
  # To disable in specific environments, set config.enabled=false.
4
4
 
5
- config.access_token = Rails.application.credentials.rollbar.access_token_server
5
+ config.access_token = Rails.application.credentials.rollbar&.access_token_server
6
6
 
7
7
  # Here we'll disable in 'test':
8
- if Rails.env.test?
8
+ if Rails.env.local?
9
9
  config.enabled = false
10
10
  end
11
11
 
@@ -46,3 +46,17 @@ es:
46
46
  messages:
47
47
  blank: ''
48
48
  empty: ''
49
+ devise:
50
+ registrations:
51
+ new:
52
+ sign_up: Crear una cuenta
53
+ passwords:
54
+ new:
55
+ send_me_reset_password_instructions: Enviar instrucciones para restablecer contraseña
56
+ forgot_your_password: ¿Olvidaste tu contraseña?
57
+ shared:
58
+ links:
59
+ sign_up: Crear una cuenta
60
+ forgot_your_password: ¿Olvidaste tu contraseña?
61
+ sign_out: Cerrar sesión
62
+ didn_t_receive_confirmation_instructions: ¿No recibiste las instrucciones para confirmar tu cuenta?
@@ -1,7 +1,10 @@
1
1
  include PgEngine::RouteHelpers
2
2
 
3
3
  Rails.application.routes.draw do
4
- devise_for :users, controllers: { registrations: 'users/registrations' }
4
+ devise_for :users, controllers: {
5
+ confirmations: 'users/confirmations',
6
+ registrations: 'users/registrations'
7
+ }
5
8
  namespace :admin, path: 'a' do
6
9
  pg_resource(:users)
7
10
  pg_resource(:accounts)
@@ -13,12 +13,10 @@ module PgEngine
13
13
  g.fallbacks[:pg_active_record] = :active_record
14
14
  end
15
15
 
16
- if Rails.env.local?
17
- initializer 'pg_engine.set_factory_paths', after: 'factory_bot.set_factory_paths' do
18
- # Para que tome las factories de pg_engine/spec/factories
19
- # además de las de dummy/spec/factories
20
- FactoryBot.definition_file_paths << "#{root}/spec/factories"
21
- end
16
+ initializer 'pg_engine.set_factory_paths', after: 'factory_bot.set_factory_paths' do
17
+ # Para que tome las factories de pg_engine/spec/factories
18
+ # además de las de dummy/spec/factories
19
+ FactoryBot.definition_file_paths << "#{root}/spec/factories"
22
20
  end
23
21
 
24
22
  initializer 'configurar_pg_rails' do
@@ -5,7 +5,7 @@ Dotenv.load
5
5
 
6
6
  model_paths = begin
7
7
  JSON.parse(ENV['MODEL_PATHS'])
8
- rescue JSON::ParserError
8
+ rescue StandardError
9
9
  ENV['MODEL_PATHS'] || 'app/models'
10
10
  end
11
11
 
@@ -0,0 +1,33 @@
1
+ require 'rails_helper'
2
+
3
+ describe Users::ConfirmationsController do
4
+ render_views
5
+
6
+ before do
7
+ @request.env['devise.mapping'] = Devise.mappings[:user] # rubocop:disable RSpec/InstanceVariable
8
+ end
9
+
10
+ describe '#show sin el token' do
11
+ subject { get :show }
12
+
13
+ it do
14
+ subject
15
+ expect(response).to have_http_status(:ok)
16
+ end
17
+ end
18
+
19
+ describe '#show con el token' do
20
+ subject { get :show, params: { confirmation_token: 'bla' } }
21
+
22
+ let(:user) { create :user, confirmed_at: nil, confirmation_token: 'bla' }
23
+
24
+ it do
25
+ subject
26
+ expect(response).to have_http_status(:ok)
27
+ end
28
+
29
+ it do
30
+ expect { subject }.to change { user.reload.confirmed_at }.from(nil).to(be_present)
31
+ end
32
+ end
33
+ end
@@ -1,6 +1,8 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  describe Users::RegistrationsController do
4
+ render_views
5
+
4
6
  before do
5
7
  # rubocop:disable RSpec/InstanceVariable
6
8
  @request.env['devise.mapping'] = Devise.mappings[:user]
@@ -16,6 +18,36 @@ describe Users::RegistrationsController do
16
18
  end
17
19
  end
18
20
 
21
+ describe '#create' do
22
+ subject do
23
+ post :create, params: { user: { nombre:, apellido:, email:, password:, password_confirmation: } }
24
+ end
25
+
26
+ let(:nombre) { Faker::Name.first_name }
27
+ let(:apellido) { Faker::Name.last_name }
28
+ let(:email) { Faker::Internet.email }
29
+ let(:password) { '123123' }
30
+ let(:password_confirmation) { password }
31
+
32
+ it do
33
+ expect { subject }.to change(User, :count).by(1)
34
+ end
35
+
36
+ it do
37
+ subject
38
+ expect(response.body).to include I18n.t('devise.registrations.signed_up_but_unconfirmed')
39
+ end
40
+
41
+ context 'cuando no coinciden los passwords' do
42
+ let(:password_confirmation) { 'bla' }
43
+
44
+ it do
45
+ subject
46
+ expect(response).not_to be_successful
47
+ end
48
+ end
49
+ end
50
+
19
51
  describe '#edit' do
20
52
  subject { get :edit }
21
53
 
@@ -5,7 +5,10 @@ import './controllers'
5
5
  // Bootstrap's toasts
6
6
  import * as bootstrap from 'bootstrap'
7
7
 
8
- document.addEventListener('turbo:load', function () {
8
+ document.addEventListener('turbo:load', bindToasts)
9
+ document.addEventListener('turbo:render', bindToasts)
10
+
11
+ function bindToasts () {
9
12
  const toastElList = document.querySelectorAll('.toast:not(.hide):not(.show)')
10
13
  Array.from(toastElList).map(toastEl => new bootstrap.Toast(toastEl).show())
11
14
 
@@ -33,4 +36,12 @@ document.addEventListener('turbo:load', function () {
33
36
 
34
37
  // Start observing the target node for configured mutations
35
38
  observer.observe(targetNode, config)
36
- })
39
+ }
40
+
41
+ // document.addEventListener('turbo:before-stream-render', function () { console.log('turbo:before-stream-render') })
42
+ // document.addEventListener('turbo:render', function () { console.log('turbo:render') })
43
+ // document.addEventListener('turbo:before-render', function () { console.log('turbo:before-render') })
44
+ // document.addEventListener('turbo:before-frame-render', function () { console.log('turbo:before-frame-render') })
45
+ // document.addEventListener('turbo:frame-load', function () { console.log('turbo:frame-load') })
46
+ // document.addEventListener('turbo:before-fetch-request', function () { console.log('turbo:before-fetch-request') })
47
+ // document.addEventListener('turbo:fetch-request-error', function () { console.log('turbo:fetch-request-error') })
@@ -35,3 +35,9 @@
35
35
  <div><%= t(".unhappy") %> <%= button_to t(".cancel_my_account"), registration_path(resource_name), data: { confirm: t(".are_you_sure"), turbo_confirm: t(".are_you_sure") }, method: :delete %></div>
36
36
 
37
37
  <%= link_to t("devise.shared.links.back"), :back %>
38
+
39
+ <style type="text/css" media="screen">
40
+ form {
41
+ max-width: 22em;
42
+ }
43
+ </style>
@@ -1,26 +1,28 @@
1
1
  <h2><%= t(".sign_up") %></h2>
2
+ <div id="form-signup" data-controller="pg_form">
3
+ <%= pg_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
+ <%= f.mensajes_de_error %>
2
5
 
3
- <%= pg_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4
- <%= f.mensajes_de_error %>
6
+ <div class="form-inputs">
7
+ <%= f.input :nombre, required: true, autofocus: true %>
8
+ <%= f.input :apellido, required: true %>
9
+ <%= f.input :email,
10
+ required: true,
11
+ input_html: { autocomplete: "email" }%>
12
+ <%= f.input :password,
13
+ required: true,
14
+ hint: (t('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
15
+ input_html: { autocomplete: "new-password" } %>
16
+ <%= f.input :password_confirmation,
17
+ required: true,
18
+ input_html: { autocomplete: "new-password" } %>
19
+ </div>
5
20
 
6
- <div class="form-inputs">
7
- <%= f.input :nombre, required: true, autofocus: true %>
8
- <%= f.input :apellido, required: true %>
9
- <%= f.input :email,
10
- required: true,
11
- input_html: { autocomplete: "email" }%>
12
- <%= f.input :password,
13
- required: true,
14
- hint: (t('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
15
- input_html: { autocomplete: "new-password" } %>
16
- <%= f.input :password_confirmation,
17
- required: true,
18
- input_html: { autocomplete: "new-password" } %>
19
- </div>
21
+ <div class="form-actions">
22
+ <%= f.button :submit, t(".sign_up") %>
23
+ </div>
24
+ <% end %>
20
25
 
21
- <div class="form-actions">
22
- <%= f.button :submit, t(".sign_up") %>
23
- </div>
24
- <% end %>
26
+ <%= render "devise/shared/links" %>
27
+ </div>
25
28
 
26
- <%= render "devise/shared/links" %>
@@ -9,7 +9,8 @@
9
9
  <%= f.input :password,
10
10
  required: false,
11
11
  input_html: { autocomplete: "current-password" } %>
12
- <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
12
+ <%# TODO!: corregir style de checkbox %>
13
+ <%#= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
13
14
  </div>
14
15
 
15
16
  <div class="form-actions">
@@ -1,25 +1,36 @@
1
- <%- if controller_name != 'sessions' %>
2
- <%= link_to t(".sign_in"), new_session_path(resource_name) %><br />
3
- <% end %>
1
+ <div class="devise-links">
2
+ <%- if controller_name != 'sessions' %>
3
+ <%= link_to t(".sign_in"), new_session_path(resource_name) %>
4
+ <% end %>
4
5
 
5
- <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to t(".sign_up"), new_registration_path(resource_name) %><br />
7
- <% end %>
6
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
+ <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
8
+ <% end %>
8
9
 
9
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
- <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %><br />
11
- <% end %>
10
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11
+ <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
12
+ <% end %>
12
13
 
13
- <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %><br />
15
- <% end %>
14
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
+ <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
16
+ <% end %>
16
17
 
17
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %><br />
19
- <% end %>
18
+ <%- if false # devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19
+ <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %>
20
+ <% end %>
20
21
 
21
- <%- if devise_mapping.omniauthable? %>
22
- <%- resource_class.omniauth_providers.each do |provider| %>
23
- <%= button_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
22
+ <%- if devise_mapping.omniauthable? %>
23
+ <%- resource_class.omniauth_providers.each do |provider| %>
24
+ <%= button_to t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
25
+ <% end %>
24
26
  <% end %>
25
- <% end %>
27
+ </div>
28
+ <style type="text/css">
29
+ .devise-links {
30
+ margin-top: 3em;
31
+ }
32
+ .devise-links a {
33
+ display: block;
34
+ margin-top: 1em;
35
+ }
36
+ </style>
@@ -37,6 +37,6 @@ html
37
37
  = yield(:actions)
38
38
  hr.my-0
39
39
  = render partial: 'pg_layout/flash_alert'
40
- = yield
40
+ = content_for?(:content) ? yield(:content) : yield
41
41
  div style="width:100%; height: 10em"
42
42
  = render_turbo_stream_title
@@ -0,0 +1,5 @@
1
+ - content_for :content do
2
+ .container-fluid.pt-3
3
+ = content_for?(:containerized_content) ? yield(:containerized_content) : yield
4
+
5
+ = render template: 'layouts/pg_layout/base'
@@ -1,25 +1,11 @@
1
- doctype html
2
- html
3
- head
4
- title = Rails.application.class.module_parent_name
5
- meta name="viewport" content="width=device-width,initial-scale=1"
6
- = csrf_meta_tags
7
- = csp_meta_tag
8
- meta name="cable-history-timestamp" content="#{Time.now.to_i}"
9
- = action_cable_with_jwt_meta_tag
10
- = stylesheet_link_tag 'application', 'data-turbo-track': 'reload'
11
- = javascript_include_tag 'application', 'data-turbo-track': 'reload', type: 'module'
12
- body
13
- div
14
- .text-center
15
- #flash.flash.d-inline-block
16
- = render partial: 'pg_layout/flash'
17
- .container.text-center
18
- = yield
19
- = render_turbo_stream_title
1
+ - content_for :content do
2
+ .container.text-center
3
+ = yield
20
4
 
21
- css:
22
- .pg-form {
23
- max-width: 22em;
24
- margin: auto;
25
- }
5
+ css:
6
+ .pg-form {
7
+ max-width: 30em;
8
+ margin: auto;
9
+ }
10
+
11
+ = render template: 'layouts/pg_layout/base'
@@ -8,6 +8,5 @@
8
8
  - flash_to_show.each do |flash_type, message|
9
9
  .toast(class="bg-#{flash_type_to_class(flash_type)}-subtle" role="alert" data-bs-autohide="true"
10
10
  data-xturbo-temporary="true" aria-live="assertive" aria-atomic="true")
11
- .toast-body
11
+ .toast-body.text-center
12
12
  = message
13
- / TODO: centrar texto
@@ -31,7 +31,7 @@
31
31
  <% end %>
32
32
 
33
33
  <li>
34
- <%= link_to "Cerrar sesión", destroy_user_session_path, data: { 'turbo-method': 'delete' }, class: 'dropdown-item' %>
34
+ <%= link_to t("devise.shared.links.sign_out"), destroy_user_session_path, data: { 'turbo-method': 'delete' }, class: 'dropdown-item' %>
35
35
  </li>
36
36
  </ul>
37
37
  </li>
@@ -47,11 +47,14 @@
47
47
 
48
48
  <% else %>
49
49
  <li class="nav-item">
50
- <%= link_to 'ingresar', new_user_session_path, class: 'nav-link' %>
50
+ <%= link_to t("devise.shared.links.sign_in"), new_user_session_path, class: 'nav-link' %>
51
+ </li>
52
+ <li class="nav-item">
53
+ <%= link_to t("devise.shared.links.sign_up"), new_user_registration_path, class: 'nav-link' %>
51
54
  </li>
52
55
  <% end %>
53
56
  </ul>
54
- <%= content_for :navbar_ext %>
57
+ <%= @navbar_ext %>
55
58
 
56
59
  </div>
57
60
  </div>
@@ -1,11 +1,11 @@
1
- <% if Rails.application.credentials.rollbar.present? %>
1
+ <% if Rollbar.configuration.enabled && Rails.application.credentials.rollbar.present? %>
2
2
  <script>
3
3
  var _rollbarConfig = {
4
4
  accessToken: '<%= Rails.application.credentials.rollbar.access_token_client %>',
5
5
  captureUncaught: true,
6
6
  captureUnhandledRejections: true,
7
7
  payload: {
8
- environment: "production",
8
+ environment: <%= Rails.env %>,
9
9
  //trace_id: 'abc',
10
10
  client: {
11
11
  javascript: {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.21'
4
+ VERSION = '7.0.8-alpha.23'
5
5
  end
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.0.8.pre.alpha.21
4
+ version: 7.0.8.pre.alpha.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-03-31 00:00:00.000000000 Z
11
+ date: 2024-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails goodies.
14
14
  email:
@@ -46,6 +46,7 @@ files:
46
46
  - pg_engine/app/controllers/pg_engine/base_controller.rb
47
47
  - pg_engine/app/controllers/pg_engine/devise_controller.rb
48
48
  - pg_engine/app/controllers/pg_engine/require_sign_in.rb
49
+ - pg_engine/app/controllers/users/confirmations_controller.rb
49
50
  - pg_engine/app/controllers/users/registrations_controller.rb
50
51
  - pg_engine/app/decorators/account_decorator.rb
51
52
  - pg_engine/app/decorators/pg_engine/base_decorator.rb
@@ -125,6 +126,7 @@ files:
125
126
  - pg_engine/spec/controllers/admin/users_controller_spec.rb
126
127
  - pg_engine/spec/controllers/concerns/pg_engine/resource_helper_spec.rb
127
128
  - pg_engine/spec/controllers/devise/sessions_controller_spec.rb
129
+ - pg_engine/spec/controllers/users/confirmations_controller_spec.rb
128
130
  - pg_engine/spec/controllers/users/registrations_controller_spec.rb
129
131
  - pg_engine/spec/factories/accounts.rb
130
132
  - pg_engine/spec/factories/user_accounts.rb
@@ -176,8 +178,9 @@ files:
176
178
  - pg_layout/app/views/kaminari/_page.html.slim
177
179
  - pg_layout/app/views/kaminari/_paginator.html.slim
178
180
  - pg_layout/app/views/kaminari/_prev_page.html.slim
181
+ - pg_layout/app/views/layouts/pg_layout/base.html.slim
182
+ - pg_layout/app/views/layouts/pg_layout/containerized.html.slim
179
183
  - pg_layout/app/views/layouts/pg_layout/devise.html.slim
180
- - pg_layout/app/views/layouts/pg_layout/layout.html.slim
181
184
  - pg_layout/app/views/pg_layout/_flash.html.slim
182
185
  - pg_layout/app/views/pg_layout/_flash_alert.html.slim
183
186
  - pg_layout/app/views/pg_layout/_navbar.html.erb