effective_posts 2.0.0 → 2.0.1

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: 850461d12290e86cc451412a56caaac5fccfc469c58d8a8a716f8b1efc1a0d40
4
- data.tar.gz: 44069bc3c8563a6e91f467a7a9f1458d1cd0e6a3f79eb039abae1be473b76e7f
3
+ metadata.gz: d7fa99747e0baf6c175224b5d3ce645964ac5592137857a6cb28ae6d17687146
4
+ data.tar.gz: 277fa3f03c1411d810f0dc09663f4deb6bb2be2c1a890cbf7cc88bc9d6b0bd9e
5
5
  SHA512:
6
- metadata.gz: 8cac1f40075ce9ad990c53ba9f4b0feb2bb887fe9a3b4931e0ed15b5ee574593537b1da261f728e84c08b588e0a2f68ad51a366f4949a93afd037f36b717ff15
7
- data.tar.gz: fd63bde9093980a4f7e41660d6a11f7e317a52fe9ddaaace0b5addda9f6016138ff8feec88771f52ccf76c497b9b2a7715099714ef66ca7c4f8207b30e13930c
6
+ metadata.gz: efce23b1c3b45e66acbe5d5b055e114a7baa09add399a29a4a76074c2be854b46565deb2dfc3e9bd3f9559b6e6ec8c51a0fcb66f184c278f8edd8fed10578d18
7
+ data.tar.gz: 2422db33dc37d6d3f39b3b206c7ea77cf0238a3c9194b44c7b4335058e870e1082449027bab23b71e46177c36e62d697a704359e3fecf7891c7921eef2a000fa
@@ -10,6 +10,7 @@ module Admin
10
10
  end
11
11
 
12
12
  submit :save, 'Save'
13
+ submit :save, 'Save and Add New', redirect: :new
13
14
  submit :save, 'Save and View', redirect: -> { effective_posts.post_path(resource) }
14
15
  submit :save, 'Duplicate', redirect: -> { effective_posts.new_admin_post_path(duplicate_id: resource.id) }
15
16
 
@@ -118,9 +118,8 @@ module Effective
118
118
  post.slug = post.slug + '-copy'
119
119
  post.draft = true
120
120
 
121
- regions.each do |region|
122
- post.regions.build(region.attributes.except('id', 'updated_at', 'created_at'))
123
- end
121
+ post.body = body
122
+ post.excerpt = excerpt
124
123
  end
125
124
  end
126
125
 
@@ -4,10 +4,10 @@
4
4
  - if f.object.persisted? || f.object.errors.include?(:slug)
5
5
  - current_url = effective_posts.post_path(f.object)
6
6
 
7
- = f.rich_text_area :excerpt, hint: 'Will be used for the post excerpt on index pages.'
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
8
9
 
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
10
+ = f.rich_text_area :excerpt, hint: 'Will be used for the post excerpt on index pages.'
11
11
 
12
12
  = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150
13
13
 
@@ -32,8 +32,6 @@
32
32
 
33
33
  = f.submit do
34
34
  = f.save 'Save'
35
-
36
35
  = f.save 'Save and View', class: 'btn btn-secondary'
37
-
38
36
  - if f.object.persisted?
39
37
  = f.save 'Duplicate', class: 'btn btn-info'
@@ -13,7 +13,7 @@
13
13
  - if EffectivePosts.use_active_storage
14
14
  = f.file_field :image, hint: 'An image for your post'
15
15
 
16
- = f.ck_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.'
16
+ = f.rich_text_area :excerpt, hint: 'Will be used for the post excerpt on index pages.'
17
17
  = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150
18
18
 
19
19
  = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f }
@@ -22,7 +22,6 @@
22
22
 
23
23
  = f.check_box :draft, hint: 'Save this post as a draft. It will not be accessible on the website.'
24
24
 
25
- - unless EffectivePosts.use_fullscreen_editor
26
- = f.ck_editor :body, hint: 'The content of your post.'
25
+ = f.rich_text_area :body, hint: 'The main body of your post'
27
26
 
28
27
  = f.submit 'Save'
@@ -35,9 +35,6 @@ EffectivePosts.setup do |config|
35
35
  # Display the effective roles 'choose roles' input when an admin creates a new post
36
36
  config.use_effective_roles = false
37
37
 
38
- # Hides the Save and Edit Content links from admin. They can just use the textarea input.
39
- config.use_fullscreen_editor = true
40
-
41
38
  # Display a file upload field when the admin creates a new post to collect a post.image
42
39
  config.use_active_storage = true
43
40
 
@@ -9,7 +9,7 @@ module EffectivePosts
9
9
  [
10
10
  :posts_table_name, :layout, :categories,
11
11
  :use_category_routes, :use_blog_routes,
12
- :use_effective_roles, :use_fullscreen_editor, :use_active_storage,
12
+ :use_effective_roles, :use_active_storage,
13
13
  :per_page, :post_meta_author,
14
14
  :submissions_enabled, :submissions_require_current_user,
15
15
  :submissions_require_approval, :submissions_note,
@@ -20,7 +20,7 @@ module EffectivePosts
20
20
  include EffectiveGem
21
21
 
22
22
  def self.permitted_params
23
- [
23
+ @permitted_params ||= [
24
24
  :title, :excerpt, :description, :draft, :category, :slug, :published_at, :body, :tags, :extra,
25
25
  :image, :start_at, :end_at, :location, :website_name, :website_href, roles: []
26
26
  ]
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.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.0.0
4
+ version: 2.0.1
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-02-22 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails