pg_rails 7.6.39 → 7.6.41

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2de59469aa32c2ef73f030ea848179b8941f67a1eb948b72b018cf2d9e7b1b95
4
- data.tar.gz: 4311903fb7f15aa7b070e2ac36ff530bc6e4a7750ac011a7843d34a85921483e
3
+ metadata.gz: 64c0c348910ec6e2795eebf4add22342e4f99c1e0a190a9a8f37299b542c5804
4
+ data.tar.gz: d128c7801a01c1beb02c52c3033b90128a6a33e2a93737972f4475a18e7d0112
5
5
  SHA512:
6
- metadata.gz: 37288f9d151624cb72e6c7567e6fdb875d91b5945baf3d66e045c640fa500d3ff3f1a90cbd6bd76aa898562c0c6b8f9d09aceddd287975f456af068b3310cee3
7
- data.tar.gz: 63d8f3e1d03d521db97cae73cde5908342bbcd9dc44913289f516ee0c932b63fcdb6e626ed6a575556f04b651315293f7315b5d0e1ed69471f750dfa14fc2375
6
+ metadata.gz: 1561850b970f4c782facbdca1169edda0264795e3f67c7be1525a08bd4bb6405b2b43e57b54ba5d0e24d62423185b205f3e9491b98559da444515aa9e79d6a10
7
+ data.tar.gz: e57dfba1fbbe3adbbcf8019807bfd5cdddc3fc7a97a2081e381ab369ebf7b8c35cda2fcd97fa22af64c030140c5c51caa4fb257444fa4d662dbc4d2a85a6449c
@@ -23,7 +23,11 @@ $values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100;
23
23
  }
24
24
 
25
25
  // Table row clickable (bindListingClick)
26
- .listado tr:has(td:hover):has(.bi-eye-fill):not(:has(.actions-wrapper:hover)):not(:has(a:hover)):not(:has(.inline-edit:hover)) td {
26
+ .listado tr:has(td:hover):has(.bi-eye-fill):not(:has(.actions-wrapper:hover)):not(:has(a:hover)):not(:has(.inline-edit:hover)):not(:has(.inline-no-edit:hover)) td {
27
+ background-color: #f2f2f2;
28
+ cursor: pointer;
29
+ }
30
+ .listado tr:has(td:hover):has(.main-row-link):not(:has(.actions-wrapper:hover)):not(:has(a:hover)):not(:has(.inline-edit:hover)):not(:has(.inline-no-edit:hover)) td {
27
31
  background-color: #f2f2f2;
28
32
  cursor: pointer;
29
33
  }
@@ -14,4 +14,5 @@
14
14
  i.bi.bi-pencil
15
15
  span = @model.decorate.send(@attribute)
16
16
  - else
17
- = @model.decorate.send(@attribute)
17
+ span.inline-no-edit
18
+ = @model.decorate.send(@attribute)
@@ -75,7 +75,7 @@ module Users
75
75
  end
76
76
 
77
77
  def atributos_para_listar
78
- %i[nombre owner]
78
+ %i[logo_f nombre owner]
79
79
  end
80
80
  end
81
81
  end
@@ -33,4 +33,12 @@ class AccountDecorator < PgEngine::BaseRecordDecorator
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ def logo_f
38
+ if logo.present?
39
+ image_tag logo.variant(:thumb), style: 'max-height:3em'
40
+ else
41
+ content_tag 'i', nil, class: 'bi bi-bag-fill text-center d-inline-block', style: 'font-size: 1.7em; width: 1.6em'
42
+ end
43
+ end
36
44
  end
@@ -15,7 +15,7 @@ class UserAccountDecorator < PgEngine::BaseRecordDecorator
15
15
  helpers.content_tag :span do
16
16
  h.link_to h.tenant_root_path(tid: object.to_param),
17
17
  'data-turbo-frame': :_top,
18
- class: 'btn btn-sm btn-primary' do
18
+ class: 'btn btn-sm btn-primary main-row-link' do
19
19
  '<i class="bi bi-box-arrow-in-right"></i> Ingresar'.html_safe
20
20
  end
21
21
  end
@@ -53,6 +53,8 @@
53
53
  tr
54
54
  th
55
55
  - atributos_para_listar.each do |att|
56
+ / TODO: poder configurar el ordenable en false
57
+ / Sería ideal hacer algo OOP, pero es medio bardo
56
58
  th.text-nowrap style="font-size: 0.8em" = encabezado att, ordenable: true
57
59
  - if action_name == 'archived'
58
60
  th.text-nowrap style="font-size: 0.8em" = encabezado :discarded_at, ordenable: true
@@ -1,4 +1,10 @@
1
1
  - content_for(:container_class) { 'container border p-0 my-3' }
2
2
  - content_for(:container_style) { 'max-width: 50em; xborder-left: 1px solid grey' }
3
+ - content_for(:padding_top_class) { 'pt-0' }
3
4
 
4
5
  = render template: 'pg_engine/base/index'
6
+
7
+ css:
8
+ .listado {
9
+ vertical-align: middle;
10
+ }
@@ -5,7 +5,7 @@
5
5
  .text-center
6
6
  .d-flex.justify-content-center.gap-2.align-items-center.m-3
7
7
  - if @account.logo.present?
8
- = image_tag @account.logo, style: 'max-height:3em'
8
+ = image_tag @account.logo.variant(:thumb), style: 'max-height:3em'
9
9
  .fs-1
10
10
  = @account
11
11
 
@@ -187,6 +187,8 @@ es:
187
187
  attributes:
188
188
  account:
189
189
  owner: Administrado por
190
+ logo/scoped:
191
+ listado_header: ""
190
192
  user_account:
191
193
  membership_status: Estado
192
194
  user: Nombre
@@ -54,13 +54,16 @@ $chevron-color: 200,200,200,.5;
54
54
 
55
55
  .navbar__nav-button[aria-expanded=true] {
56
56
  font-weight: bold;
57
+ background-color: tint-color($primary, 5%);
57
58
  }
58
59
 
59
60
  // Child entries
60
- #sidebar .collapse-inner {
61
- background-color: tint-color($primary, 5%);
62
- padding-bottom: 0.1em;
63
- padding-top: 0.1em;
61
+ #sidebar, .offcanvas {
62
+ .collapse-inner {
63
+ background-color: tint-color($primary, 5%);
64
+ padding-bottom: 0.1em;
65
+ padding-top: 0.1em;
66
+ }
64
67
  }
