mirror of
https://github.com/discourse/discourse.git
synced 2026-03-04 01:15:08 +08:00
Add a Welcome banner location setting to the *Interface & layout* page that admins can adjust to change the location of the welcome banner. --------- Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
20 lines
471 B
Ruby
20 lines
471 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "enum_site_setting"
|
|
|
|
class WelcomeBannerLocation < EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= [
|
|
{ name: "welcome_banner_location.above_topic_content", value: "above_topic_content" },
|
|
{ name: "welcome_banner_location.below_site_header", value: "below_site_header" },
|
|
]
|
|
end
|
|
|
|
def self.translate_names?
|
|
true
|
|
end
|
|
end
|