mirror of
https://github.com/discourse/discourse.git
synced 2025-07-13 21:40:38 +08:00

This is a stripped-back version of the Search Banner component https://meta.discourse.org/t/search-banner/122939, which will be renamed to Advanced Search Banner, see https://github.com/discourse/discourse-search-banner/pull/84. This welcome banner interacts with the header search. When `search_experience` is set to `search_field`, we only show the header search after the welcome banner scrolls out of view, and vice-versa. Only new sites will get this feature turned on by default, existing sites have a migration to disable it. --------- Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com> Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
16 lines
420 B
Ruby
16 lines
420 B
Ruby
# frozen_string_literal: true
|
|
#
|
|
class EnableWelcomeBannerNewSites < ActiveRecord::Migration[7.2]
|
|
def up
|
|
execute <<~SQL if Migration::Helpers.existing_site?
|
|
INSERT INTO site_settings(name, data_type, value, created_at, updated_at)
|
|
VALUES('enable_welcome_banner', 5, 'f', NOW(), NOW())
|
|
ON CONFLICT (name) DO NOTHING
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|