effective_pages 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2607792f3255903a84c8ef0b74d49d9278265a5ad0bdd518aae75efe55aeee7
4
- data.tar.gz: b5e0ce5b60989700346dffa5709693c9fe80ed12a49f93f2feaa488623d38f24
3
+ metadata.gz: 6cf23b05e739f425ac9681d3a23482c0080498a59257e3e7f1988976e2807d3e
4
+ data.tar.gz: 4504a432b1d2e2700aa351160ba73afe2ae9368f59aed98e00a5d0b3b30cb677
5
5
  SHA512:
6
- metadata.gz: 4f0b5af9258a98e3cd3af75523b5670716ea37a6c78d37b8951071602489ccbeee773605ee025ccf08aca905c21e139581349fe4c822f900d788493e69eb6e4e
7
- data.tar.gz: 2f5ece4423c3742e50e104779d9a58ef8ca4a69870e8bec5a9851538c680615acba337a85be9d286c4f967341d223f2e71d7fcaa6cb7954058b03aadb04ccfb6
6
+ metadata.gz: 7ee1f64e3076dc7ca7e428d8d310881836b6ce24feeea8c310a20b7e1b582f60cb2a57992cb25f2d73ee8621f8424237b0cddc8e5c6292a10bb4041f1f005824
7
+ data.tar.gz: 36137529002c0d6051ded641ee237a1e7419eb5a62364ab32718d30d7308dc5aa29d3b9a44746b07556cb99440fda95efe61b9b8fefa5875c2bb00cc0a706d4b
@@ -84,6 +84,15 @@ module Effective
84
84
  title
85
85
  end
86
86
 
87
+ # As per has_many_rich_texts
88
+ def body
89
+ rich_text_body
90
+ end
91
+
92
+ def sidebar
93
+ rich_text_sidebar
94
+ end
95
+
87
96
  def published?
88
97
  !draft?
89
98
  end
@@ -107,7 +116,7 @@ module Effective
107
116
  end
108
117
 
109
118
  def menu_root_level
110
- menu_parent.blank?
119
+ menu? && menu_parent.blank?
111
120
  end
112
121
 
113
122
  end
@@ -14,8 +14,9 @@
14
14
  = render '/admin/pages/form_page', page: page
15
15
 
16
16
  - if page.persisted?
17
- = tab 'Menu' do
18
- = render '/admin/pages/form_menu', page: page
17
+ - if EffectivePages.menus.present?
18
+ = tab 'Menu' do
19
+ = render '/admin/pages/form_menu', page: page
19
20
 
20
21
  - unless page.menu_root_level
21
22
  = tab 'Content' do
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '3.0.5'.freeze
2
+ VERSION = '3.0.6'.freeze
3
3
  end
@@ -19,7 +19,9 @@ module EffectivePages
19
19
  include EffectiveGem
20
20
 
21
21
  def self.templates
22
- ApplicationController.view_paths.map { |path| Dir[File.join(path, pages_path, '**')] }.flatten.map do |file|
22
+ view_paths = defined?(Tenant) ? Tenant.view_paths : ApplicationController.view_paths
23
+
24
+ view_paths.map { |path| Dir[File.join(path, pages_path, '**')] }.flatten.map do |file|
23
25
  name = File.basename(file).split('.').first
24
26
  next if name.starts_with?('_')
25
27
  next if Array(EffectivePages.excluded_pages).map { |str| str.to_s }.include?(name)
@@ -30,7 +32,9 @@ module EffectivePages
30
32
  def self.layouts
31
33
  return [] if layouts_path.blank?
32
34
 
33
- ApplicationController.view_paths.map { |path| Dir[File.join(path, layouts_path, '**')] }.flatten.map do |file|
35
+ view_paths = defined?(Tenant) ? Tenant.view_paths : ApplicationController.view_paths
36
+
37
+ view_paths.map { |path| Dir[File.join(path, layouts_path, '**')] }.flatten.map do |file|
34
38
  name = File.basename(file).split('.').first
35
39
  next if name.starts_with?('_')
36
40
  next if name.include?('mailer')
@@ -1,29 +1,3 @@
1
1
  # bundle exec rake effective_pages:seed
2
2
  namespace :effective_pages do
3
- task seed: :environment do
4
- include EffectiveMenusHelper
5
-
6
- return true if Effective::Menu.find_by_title('main menu').present?
7
-
8
- Effective::Menu.new(:title => 'main menu').build do
9
- dropdown 'About' do
10
- item '111'
11
- item '222'
12
- dropdown 'More...' do
13
- item '333'
14
- item '444'
15
- end
16
- end
17
-
18
- dropdown 'Pages' do
19
- item 'AAA'
20
- divider
21
- item 'BBB'
22
- item 'CCC'
23
- divider
24
- item 'DDD'
25
- end
26
- end.save!
27
-
28
- end
29
3
  end
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.0.5
4
+ version: 3.0.6
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: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails