effective_posts 1.1.7 → 1.2.0

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: 9c81635c7e56d5facbc3813276bb811a474df76044f0f58e75f4ecbce9e3c535
4
- data.tar.gz: 87acdee49f9b8d8ae2d364d477bae82bb2a41acbcb4ffc7795578dac36191f19
3
+ metadata.gz: 1a7ad03cbc0f6be05bcd4b34bed730615b458bb9ae1438223edcef393fd3c107
4
+ data.tar.gz: '028a4320fc0ec425c9fc4a2ec13e8cb38408fa63d0b9a8cc652a3fe7c1ba97e6'
5
5
  SHA512:
6
- metadata.gz: 345527391a44291733d2c714a4d848a209f0cee44bc98d4ceeffefb7c6ae2216d648690e955ca82e49087f49c4d5bc53a54e480a0c81db652d066184d0474fbc
7
- data.tar.gz: 178b671b010fe6eacc41de115f533a7b97ddc5dc18756e75ebb73a9e5925c88e7c9123b6e9438494c2cc910508f4a09896154beef0ff9a64c189da2ef6e9768f
6
+ metadata.gz: 7ae7d9d8c4f85394b56e6915e4f8d21d7104753fb917e831f1d55011d74dedb3dafd1d743fdddc19859dd0145945645217aefbd70c53a93a0722a73bd06e0c76
7
+ data.tar.gz: e3bad110e3c0cbbf0321e76bcd192b092d56318e0ca7bdd2e946793d2a170870a304266b10a38117b4f509864eae1d346d3647de1957bfeff7b92e7324512432
@@ -44,7 +44,7 @@ module Effective
44
44
  'Hi Admin!',
45
45
  ('You are viewing a hidden post.' unless @post.published?),
46
46
  'Click here to',
47
- ("<a href='#{effective_regions.edit_path(effective_posts.post_path(@post, exit: effective_posts.post_path(@post)))}' class='alert-link'>edit post content</a> or" unless admin_edit?),
47
+ ("<a href='#{effective_regions.edit_path(effective_posts.post_path(@post, exit: effective_posts.post_path(@post)))}' class='alert-link' data-no-turbolink='true' data-turbolinks='false'>edit post content</a> or" unless admin_edit?),
48
48
  ("<a href='#{effective_posts.edit_admin_post_path(@post)}' class='alert-link'>edit post settings</a>.")
49
49
  ].compact.join(' ')
50
50
  end
@@ -31,14 +31,15 @@ module EffectivePostsHelper
31
31
  def effective_post_category_path(category, opts = nil)
32
32
  return effective_posts.posts_path(opts || {}) unless category.present?
33
33
 
34
- category = category.to_s.downcase
34
+ category = category.to_s
35
+ category_path = category.to_s.downcase.parameterize
35
36
  opts = (opts || {}).compact
36
37
  query = ('?' + opts.to_query) if opts.present?
37
38
 
38
39
  if EffectivePosts.use_blog_routes
39
- "/blog/category/#{category}#{query}"
40
+ "/blog/category/#{category_path}#{query}"
40
41
  elsif EffectivePosts.use_category_routes
41
- "/#{category}#{query}"
42
+ "/#{category_path}#{query}"
42
43
  else
43
44
  effective_posts.posts_path(opts.merge(category: category.presence).compact)
44
45
  end
@@ -13,7 +13,7 @@ module Effective
13
13
 
14
14
  self.table_name = EffectivePosts.posts_table_name.to_s
15
15
 
16
- belongs_to :user
16
+ belongs_to :user, optional: true
17
17
 
18
18
  # Attributes
19
19
  # title :string
@@ -5,7 +5,7 @@
5
5
 
6
6
  = dropdown_link_to 'Edit', effective_posts.edit_admin_post_path(post)
7
7
  - if EffectivePosts.use_fullscreen_editor
8
- = dropdown_link_to 'Edit Content', effective_post_path(post, edit: true), title: 'Edit Content', 'data-no-turbolink': true, target: '_blank'
8
+ = dropdown_link_to 'Edit Content', effective_post_path(post, edit: true), title: 'Edit Content', 'data-no-turbolink': true, 'data-turbolinks': false, target: '_blank'
9
9
 
10
10
  = dropdown_link_to 'View', effective_post_path(post), target: '_blank'
11
11
 
@@ -1,5 +1,2 @@
1
1
  .effective-posts-recent-posts
2
- - posts.each do |post|
3
- .effective-post
4
- %p= link_to post, effective_post_path(post)
5
-
2
+ = render(posts)
@@ -1,3 +1,3 @@
1
1
  module EffectivePosts
2
- VERSION = '1.1.7'.freeze
2
+ VERSION = '1.2.0'.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.7
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -143,7 +143,6 @@ files:
143
143
  - app/helpers/effective_truncate_html_helper.rb
144
144
  - app/mailers/effective/posts_mailer.rb
145
145
  - app/models/effective/access_denied.rb
146
- - app/models/effective/datatables/posts.rb
147
146
  - app/models/effective/post.rb
148
147
  - app/models/effective/snippets/read_more_divider.rb
149
148
  - app/views/admin/posts/_actions.html.haml
@@ -183,7 +182,7 @@ homepage: https://github.com/code-and-effect/effective_posts
183
182
  licenses:
184
183
  - MIT
185
184
  metadata: {}
186
- post_install_message:
185
+ post_install_message:
187
186
  rdoc_options: []
188
187
  require_paths:
189
188
  - lib
@@ -198,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
197
  - !ruby/object:Gem::Version
199
198
  version: '0'
200
199
  requirements: []
201
- rubygems_version: 3.0.3
202
- signing_key:
200
+ rubygems_version: 3.1.2
201
+ signing_key:
203
202
  specification_version: 4
204
203
  summary: A blog implementation with WYSIWYG content editing, post scheduling, pagination
205
204
  and optional top level routes for each post category.
@@ -1,40 +0,0 @@
1
- if Gem::Version.new(EffectiveDatatables::VERSION) < Gem::Version.new('3.0')
2
- module Effective
3
- module Datatables
4
- class Posts < Effective::Datatable
5
- datatable do
6
- default_order :published_at, :desc
7
-
8
- table_column :published_at
9
- table_column :id, visible: false
10
-
11
- table_column :title
12
- col :slug, visible: false
13
- table_column :category, filter: { type: :select, values: EffectivePosts.categories }
14
-
15
- if EffectivePosts.submissions_enabled
16
- table_column :approved, column: 'NOT(draft)', as: :boolean do |post|
17
- post.draft ? 'No' : 'Yes'
18
- end
19
-
20
- table_column :draft, visible: false
21
- else
22
- table_column :draft
23
- end
24
-
25
- table_column :start_at
26
- table_column :end_at, visible: false
27
- table_column :location, visible: false
28
-
29
- table_column :created_at, label: 'Submitted at', visible: false
30
-
31
- table_column :actions, sortable: false, filter: false, partial: '/admin/posts/actions'
32
- end
33
-
34
- def collection
35
- Effective::Post.all
36
- end
37
- end
38
- end
39
- end
40
- end