pg_rails 7.0.8.pre.alpha → 7.0.8.pre.alpha.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/pg_associable/app/assets/stylesheets/pg_associable.scss +39 -40
  4. data/pg_associable/app/helpers/pg_associable/form_builder_methods.rb +45 -1
  5. data/pg_associable/app/helpers/pg_associable/helpers.rb +6 -4
  6. data/pg_associable/app/javascript/asociable_controller.tsx +96 -20
  7. data/pg_associable/app/javascript/modal_controller.js +4 -95
  8. data/pg_associable/app/views/pg_associable/_resultados_inline.html.slim +6 -8
  9. data/pg_associable/app/views/pg_engine/base/_pg_associable_modal.html.slim +5 -32
  10. data/pg_engine/app/assets/stylesheets/pg_rails_b5.scss +49 -41
  11. data/pg_engine/app/controllers/pg_engine/resource_helper.rb +6 -2
  12. data/pg_engine/app/decorators/pg_engine/base_decorator.rb +2 -2
  13. data/pg_engine/app/helpers/pg_engine/flash_helper.rb +2 -2
  14. data/pg_engine/app/helpers/pg_engine/form_helper.rb +70 -0
  15. data/pg_engine/app/helpers/pg_engine/route_helper.rb +14 -6
  16. data/pg_engine/app/views/admin/accounts/_form.html.slim +1 -1
  17. data/pg_engine/app/views/admin/user_accounts/_form.html.slim +1 -1
  18. data/pg_engine/app/views/admin/users/_form.html.slim +1 -1
  19. data/pg_engine/app/views/pg_engine/base/index.html.slim +3 -3
  20. data/pg_engine/config/simple_form/simple_form_bootstrap.rb +17 -9
  21. data/pg_engine/db/migrate/20240222115722_create_active_storage_tables.active_storage.rb +57 -0
  22. data/pg_engine/lib/pg_engine/engine.rb +1 -1
  23. data/pg_engine/lib/pg_engine/route_helpers.rb +1 -0
  24. data/pg_engine/lib/pg_engine/utils/pdf_preview_generator.rb +50 -0
  25. data/pg_engine/lib/pg_engine.rb +3 -0
  26. data/pg_engine/spec/fixtures/test.pdf +0 -0
  27. data/pg_engine/spec/pg_engine/pdf_preview_generator_spec.rb +12 -0
  28. data/pg_layout/app/assets/stylesheets/sidebar.scss +10 -2
  29. data/pg_layout/app/javascript/nested_controller.js +48 -0
  30. data/pg_layout/app/javascript/pg_form_controller.js +13 -0
  31. data/pg_layout/app/javascript/utils.ts +34 -0
  32. data/pg_layout/app/views/layouts/pg_layout/devise.html.slim +1 -1
  33. data/pg_layout/app/views/layouts/pg_layout/layout.html.slim +14 -11
  34. data/pg_layout/app/views/pg_layout/_flash.html.slim +1 -1
  35. data/pg_layout/app/views/pg_layout/_navbar.html.erb +10 -0
  36. data/pg_layout/app/views/pg_layout/_sidebar.html.erb +3 -3
  37. data/pg_layout/index.js +4 -0
  38. data/pg_rails/lib/version.rb +1 -1
  39. data/pg_scaffold/lib/generators/pg_slim/templates/_form.html.slim +2 -2
  40. metadata +9 -3
  41. data/pg_associable/app/views/pg_associable/_resultados.html.slim +0 -11
@@ -3,7 +3,11 @@ html
3
3
  head
4
4
  title = Rails.application.class.module_parent_name
5
5
  meta name="viewport" content="width=device-width,initial-scale=1"
6
- meta name="turbo-cache-control" content="no-cache"
6
+ / meta name="turbo-cache-control" content="no-cache"
7
+ / meta name="turbo-refresh-method" content="morph"
8
+ / meta name="turbo-refresh-scroll" content="preserve"
9
+ / meta name="turbo-prefetch" content="true"
10
+ meta name="view-transition" content="same-origin"
7
11
  = csrf_meta_tags
8
12
  = csp_meta_tag
9
13
 
@@ -13,19 +17,18 @@ html
13
17
  .with-sidebar
14
18
  = render partial: 'pg_layout/sidebar'
