effective_pages 3.3.0 → 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 +4 -4
- data/app/datatables/effective_pages_menu_datatable.rb +2 -2
- data/app/helpers/effective_menus_helper.rb +3 -1
- data/app/models/effective/page_section.rb +2 -2
- data/app/views/admin/page_sections/_form_page_section.html.haml +1 -1
- data/app/views/effective/pages/_page_menu.html.haml +12 -11
- 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: e3ef36f0fae90cb4172cbc5541abbac53d632e611024fc1b3febd6fc8476cafd
|
4
|
+
data.tar.gz: ed784ec8c9575641c5803450d5664b5d11cf90aab89d73163c4d86e28448f66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6afc63a6a120d7b67d872ab985f990d0db4117b12a7e0ae1bf79a2451c00fdcf89e18e8c2a3c58d22344f3a0190e0fc9cf11589b11c01e57f8fbf7798fee12cb
|
7
|
+
data.tar.gz: 38786d89a2341773f87bb122d9b64f26e7778d23c97dee10ee04d1b846b09331e9266acc7b156e6e8bd62dd249d58af64d465454d564d8cca958688ca8ca753c
|
@@ -18,10 +18,10 @@ class EffectivePagesMenuDatatable < Effective::Datatable
|
|
18
18
|
col :menu_children, label: 'Children' do |page|
|
19
19
|
page.menu_children.group_by(&:menu_group).values.flatten.map do |child|
|
20
20
|
content_tag(:div, class: 'col-resource_item') do
|
21
|
-
link = link_to(child.
|
21
|
+
link = link_to(child.menu_to_s, effective_pages.edit_admin_page_path(child))
|
22
22
|
|
23
23
|
list = child.menu_children.group_by(&:menu_group).values.flatten.map do |child|
|
24
|
-
content_tag(:li, link_to(child.
|
24
|
+
content_tag(:li, link_to(child.menu_to_s, effective_pages.edit_admin_page_path(child)))
|
25
25
|
end
|
26
26
|
|
27
27
|
link + (content_tag(:ul, list.join.html_safe) if list.present?).to_s
|
@@ -28,8 +28,10 @@ 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
|
+
next if page.menu_root_with_children? # Don't show root pages becaues they have no content
|
32
|
+
|
31
33
|
url = (page.menu_url.presence || effective_pages.page_path(page))
|
32
|
-
content_tag(:li, link_to(page,
|
34
|
+
content_tag(:li, link_to(page, url, title: page.title), class: 'breadcrumb-item')
|
33
35
|
end +
|
34
36
|
[content_tag(:li, page, class: 'breadcrumb-item active', 'aria-current': 'page')]
|
35
37
|
).join.html_safe
|
@@ -6,7 +6,7 @@ module Effective
|
|
6
6
|
belongs_to :owner, polymorphic: true, optional: true
|
7
7
|
|
8
8
|
has_many_rich_texts
|
9
|
-
|
9
|
+
has_one_attached :file
|
10
10
|
|
11
11
|
log_changes if respond_to?(:log_changes)
|
12
12
|
|
@@ -32,7 +32,7 @@ module Effective
|
|
32
32
|
validates :link_url, presence: true, if: -> { link_label.present? }
|
33
33
|
validates :link_url, absence: true, if: -> { link_label.blank? }
|
34
34
|
|
35
|
-
scope :deep, -> {
|
35
|
+
scope :deep, -> { with_attached_file.includes(:rich_texts) }
|
36
36
|
scope :sorted, -> { order(:name) }
|
37
37
|
|
38
38
|
def to_s
|
@@ -1,17 +1,18 @@
|
|
1
1
|
- raise('expected a page') unless page.present?
|
2
2
|
|
3
|
-
-
|
3
|
+
- children = page.menu_children
|
4
4
|
|
5
|
-
- if
|
6
|
-
|
5
|
+
- if page.menu_children.present?
|
6
|
+
= nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(page)))
|
7
7
|
|
8
|
-
-
|
9
|
-
|
10
|
-
|
8
|
+
- # if this is a third depth page, show the parent and siblings
|
9
|
+
- if !page.menu_children.present? && page.menu_parent.present? && page.menu_parent&.menu_children&.present? && page.menu_parent&.menu_parent.present?
|
10
|
+
- children = page.menu_parent.menu_children
|
11
|
+
= nav_link_to(page.menu_parent.menu_to_s, (page.menu_parent.menu_url.presence || effective_pages.page_path(page.menu_parent)))
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
- children.each do |page|
|
14
|
+
- next unless EffectiveResources.authorized?(self, :show, page)
|
15
|
+
- next if (page.authenticate_user || page.roles.present?) && current_user.blank?
|
16
|
+
- next if page.roles.present? && (current_user.roles & page.roles).blank?
|
16
17
|
|
17
|
-
|
18
|
+
= nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(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.3.
|
4
|
+
version: 3.3.2
|
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: 2022-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|