65
68
 
66
69
  // Los small-items están deprecados
@@ -11,14 +11,20 @@ function bindListingClick () {
11
11
  document.body.onclick = (ev) => {
12
12
  if (ev.target.closest('a')) return
13
13
  if (ev.target.closest('.inline-edit')) return
14
+ if (ev.target.closest('.inline-no-edit')) return
14
15
  if (ev.target.closest('.listado')) {
15
16
  const row = ev.target.closest('tr')
16
17
  if (row) {
17
- const show = row.querySelector('.bi-eye-fill')
18
- if (show) {
19
- const link = show.closest('a')
20
- if (link) {
21
- link.click()
18
+ const mainRowLink = row.querySelector('.main-row-link')
19
+ if (mainRowLink) {
20
+ mainRowLink.click()
21
+ } else {
22
+ const show = row.querySelector('.bi-eye-fill')
23
+ if (show) {
24
+ const link = show.closest('a')
25
+ if (link) {
26
+ link.click()
27
+ }
22
28
  }
23
29
  }
24
30
  }
@@ -77,7 +77,6 @@ class Navbar
77
77
 
78
78
  def any_children_active?(entry, request)
79
79
  entry[:children].any? { |child| active_entry?(child, request) }
80
- # TODO: quitar
81
80
  end
82
81
 
83
82
  def hide_entry?(entry)
@@ -1,6 +1,8 @@
1
1
  - content_for :content do
2
2
  - klass = modal_targeted? ? '' : (yield(:container_class).presence || 'container-fluid')
3
- div class="pt-3 #{klass}" style=yield(:container_style)
3
+ - padding_top_class = yield(:padding_top_class).presence || 'pt-3'
4
+
5
+ div class="#{padding_top_class} #{klass}" style=yield(:container_style)
4
6
  = content_for?(:containerized_content) ? yield(:containerized_content) : yield
5
7
 
6
8
  = render template: 'layouts/pg_layout/base'
@@ -5,18 +5,19 @@ div id="sidebar" class="#{@navbar_opened_class} flex-shrink-0 d-none d-#{@breakp
5
5
  ul.list-unstyled.ps-0.mt-5
6
6
  - @navbar.sidebar.each do |entry|
7
7
  - next if @navbar.hide_entry?(entry)
8
+ - active = @navbar.active_entry?(entry, request)
8
9
  li.mb-1
9
10
  - if entry[:children].present?
10
11
  - entry_id = "nav-entry-#{entry[:orig_idx]}"
11
- - active = @navbar.active_entry?(entry, request)
12
12
  a class="d-inline-flex text-decoration-none navbar__nav-button #{ active ? '' : 'collapsed'} #{entry[:attributes]}" data-bs-toggle="collapse" href="##{entry_id}" role="button" aria-expanded="#{ active ? 'true' : 'false'}" aria-controls=entry_id
13
13
  = entry[:title]
14
14
  - if active
15
- span.bi.bi-chevron-down.ms-1 style="font-size: 0.7em"
15
+ span.bi.bi-chevron-down.ms-1.align-text-bottom style="font-size: 0.7em"
16
16
  - else
17
- span.bi.bi-chevron-right.ms-1 style="font-size: 0.7em"
17
+ span.bi.bi-chevron-right.ms-1.align-text-bottom style="font-size: 0.7em"
18
18
 
19
- .collapse data-turbo-temporary=('true' unless @navbar.active_entry?(entry, request)) class="#{ 'show' if @navbar.active_entry?(entry, request)}" id=entry_id
19
+ / data-turbo-temporary=('true' unless active)
20
+ .collapse class="#{ 'show' if active}" id=entry_id
20
21
  .collapse-inner
21
22
  - entry[:children].each do |child|
22
23
  - next if @navbar.hide_entry?(child)
@@ -24,5 +25,5 @@ div id="sidebar" class="#{@navbar_opened_class} flex-shrink-0 d-none d-#{@breakp
24
25
  a href=child[:path] class="d-inline-flex text-decoration-none navbar__nav-button #{@navbar.active_entry?(child, request) ? 'active' : ''} #{child[:attributes]}"
25
26
  = child[:title]
26
27
  - else
27
- a href=entry[:path] class="d-inline-flex text-decoration-none navbar__nav-button #{@navbar.active_entry?(entry, request) ? 'active' : ''} #{entry[:attributes]}"
28
+ a href=entry[:path] class="d-inline-flex text-decoration-none navbar__nav-button #{active ? 'active' : ''} #{entry[:attributes]}"
28
29
  = entry[:title]
@@ -9,9 +9,29 @@
9
9
  ul.list-unstyled.mt-4
10
10
  - @navbar.sidebar.each do |entry|
11
11
  - next if @navbar.hide_entry?(entry)
12
+ - active = @navbar.active_entry?(entry, request)
12
13
  li
13
- a href=entry[:path] class="navbar__nav-button pe-4 text-light #{@navbar.active_entry?(entry, request) ? 'active' : ''} #{entry[:attributes]}"
14
- = entry[:title]
14
+ - if entry[:children].present?
15
+ - entry_id = "nav-entry-#{entry[:orig_idx]}"
16
+
17
+ a class="d-inline-flex text-decoration-none navbar__nav-button text-light #{ active ? '' : 'collapsed'} #{entry[:attributes]}" data-bs-toggle="collapse" href="##{entry_id}" role="button" aria-expanded="#{ active ? 'true' : 'false'}" aria-controls=entry_id
18
+ = entry[:title]
19
+ - if active
20
+ span.bi.bi-chevron-down.ms-1.align-text-bottom style="font-size: 0.7em"
21
+ - else
22
+ span.bi.bi-chevron-right.ms-1.align-text-bottom style="font-size: 0.7em"
23
+
24
+ / data-turbo-temporary=('true' unless active)
25
+ .collapse class="#{ 'show' if active}" id=entry_id
26
+ .collapse-inner
27
+ - entry[:children].each do |child|
28
+ - next if @navbar.hide_entry?(child)
29
+ .mb-1
30
+ a href=child[:path] class="d-inline-flex text-decoration-none navbar__nav-button text-light #{@navbar.active_entry?(child, request) ? 'active' : ''} #{child[:attributes]}"
31
+ = child[:title]
32
+ - else
33
+ a href=entry[:path] class="navbar__nav-button pe-4 text-light #{active ? 'active' : ''} #{entry[:attributes]}"
34
+ = entry[:title]
15
35
  css:
16
36
  .offcanvas a { text-decoration: none; }
17
37
  .offcanvas li { xmargin-top: 0.75em; }
@@ -15,7 +15,13 @@ ul.navbar-nav.gap-3.align-items-center class="gap-#{@breakpoint_navbar_expand}-0
15
15
  - if @other_active_accounts&.any?
16
16
  h6.dropdown-header Cambiar a:
17
17
  - @other_active_accounts.each do |ua|
18
- li = link_to ua.account, tenant_root_path(tid: ua.to_param), class: 'dropdown-item'
18
+ li
19
+ = link_to tenant_root_path(tid: ua.to_param), class: 'dropdown-item' do
20
+ - if ua.account.logo.present?
21
+ span = image_tag ua.account.logo.variant(:thumb), class: 'rounded-circle border border-2 me-2', width: 40, height: 40
22
+ - else
23
+ i.bi.bi-bag-fill.me-2.d-inline-block.text-center style="font-size: 1.7em; width: 1.6em"
24
+ span = ua.account
19
25
  li
20
26
  hr.dropdown-divider
21
27
  li = link_to "Administrar #{Account.nombre_plural.downcase}", users_accounts_path(tid: nil), class: 'dropdown-item'
@@ -27,7 +33,11 @@ ul.navbar-nav.gap-3.align-items-center class="gap-#{@breakpoint_navbar_expand}-0
27
33
  = Account.nombre_plural
28
34
  ul.dropdown-menu
29
35
  - @other_active_accounts.each do |ua|
30
- li = link_to ua.account, tenant_root_path(tid: ua.to_param), class: 'dropdown-item'
36
+ li
37
+ = link_to tenant_root_path(tid: ua.to_param), class: 'dropdown-item' do
38
+ - if ua.account.logo.present?
39
+ span = image_tag ua.account.logo.variant(:thumb), class: 'rounded-circle border border-2 me-2', width: 40, height: 40
40
+ span = ua.account
31
41
  li
32
42
  hr.dropdown-divider
33
43
  li = link_to "Administrar #{Account.nombre_plural.downcase}", users_accounts_path(tid: nil), class: 'dropdown-item'
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module PgRails
5
- VERSION = '7.6.39'
5
+ VERSION = '7.6.41'
6
6
  end
7
7
  # :nocov:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.39
4
+ version: 7.6.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso