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 +4 -4
- data/app/controllers/admin/posts_controller.rb +1 -0
- data/app/models/effective/post.rb +2 -3
- data/app/views/admin/posts/_form.html.haml +3 -5
- data/app/views/effective/posts/_form.html.haml +2 -3
- data/config/effective_posts.rb +0 -3
- data/lib/effective_posts.rb +2 -2
- data/lib/effective_posts/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: d7fa99747e0baf6c175224b5d3ce645964ac5592137857a6cb28ae6d17687146
|
4
|
+
data.tar.gz: 277fa3f03c1411d810f0dc09663f4deb6bb2be2c1a890cbf7cc88bc9d6b0bd9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
122
|
-
|
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
|
-
|
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.
|
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.
|
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
|
-
|
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'
|
data/config/effective_posts.rb
CHANGED
@@ -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
|
|
data/lib/effective_posts.rb
CHANGED
@@ -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, :
|
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
|
]
|
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.
|
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-
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|