15
19
  div
20
+ .position-relative.d-flex.justify-content-around
21
+ #flash.flash.position-absolute.z-1.mt-1
22
+ = render partial: 'pg_layout/flash'
16
23
  = render partial: 'pg_layout/navbar'
17
24
  div
18
- .text-center
19
- #flash.flash.d-inline-block
20
- = render partial: 'pg_layout/flash'
21
25
  - if user_signed_in?
22
- .d-flex.px-3.align-items-center.justify-content-between.d-print-none
23
- div
24
- / <!-- <h1 class="h3 mb-0 text-gray-800"><%= content_for(:title) %></h1> -->
25
- nav aria-label="breadcrumb"
26
- = render_breadcrumbs
27
- / = render_breadcrumbs builder: ::Bootstrap4BreadcrumbsBuilder
28
- .btn-toolbar.py-2
26
+ .d-flex.align-items-center.justify-content-between.px-3.py-1.d-print-none[
27
+ style="min-height: 2.5em;"]
28
+ nav aria-label="breadcrumb"
29
+ = render_breadcrumbs
30
+ / = render_breadcrumbs builder: ::Bootstrap4BreadcrumbsBuilder
31
+ .btn-toolbar
29
32
  = yield(:actions)
30
33
  hr.my-0
31
34
  = yield
@@ -4,7 +4,7 @@
4
4
  / slim-lint:enable LineLength
5
5
 
6
6
  - flash_to_show.each do |flash_type, message|
