effective_pages 3.8.2 → 3.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/pages_controller.rb +1 -1
- data/app/helpers/effective_carousels_helper.rb +1 -1
- data/app/helpers/effective_menus_helper.rb +4 -2
- data/app/helpers/effective_page_banners_helper.rb +2 -2
- data/app/helpers/effective_page_sections_helper.rb +1 -1
- data/app/models/effective/page.rb +5 -1
- data/app/models/effective/permalink.rb +5 -1
- data/app/views/effective/pages/_page_menu.html.haml +6 -3
- data/lib/effective_pages/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab2014d3e00b7e610f9e4bbb783dc853d5eeb5a5c51215266d37c42d6435d453
|
4
|
+
data.tar.gz: 59c5957db1af495169511e34bd2b77b9da60574d16d8fabcde374738429c55eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71d6ef9905b0426c44b791e6422b6784e395bd776d3a346fee1609931769b5e9e2f2b5f63b5240e643d763394d6624ebf8089f5d59bb45d7f25f85071a1c74a7
|
7
|
+
data.tar.gz: 8d07252b5ba59072c8f078f394260da1ab6bd5b874f1ec9543f247c66528760b729a22c7cab542b66dbee7a402f64db929fc08ebf5baebfbe15deb1caa8f2eaa
|
@@ -9,7 +9,7 @@ module EffectiveCarouselsHelper
|
|
9
9
|
raise("unable to find carousel #{name}. Please add it to config/initializers/effective_pages.rb")
|
10
10
|
end
|
11
11
|
|
12
|
-
carousel_items = Effective::CarouselItem.sorted.where(carousel: carousel)
|
12
|
+
carousel_items = Effective::CarouselItem.sorted.deep.where(carousel: carousel)
|
13
13
|
return if carousel_items.blank?
|
14
14
|
|
15
15
|
if block_given?
|
@@ -28,7 +28,9 @@ module EffectiveMenusHelper
|
|
28
28
|
(
|
29
29
|
[content_tag(:li, link_to(root, root_path, title: root), class: 'breadcrumb-item')] +
|
30
30
|
parents.map do |page|
|
31
|
-
|
31
|
+
page.try(:strict_loading!, false)
|
32
|
+
|
33
|
+
next if page.menu_root_with_children? # Don't show root pages because they have no content
|
32
34
|
|
33
35
|
url = (page.menu_url.presence || effective_pages.page_path(page))
|
34
36
|
content_tag(:li, link_to(page, url, title: page.title), class: 'breadcrumb-item')
|
@@ -60,7 +62,7 @@ module EffectiveMenusHelper
|
|
60
62
|
def admin_menu_parent_collection(page = nil)
|
61
63
|
raise('expected a page') if page.present? && !page.kind_of?(Effective::Page)
|
62
64
|
|
63
|
-
pages = Effective::Page.menuable.root_level.where.not(id: page)
|
65
|
+
pages = Effective::Page.deep.menuable.root_level.where.not(id: page)
|
64
66
|
|
65
67
|
if EffectivePages.max_menu_depth == 2
|
66
68
|
# You can only select root level pages
|
@@ -8,9 +8,9 @@ module EffectivePageBannersHelper
|
|
8
8
|
return unless page.banner? || EffectivePages.banners_force_randomize
|
9
9
|
|
10
10
|
# Always return a random banner if config.banners_force_randomize
|
11
|
-
page_banner = Effective::PageBanner.random.first if EffectivePages.banners_force_randomize
|
11
|
+
page_banner = Effective::PageBanner.deep.random.first if EffectivePages.banners_force_randomize
|
12
12
|
page_banner ||= page.page_banner if page.banner? && page.page_banner.present?
|
13
|
-
page_banner ||= Effective::PageBanner.random.first if page.banner? && page.banner_random?
|
13
|
+
page_banner ||= Effective::PageBanner.deep.random.first if page.banner? && page.banner_random?
|
14
14
|
|
15
15
|
return if page_banner.blank?
|
16
16
|
|
@@ -58,7 +58,11 @@ module Effective
|
|
58
58
|
timestamps
|
59
59
|
end
|
60
60
|
|
61
|
-
scope :deep, -> {
|
61
|
+
scope :deep, -> {
|
62
|
+
base = includes(:page_banner, :tags, :rich_texts, :menu_parent, menu_children: [:menu_parent, :menu_children])
|
63
|
+
base = base.includes(:pg_search_document) if defined?(PgSearch)
|
64
|
+
base
|
65
|
+
}
|
62
66
|
|
63
67
|
scope :draft, -> { where(draft: true) }
|
64
68
|
scope :published, -> { where(draft: false) }
|
@@ -16,7 +16,11 @@ module Effective
|
|
16
16
|
|
17
17
|
log_changes if respond_to?(:log_changes)
|
18
18
|
|
19
|
-
scope :deep, -> {
|
19
|
+
scope :deep, -> {
|
20
|
+
base = with_attached_attachment
|
21
|
+
base = base.includes(:pg_search_document) if defined?(PgSearch)
|
22
|
+
base
|
23
|
+
}
|
20
24
|
|
21
25
|
effective_resource do
|
22
26
|
title :string
|
@@ -6,9 +6,12 @@
|
|
6
6
|
= nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(page)))
|
7
7
|
|
8
8
|
- # if this is a third depth page, show the parent and siblings
|
9
|
-
- if
|
10
|
-
-
|
11
|
-
|
9
|
+
- if page.menu_children.blank? && page.menu_parent.try(:menu_parent_id).present?
|
10
|
+
- page.menu_parent.try(:strict_loading!, false)
|
11
|
+
|
12
|
+
- if page.menu_parent.menu_children.present?
|
13
|
+
- children = page.menu_parent.menu_children
|
14
|
+
= nav_link_to(page.menu_parent.menu_to_s, (page.menu_parent.menu_url.presence || effective_pages.page_path(page.menu_parent)))
|
12
15
|
|
13
16
|
- children.each do |page|
|
14
17
|
- next unless EffectiveResources.authorized?(self, :show, page)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.8.
|
4
|
+
version: 3.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|