effective_posts 1.1.4 → 1.1.5

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: cdd29ad9c84d93fdaeb2b0ae091f0af2a49c5189cd1ee5eeac47c6a4c3b7c0a9
4
- data.tar.gz: 3f03cba92f98e9f3b1e7c9226343d738229eb329261afc3704b6c832204f2b0b
3
+ metadata.gz: 6e75ef03c3fbb14f1770a332ff3963df4f065ae653fa3c9bcf476e66bff581bd
4
+ data.tar.gz: 618cac368b24754d447df9d65446355f18c9d2e1c3d26006398e94723043ed70
5
5
  SHA512:
6
- metadata.gz: 47436cd866a630f0555a87bd7cd1ac64f335d40cb10a08b623b769cdb08e39fea366c46bbefe684a4f286fea727573032b6a069d20149cf9ee3a7f9813bfede9
7
- data.tar.gz: 2020f6718c4ea5c3feb5244a4476876caea782f906811e6d590aabaf23b9f13cf5a688e678c4eb7fe9901df91c6ba42136df678787ad06748dfbf3314cf0f3d8
6
+ metadata.gz: a1fdf0cf42896d884c75ef94a87776dd55b4a3ef74878345e4100ac2b78945f8f7d2ba65bb0f730daec3eb8f3e6eb6b9335033e30d203da4f43ec56aea3952b8
7
+ data.tar.gz: 2e618b276e175bf0d18b5e686d94abc9ef72f9fd16be3507ef4d0163cae87efd675b3793290bab54d5fdcf30bc6b91ef004719612deb36334b54f7c4e0280984
@@ -69,7 +69,7 @@ module Admin
69
69
  begin
70
70
  post = @post.duplicate!
71
71
  flash[:success] = 'Successfully saved and duplicated post.'
72
- flash[:info] = "You are now editting the duplicated post. This new post has been created as a Draft."
72
+ flash[:info] = "You are now editing the duplicated post. This new post has been created as a Draft."
73
73
  rescue => e
74
74
  flash.delete(:success)
75
75
  flash[:danger] = "Unable to duplicate post: #{e.message}"
@@ -9,7 +9,7 @@ if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
9
9
  table_column :id, visible: false
10
10
 
11
11
  table_column :title
12
- table_column :slug
12
+ col :slug, visible: false
13
13
  table_column :category, filter: { type: :select, values: EffectivePosts.categories }
14
14
 
15
15
  if EffectivePosts.submissions_enabled
@@ -111,6 +111,7 @@ module Effective
111
111
  def duplicate!
112
112
  Post.new(attributes.except('id', 'updated_at', 'created_at')).tap do |post|
113
113
  post.title = post.title + ' (Copy)'
114
+ post.slug = post.slug + '-copy'
114
115
  post.draft = true
115
116
 
116
117
  regions.each do |region|
@@ -1,9 +1,9 @@
1
1
  = effective_form_with(model: post, url: post.persisted? ? effective_posts.admin_post_path(post.id) : effective_posts.admin_posts_path) do |f|
2
2
  = f.text_field :title, hint: 'The title of your post.'
3
-
3
+
4
4
  - if f.object.persisted? || f.object.errors.include?(:slug)
5
- - current_url = (effective_posts.post_url(f.object) rescue nil)
6
- = f.text_field :slug, 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 }".html_safe
5
+ - current_url = effective_posts.post_path(f.object)
6
+ = f.text_field :slug, 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
7
7
 
8
8
  - if Array(EffectivePosts.categories).length > 1
9
9
  = f.select :category, EffectivePosts.categories
@@ -2,8 +2,8 @@
2
2
  = f.text_field :title, hint: 'The title of your post.'
3
3
 
4
4
  - if f.object.persisted? || f.object.errors.include?(:slug)
5
- - current_url = (effective_posts.post_url(f.object) rescue nil)
6
- = f.text_field :slug, 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 }".html_safe
5
+ - current_url = effective_posts.post_path(f.object)
6
+ = f.text_field :slug, 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
7
7
 
8
8
  - if Array(EffectivePosts.categories).length > 1
9
9
  = f.select :category, EffectivePosts.categories
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '1.1.4'.freeze
2
+ VERSION = '1.1.5'.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: 1.1.4
4
+ version: 1.1.5
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: 2019-06-20 00:00:00.000000000 Z
11
+ date: 2019-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails