effective_posts 2.9.4 → 2.10.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac4e05cce1c65124d62fe558a99e3126b6b65a24062850ada6d0d9c0a8b926ad
|
|
4
|
+
data.tar.gz: 94990fdcec750ff87644840f9ffe4e5e88cd277e8281e81a738518a2bb032370
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49dbea147d32f61c7e263919165f968f6e02676e5eab13299fa0f1e2c51aa4ade64a12274e14ef2d6fc52b70c05fb213b2b814e236a03addea9303828636b49b
|
|
7
|
+
data.tar.gz: 4b6fc77c7b355ad8d981b25459f96e8d1d607f60ae9e944f0925a586bebfc92e0552b6f832cfa802a8d5ac4d3385f0b9b3182ec650b166f0883e3747e22c7cb2
|
|
@@ -16,8 +16,6 @@ module Effective
|
|
|
16
16
|
unpublished: EffectiveResources.authorized?(self, :admin, :effective_posts)
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
-
@posts = @posts.paginate(page: params[:page])
|
|
20
|
-
|
|
21
19
|
if EffectivePosts.event_categories.include?(@category)
|
|
22
20
|
@posts = @posts.reorder(:start_at).where('start_at > ?', Time.zone.now)
|
|
23
21
|
end
|
|
@@ -35,6 +33,16 @@ module Effective
|
|
|
35
33
|
|
|
36
34
|
EffectiveResources.authorize!(self, :index, Effective::Post)
|
|
37
35
|
|
|
36
|
+
@posts_count = @posts.limit(nil).offset(nil).count
|
|
37
|
+
|
|
38
|
+
page = EffectiveResources.validate_page!(
|
|
39
|
+
params[:page],
|
|
40
|
+
collection_count: @posts_count,
|
|
41
|
+
per_page: EffectivePosts.per_page
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
@posts = @posts.paginate(page: page)
|
|
45
|
+
|
|
38
46
|
@page_title ||= [(@category || view_context.posts_name_label).to_s.titleize, (" - Page #{params[:page]}" if params[:page])].compact.join
|
|
39
47
|
@canonical_url ||= helpers.effective_post_category_url(params[:category], page: params[:page])
|
|
40
48
|
end
|
|
@@ -49,7 +57,7 @@ module Effective
|
|
|
49
57
|
|
|
50
58
|
EffectiveResources.authorize!(self, :show, @post)
|
|
51
59
|
|
|
52
|
-
if admin
|
|
60
|
+
if admin
|
|
53
61
|
flash.now[:warning] = [
|
|
54
62
|
'Hi Admin!',
|
|
55
63
|
('You are viewing a hidden post.' unless @post.published?),
|
data/config/effective_posts.rb
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
EffectivePosts.setup do |config|
|
|
2
2
|
# Every post must have a category
|
|
3
3
|
# Each of these categories parameterized value will be a top level route
|
|
4
|
+
# Include 'Events' here to allow posts in an Events category
|
|
4
5
|
config.categories = ['News', 'Events']
|
|
5
6
|
|
|
6
|
-
# Which of the above categories will be considered post.event?
|
|
7
|
+
# Which of the above categories will be considered post.event?
|
|
7
8
|
# Used to select the fields on the Admin form
|
|
8
9
|
# Can't be unique. Must be subset of config.categories
|
|
10
|
+
# Use ['Events'] when config.categories includes 'Events'
|
|
9
11
|
config.event_categories = ['Events']
|
|
10
12
|
|
|
11
13
|
# Create top level routes for each category
|
data/lib/effective_posts.rb
CHANGED
|
@@ -44,11 +44,11 @@ module EffectivePosts
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def self.categories
|
|
47
|
-
Array(config[:categories])
|
|
47
|
+
Array(config[:categories]) - [nil, false, '']
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def self.event_categories
|
|
51
|
-
Array(config[:event_categories])
|
|
51
|
+
Array(config[:event_categories]) - [nil, false, '']
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def self.not_event_categories
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_posts
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -230,7 +229,6 @@ homepage: https://github.com/code-and-effect/effective_posts
|
|
|
230
229
|
licenses:
|
|
231
230
|
- MIT
|
|
232
231
|
metadata: {}
|
|
233
|
-
post_install_message:
|
|
234
232
|
rdoc_options: []
|
|
235
233
|
require_paths:
|
|
236
234
|
- lib
|
|
@@ -245,8 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
245
243
|
- !ruby/object:Gem::Version
|
|
246
244
|
version: '0'
|
|
247
245
|
requirements: []
|
|
248
|
-
rubygems_version:
|
|
249
|
-
signing_key:
|
|
246
|
+
rubygems_version: 4.0.17
|
|
250
247
|
specification_version: 4
|
|
251
248
|
summary: A blog implementation with WYSIWYG content editing, post scheduling, pagination
|
|
252
249
|
and optional top level routes for each post category.
|