89
90
91
92
93
94
95
96
97
98
99
|
# File 'app/helpers/effective_posts_helper.rb', line 89
def admin_post_status_badge(post)
return nil unless EffectiveResources.authorized?(self, :admin, :effective_posts)
if post.archived?
content_tag(:span, 'ARCHIVED', class: 'badge badge-info')
elsif post.draft?
content_tag(:span, 'DRAFT', class: 'badge badge-info')
elsif post.published? == false
content_tag(:span, "TO BE PUBLISHED AT #{post.published_start_at&.strftime('%F %H:%M') || 'LATER'}", class: 'badge badge-info')
end
end
|