7
- .toast(class="bg-#{flash_type_to_class(flash_type)}-subtle" role="alert"
7
+ .toast(class="bg-#{flash_type_to_class(flash_type)}-subtle" role="alert" data-bs-autohide="true"
8
8
  data-turbo-temporary="true" aria-live="assertive" aria-atomic="true")
9
9
  .toast-body
10
10
  = message
@@ -24,6 +24,16 @@
24
24
  </li>
25
25
  </ul>
26
26
  </li>
27
+ <% @navbar.sidebar.each do |entry| %>
28
+ <% next if @navbar.hide_entry?(entry) %>
29
+ <% random_id = rand(99999).to_s %>
30
+ <li class="nav-item d-md-none">
31
+ <a class="nav-link" href="<%= entry[:path] %>" role="button">
32
+ <%= entry[:title] %>
33
+ </a>
34
+ </li>
35
+ <% end %>
36
+
27
37
  <% else %>
28
38
  <li class="nav-item">
29
39
  <%= link_to 'ingresar', new_user_session_path, class: 'nav-link' %>
@@ -1,8 +1,8 @@
1
1
  <div id="sidebar" class="<%= @navbar_opened_class %> flex-shrink-0 bg-gradient d-none d-<%= @breakpoint_navbar_expand %>-block">
2
2
  <% if user_signed_in? %>
3
- <div class="sidebar--large-items" style="position:fixed">
3
+ <div class="sidebar--large-items">
4
4
  <hr>
5
- <div class="sidebar--small-items">
5
+ <%# <div class="sidebar--small-items">
6
6
  <ul class="list-unstyled ps-0">
7
7
  <li class="mb-1 text-center">
8
8
  <a href="javascript:void(0)" class="nav-link" data-bs-toggle="tooltip" data-bs-title="Agenda">
@@ -10,7 +10,7 @@
10
10
  </a>
11
11
  </li>
12
12
  </ul>
13
- </div>
13
+ </div> %>
14
14
  <div class="sidebar--large-items">
15
15
  <ul class="list-unstyled ps-0">
16
16
  <% @navbar.sidebar.each do |entry| %>
data/pg_layout/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  // Controllers
2
2
  import NavbarController from './app/javascript/navbar_controller'
3
+ import NestedController from './app/javascript/nested_controller'
4
+ import PgFormController from './app/javascript/pg_form_controller'
3
5
  // Bootstrap's toasts
4
6
  import * as bootstrap from 'bootstrap'
5
7
 
6
8
  window.Stimulus.register('navbar', NavbarController)
9
+ window.Stimulus.register('nested', NestedController)
10
+ window.Stimulus.register('pg_form', PgFormController)
7
11
 
8
12
  document.addEventListener('turbo:load', function () {
9
13
  const toastElList = document.querySelectorAll('.toast:not(.hide):not(.show)')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha'
4
+ VERSION = '7.0.8-alpha.6'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  / # locals: (object: nil, asociable: false)
2
2
 
3
- div style="max-width: 300px"
4
- = pg_form_for(@<%= singular_name %> || object) do |f|
3
+ div style="max-width: 22em" data-controller="pg_form"
4
+ = pg_form_for(@<%= singular_name %> || object, asociable:)) do |f|
5
5
  = f.mensajes_de_error
6
6
 
7
7
  = hidden_field_tag :asociable, true if asociable
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
4
+ version: 7.0.8.pre.alpha.6
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-02-19 00:00:00.000000000 Z
11
+ date: 2024-02-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails goodies.
14
14
  email:
@@ -25,7 +25,6 @@ files:
25
25
  - pg_associable/app/inputs/pg_associable_input.rb
26
26
  - pg_associable/app/javascript/asociable_controller.tsx
27
27
  - pg_associable/app/javascript/modal_controller.js
28
- - pg_associable/app/views/pg_associable/_resultados.html.slim
29
28
  - pg_associable/app/views/pg_associable/_resultados_inline.html.slim
30
29
  - pg_associable/app/views/pg_engine/base/_pg_associable_modal.html.slim
31
30
  - pg_associable/index.js
@@ -98,12 +97,14 @@ files:
98
97
  - pg_engine/db/migrate/20240210025702_create_active_admin_comments.rb
99
98
  - pg_engine/db/migrate/20240211152951_create_accounts.rb
100
99
  - pg_engine/db/migrate/20240211153049_create_user_accounts.rb
100
+ - pg_engine/db/migrate/20240222115722_create_active_storage_tables.active_storage.rb
101
101
  - pg_engine/db/seeds.rb
102
102
  - pg_engine/lib/pg_engine.rb
103
103
  - pg_engine/lib/pg_engine/configuracion.rb
104
104
  - pg_engine/lib/pg_engine/core_ext.rb
105
105
  - pg_engine/lib/pg_engine/engine.rb
106
106
  - pg_engine/lib/pg_engine/route_helpers.rb
107
+ - pg_engine/lib/pg_engine/utils/pdf_preview_generator.rb
107
108
  - pg_engine/lib/pg_engine/utils/pg_logger.rb
108
109
  - pg_engine/lib/tasks/auto_anotar_modelos.rake
109
110
  - pg_engine/spec/controllers/admin/accounts_controller_spec.rb
@@ -112,12 +113,17 @@ files:
112
113
  - pg_engine/spec/factories/accounts.rb
113
114
  - pg_engine/spec/factories/user_accounts.rb
114
115
  - pg_engine/spec/factories/users.rb
116
+ - pg_engine/spec/fixtures/test.pdf
115
117
  - pg_engine/spec/models/account_spec.rb
116
118
  - pg_engine/spec/models/user_account_spec.rb
117
119
  - pg_engine/spec/models/user_spec.rb
120
+ - pg_engine/spec/pg_engine/pdf_preview_generator_spec.rb
118
121
  - pg_layout/app/assets/stylesheets/sidebar.scss
119
122
  - pg_layout/app/javascript/cookies.js
120
123
  - pg_layout/app/javascript/navbar_controller.js
124
+ - pg_layout/app/javascript/nested_controller.js
125
+ - pg_layout/app/javascript/pg_form_controller.js
126
+ - pg_layout/app/javascript/utils.ts
121
127
  - pg_layout/app/lib/navbar.rb
122
128
  - pg_layout/app/views/devise/confirmations/new.html.erb
123
129
  - pg_layout/app/views/devise/mailer/confirmation_instructions.html.erb
@@ -1,11 +0,0 @@
1
- .resultados tabindex="-1"
2
- - if collection.any?
3
- .list-group.list-group-flush
4
- - collection.each do |object|
5
- = link_to object.to_s, 'javascript:void(0)',
6
- class: 'list-group-item',
7
- data: { action: 'modal#selectItem', id: object.id, \
8
- object: object.decorate.to_json }
9
- - else
10
- ul.list-group.list-group-flush
11
- li.list-group-item No hay resultados para "#{params[:query]}"