effective_pages 3.14.4 → 3.14.6
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 +1 -1
- data/app/models/effective/carousel_item.rb +2 -2
- data/app/models/effective/page.rb +3 -3
- data/app/models/effective/page_banner.rb +1 -1
- data/app/models/effective/permalink.rb +5 -1
- data/app/views/admin/pages/_form_menu.html.haml +4 -1
- data/db/migrate/101_create_effective_pages.rb +10 -0
- 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: eaa8fa16930701d59907b95e1711b018273713f83a0fde69db62a7ef3016db2b
|
4
|
+
data.tar.gz: 2957e3144f68a3787fac56ab20e5b125592862ad56773421cf5d2208a28eadef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ee8094a1694cc7faeb8f8a21aeb17c95e9985168ec80473bba8c9ba3ab4f80a11c42de665a30549e7ba7920ddd18982f1b8e1dd1412194f731de17a0a7cc214
|
7
|
+
data.tar.gz: a24ba93db402e1f28bfeaaef1ef57239cee11e56bd25a5d53d0c56e1ccc549949548b37b37857eaec653a49faaf6ba0363490520031530ee6afabbd59bbb7711
|
@@ -8,7 +8,7 @@ class EffectivePagesMenuDatatable < Effective::Datatable
|
|
8
8
|
end
|
9
9
|
|
10
10
|
col :title do |page|
|
11
|
-
link_to(page, effective_pages.edit_admin_page_path(page))
|
11
|
+
link_to(page.menu_to_s, effective_pages.edit_admin_page_path(page))
|
12
12
|
end
|
13
13
|
|
14
14
|
col :menu_url, label: 'Redirect Url'
|
@@ -47,12 +47,12 @@ module Effective
|
|
47
47
|
|
48
48
|
validate(if: -> { carousel.present? && EffectivePages.carousels? }) do
|
49
49
|
unless (carousels = EffectivePages.carousels).find { |c| c.to_s == carousel.to_s }.present?
|
50
|
-
|
50
|
+
errors.add(:carousel, "must be one of #{carousels.to_sentence}")
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
validate(if: -> { file.attached? }) do
|
55
|
-
|
55
|
+
errors.add(:file, 'must be an image') unless file.image?
|
56
56
|
end
|
57
57
|
|
58
58
|
def to_s
|
@@ -115,7 +115,7 @@ module Effective
|
|
115
115
|
|
116
116
|
validate(if: -> { menu_url.present? }) do
|
117
117
|
unless menu_url.start_with?('http://') || menu_url.start_with?('https://') || menu_url.start_with?('/')
|
118
|
-
|
118
|
+
errors.add(:menu_url, "must start with http(s):// or /")
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
@@ -132,8 +132,8 @@ module Effective
|
|
132
132
|
|
133
133
|
validate(if: -> { banner? && EffectivePages.banners? }) do
|
134
134
|
unless (page_banner.present? ^ banner_random? ^ EffectivePages.banners_force_randomize) # xor
|
135
|
-
|
136
|
-
|
135
|
+
errors.add(:page_banner_id, "please select a page banner or random")
|
136
|
+
errors.add(:banner_random, "please select a page banner or random")
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
@@ -32,7 +32,7 @@ module Effective
|
|
32
32
|
validates :file, presence: true, content_type: :image, size: { less_than: 1.megabyte }
|
33
33
|
|
34
34
|
validate(if: -> { file.attached? }) do
|
35
|
-
|
35
|
+
errors.add(:file, 'must be an image') unless file.image?
|
36
36
|
end
|
37
37
|
|
38
38
|
def to_s
|
@@ -50,6 +50,10 @@ module Effective
|
|
50
50
|
"/link/#{slug}"
|
51
51
|
end
|
52
52
|
|
53
|
+
def published?
|
54
|
+
true
|
55
|
+
end
|
56
|
+
|
53
57
|
def target
|
54
58
|
url.present? ? :url : :attachment
|
55
59
|
end
|
@@ -58,7 +62,7 @@ module Effective
|
|
58
62
|
|
59
63
|
def attachment_and_url_cannot_both_be_present
|
60
64
|
if url.present? && (attachment.attached? && !attachment.marked_for_destruction?)
|
61
|
-
|
65
|
+
errors.add(:base, 'Attachment and URL cannot both be present')
|
62
66
|
end
|
63
67
|
end
|
64
68
|
end
|
@@ -27,7 +27,10 @@
|
|
27
27
|
= f.text_field :menu_url, label: "Redirect to path or url instead of displaying page",
|
28
28
|
hint: "Must start with http(s):// or /"
|
29
29
|
|
30
|
-
|
30
|
+
- if inline_datatable?
|
31
|
+
= f.submit 'Save'
|
32
|
+
- else
|
33
|
+
= effective_submit(f)
|
31
34
|
|
32
35
|
- if page.menu_parent.present?
|
33
36
|
.mb-4
|
@@ -39,6 +39,10 @@ class CreateEffectivePages < ActiveRecord::Migration[6.0]
|
|
39
39
|
end
|
40
40
|
|
41
41
|
add_index :pages, :slug, :unique => true
|
42
|
+
add_index :pages, [:published_start_at, :published_end_at], if_not_exists: true
|
43
|
+
add_index :pages, :menu, if_not_exists: true
|
44
|
+
add_index :pages, :menu_parent_id, if_not_exists: true
|
45
|
+
add_index :pages, :menu_position, if_not_exists: true
|
42
46
|
|
43
47
|
create_table :page_banners do |t|
|
44
48
|
t.string :name
|
@@ -89,6 +93,9 @@ class CreateEffectivePages < ActiveRecord::Migration[6.0]
|
|
89
93
|
t.timestamps
|
90
94
|
end
|
91
95
|
|
96
|
+
add_index :carousel_items, :carousel, if_not_exists: true
|
97
|
+
add_index :carousel_items, :position, if_not_exists: true
|
98
|
+
|
92
99
|
create_table :alerts, if_not_exists: true do |t|
|
93
100
|
t.boolean :enabled
|
94
101
|
|
@@ -118,6 +125,9 @@ class CreateEffectivePages < ActiveRecord::Migration[6.0]
|
|
118
125
|
|
119
126
|
t.timestamps
|
120
127
|
end
|
128
|
+
|
129
|
+
add_index :taggings, [:taggable_type, :taggable_id], if_not_exists: true
|
130
|
+
add_index :taggings, :tag_id, if_not_exists: true
|
121
131
|
end
|
122
132
|
|
123
133
|
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.14.
|
4
|
+
version: 3.14.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: 2025-
|
11
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|