lato_cms 3.3.1 → 3.3.2

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: 9a5b87d2c477cafb579b7ceea01c41e72071b3a789f425e184acbe99592f63ab
4
- data.tar.gz: 123893a3b2a7c226c4910f41ab931b5bf7fd28b30b883293d811e6fc439d0155
3
+ metadata.gz: e39b95b3bcd7038dad5c229ad58e5039cbba9f87797e1c153c04127c55929a10
4
+ data.tar.gz: 50f97a9ad2c97a2f666677862886246239569006c31a29931c0982c04bf1b793
5
5
  SHA512:
6
- metadata.gz: 23968a738f1d1295e172d546617950e2b49c900b45ac6399080a01380c97ae7ebba48414277c58565205f8229dd758b798a286a3dfb6eac55d3c1091258fad12
7
- data.tar.gz: 0a3d712b435da91e70a4a90edd8cefad81fa8105dface4946c4776490b920d3f2259c4857619d99af374e84b181aea38bc0524b2df1ef6f22532f80a141d16c5
6
+ metadata.gz: 515fa7907877c2c2bf947cbd9c25a6a63995d3dfa0c4d24af5107f59c1b0f2affbac40363f48876cef825a756a1d7088465efda2cef24919aee59c05a380580a
7
+ data.tar.gz: e06fe86049de921b9c37771dca89631bf2de9047e923bcbcf6cbedc775a663431ddc602ad5d8533d28d32cdf2e8abe3a226417a6513d1044f0106085c97e18cf
@@ -11,7 +11,10 @@ module LatoCms
11
11
  end
12
12
 
13
13
  def show
14
- @page.fields.load
14
+ # PageField#as_json serializes both the through association and the
15
+ # Active Storage attachments. Preload the complete graph here so a
16
+ # page with many media fields does not issue one query per field/media.
17
+ @page.fields.includes(media: %i[file_attachment poster_file_attachment]).load
15
18
  render json: @page.as_json(include_fields: true)
16
19
  end
17
20
 
@@ -22,7 +22,7 @@ module LatoCms
22
22
  def lato_cms_page_actions(page, show_edit: false, show_delete: false, hide_show: false)
23
23
  btn_group = capture do
24
24
  content_tag(:div, class: 'btn-group btn-group-sm') do
25
- concat(link_to(t('lato_cms.cta_show'), lato_cms.pages_show_path(page), class: 'btn btn-primary')) unless hide_show
25
+ concat(link_to(t('lato_cms.cta_edit'), lato_cms.pages_show_path(page), class: 'btn btn-primary')) unless hide_show
26
26
  if show_edit
27
27
  concat link_to(t('lato_cms.cta_edit'), lato_cms.pages_update_path(page), class: 'btn btn-secondary',
28
28
  data: { lato_action_target: 'trigger', turbo_frame: dom_id(page, 'form'), action_title: t('lato_cms.page_update_title') })
@@ -82,7 +82,7 @@ module LatoCms
82
82
  concat content_tag(:li, content_tag(:span, t('lato_cms.action_view_frontend'), class: 'dropdown-item disabled text-muted'))
83
83
  end
84
84
  unless hide_show
85
- concat content_tag(:li, link_to(t('lato_cms.cta_show'), lato_cms.pages_show_path(page), class: 'dropdown-item'))
85
+ concat content_tag(:li, link_to(t('lato_cms.cta_edit'), lato_cms.pages_show_path(page), class: 'dropdown-item'))
86
86
  end
87
87
  if show_edit
88
88
  concat content_tag(:li, link_to(t('lato_cms.cta_edit'), lato_cms.pages_update_path(page), class: 'dropdown-item',
@@ -1,3 +1,3 @@
1
1
  module LatoCms
2
- VERSION = "3.3.1"
2
+ VERSION = "3.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante