effective_posts 2.2.0 → 2.2.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: f228b038e50b44f2d2c17a492872ff12b35a2f0e6f04c3ede8b2bbb23aae0205
4
- data.tar.gz: 61a375523f541f7b986554280376c090e8a787fedffe33e60e0b9d09639de837
3
+ metadata.gz: 68d6f7c94df9405c42f74fba7e4a46221cd25b66054b156d1fa60877d441b75e
4
+ data.tar.gz: 4beb9b2a598b14f20f216e4618eaa383037fdcdb445393c0164b4c504338dad9
5
5
  SHA512:
6
- metadata.gz: dde470fb053b70b253e031b1c43dfa110f31b40821739f34681c3ccfa24de982a72ba0f27316bd26668f77f846c41bfd5f7d335fad49780ea3004d7e25747e30
7
- data.tar.gz: 0cb784aec5de7ae07e8919ab8693bec7269bcb976b03235c6e00857b08b2257f75edc9db10c2e6b4e6ae5dbe63259cd16ebc7decd989552e6449ac743ed9a030
6
+ metadata.gz: ed0f4a809b981a46a08298f9364ab0c78d09d33775ad116e013e4204abee6d3e6c153087c20c04d58dfae00c317f0573923c419ef6274dafb58de8ded364a71f
7
+ data.tar.gz: 8413ac3dd1ce6e3387193c14139d17deb7b4a5d71af4426f22bab9d5048182ff360dc00127b25f9a127d08d8c3e8edc047e86087c84bff446d663abfa1399c78
@@ -5,8 +5,7 @@ module Effective
5
5
 
6
6
  multisearchable against: [
7
7
  :title,
8
- :menu_title,
9
- :meta_description,
8
+ :description,
10
9
  :slug,
11
10
  ],
12
11
  associated_against: {
@@ -18,8 +17,7 @@ module Effective
18
17
  tsearch: {
19
18
  highlight: true,
20
19
  }
21
- },
22
- ranked_by: ":trigram" # Could rank by any column/expression, e.g.: (books.num_pages * :trigram) + (:tsearch / 2.0)
20
+ }
23
21
  end
24
22
 
25
23
  attr_accessor :current_user
@@ -27,6 +25,7 @@ module Effective
27
25
  acts_as_slugged
28
26
 
29
27
  log_changes if respond_to?(:log_changes)
28
+ acts_as_tagged if respond_to?(:acts_as_tagged)
30
29
  acts_as_role_restricted if respond_to?(:acts_as_role_restricted)
31
30
 
32
31
  has_one_attached :image
@@ -1,40 +1,46 @@
1
1
  = effective_form_with(model: [:admin, post], engine: true) do |f|
2
- = f.text_field :title, hint: 'The title of your post.'
2
+ = tabs do
3
+ = tab "Post" do
4
+ = f.text_field :title, hint: 'The title of your post.'
3
5
 
4
- - if f.object.persisted? || f.object.errors.include?(:slug)
5
- - current_url = effective_posts.post_path(f.object)
6
+ - if f.object.persisted? || f.object.errors.include?(:slug)
7
+ - current_url = effective_posts.post_path(f.object)
6
8
 
7
- = f.text_field :slug, required: f.object.persisted?,
8
- hint: "The slug controls this post's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This post is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url && f.object.slug.present? }".html_safe
9
+ = f.text_field :slug, required: f.object.persisted?,
10
+ hint: "The slug controls this post's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This post is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url && f.object.slug.present? }".html_safe
9
11
 
10
- - if defined?(EffectiveArticleEditor)
11
- = f.article_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.'
12
- - else
13
- = f.rich_text_area :excerpt, hint: 'Will be used for the post excerpt on index pages.'
12
+ - if defined?(EffectiveArticleEditor)
13
+ = f.article_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.'
14
+ - else
15
+ = f.rich_text_area :excerpt, hint: 'Will be used for the post excerpt on index pages.'
14
16
 
15
- = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150
17
+ = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150
16
18
 
17
- - if Array(EffectivePosts.categories).length > 1
18
- = f.select :category, EffectivePosts.categories
19
- - else
20
- = f.hidden_field :category, value: (EffectivePosts.categories.first || 'posts')
19
+ - if Array(EffectivePosts.categories).length > 1
20
+ = f.select :category, EffectivePosts.categories
21
+ - else
22
+ = f.hidden_field :category, value: (EffectivePosts.categories.first || 'posts')
21
23
 
22
- - if EffectivePosts.use_active_storage
23
- = f.file_field :image, hint: 'An image for your post'
24
+ - if EffectivePosts.use_active_storage
25
+ = f.file_field :image, hint: 'An image for your post'
24
26
 
25
- - if defined?(EffectiveArticleEditor)
26
- = f.article_editor :body, hint: 'The main body of your post'
27
- - else
28
- = f.rich_text_area :body, hint: 'The main body of your post'
27
+ - if defined?(EffectiveArticleEditor)
28
+ = f.article_editor :body, hint: 'The main body of your post'
29
+ - else
30
+ = f.rich_text_area :body, hint: 'The main body of your post'
29
31
 
30
- = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f }
32
+ = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f }
31
33
 
32
- = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.'
34
+ = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.'
33
35
 
34
- = f.check_box :draft, hint: 'Save this post as a draft. It will not be accessible on the website.'
36
+ = f.check_box :draft, hint: 'Save this post as a draft. It will not be accessible on the website.'
35
37
 
36
- - if defined?(EffectiveRoles) && f.object.respond_to?(:roles) && EffectivePosts.use_effective_roles
37
- = render partial: '/admin/posts/roles', locals: { post: post, form: f, f: f }
38
+ - if defined?(EffectiveRoles) && f.object.respond_to?(:roles) && EffectivePosts.use_effective_roles
39
+ = render partial: '/admin/posts/roles', locals: { post: post, form: f, f: f }
40
+
41
+ - if f.object.class.respond_to?(:acts_as_tagged?)
42
+ = tab "Tags" do
43
+ = render 'effective/tags/fields', f: f
38
44
 
39
45
  = f.submit do
40
46
  = f.save 'Save'
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_posts
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.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: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2023-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.1.2
150
+ rubygems_version: 3.4.10
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: A blog implementation with WYSIWYG content editing, post scheduling, pagination