effective_posts 2.8.0 → 2.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18b1cb77e5c1dee2b2a438b1ad4a71f1a79caa1f5340d351b3355e0e92909c4b
|
4
|
+
data.tar.gz: 5d37e599214a4346eaa6a43491109496dbff7ace48bc8a706d2ad801b1cea3e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 237e17a90d360ee82c0d75e2d3ad2e1e3e8afe1f558e59307d6c844e20cc8d3532bfee6ff4fde9a8a2e5a6cab9fbfdd4534af629b9e4917d4f034029547527f9
|
7
|
+
data.tar.gz: 7b19966b9da0e7a1f6182678181f1fc8f70814500ce7adcf94dfcf7cd6103dfe2579d40e9280b7d22d0404a746725db98c7bc9df8297f33aa43f3aa8b343d55b
|
@@ -86,15 +86,21 @@ module EffectivePostsHelper
|
|
86
86
|
].compact.join(' ').html_safe
|
87
87
|
end
|
88
88
|
|
89
|
+
def post_status_badge(post)
|
90
|
+
post.roles.map do |role|
|
91
|
+
content_tag(:span, "#{role.to_s.upcase} ONLY", class: 'badge badge-secondary')
|
92
|
+
end.join(' ').html_safe
|
93
|
+
end
|
94
|
+
|
89
95
|
def admin_post_status_badge(post)
|
90
96
|
return nil unless EffectiveResources.authorized?(self, :admin, :effective_posts)
|
91
97
|
|
92
98
|
if post.archived?
|
93
|
-
content_tag(:span, 'ARCHIVED', class: 'badge badge-
|
99
|
+
content_tag(:span, 'ARCHIVED', class: 'badge badge-secondary')
|
94
100
|
elsif post.draft?
|
95
|
-
content_tag(:span, '
|
101
|
+
content_tag(:span, 'NOT PUBLISHED', class: 'badge badge-danger')
|
96
102
|
elsif post.published? == false
|
97
|
-
content_tag(:span, "TO BE PUBLISHED AT #{post.published_start_at&.strftime('%F %H:%M') || 'LATER'}", class: 'badge badge-
|
103
|
+
content_tag(:span, "TO BE PUBLISHED AT #{post.published_start_at&.strftime('%F %H:%M') || 'LATER'}", class: 'badge badge-danger')
|
98
104
|
end
|
99
105
|
end
|
100
106
|
|
@@ -88,9 +88,10 @@ module Effective
|
|
88
88
|
scope :posts, -> (user: nil, category: nil, unpublished: false, archived: false) {
|
89
89
|
scope = all.deep.order(arel_table[:published_start_at].desc.nulls_last)
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
91
|
+
# We include member only posts for all users.
|
92
|
+
# if defined?(EffectiveRoles) && EffectivePosts.use_effective_roles
|
93
|
+
# scope = scope.for_role(user&.roles)
|
94
|
+
# end
|
94
95
|
|
95
96
|
if category.present?
|
96
97
|
scope = scope.with_category(category)
|
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.
|
4
|
+
version: 2.9.0
|
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: 2024-12-
|
11
|
+
date: 2024-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|