mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add welcome topic cta banner (#17821)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user