FEATURE: add welcome topic cta banner (#17821)

This commit is contained in:
Arpit Jalan
2022-08-09 21:52:39 +05:30
committed by GitHub
parent 5138347e48
commit d57bea4de3
15 changed files with 169 additions and 8 deletions

View File

@@ -203,4 +203,10 @@ class Site
MessageBus.publish(SITE_JSON_CHANNEL, '')
end
def self.show_welcome_topic_banner?(guardian)
return false unless guardian.is_admin?
return false unless guardian.user.id == User.first_login_admin_id
Post.find_by("topic_id = :topic_id AND post_number = 1 AND version = 1 AND created_at > :created_at", topic_id: SiteSetting.welcome_topic_id, created_at: 1.month.ago).present?
end
end