2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-03-04 01:15:08 +08:00
discourse/app/models/welcome_banner_location.rb
Yuriy Kurant f15778023c
UX: add welcome banner location site setting to admin interface (#33438)
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>
2025-07-17 13:34:22 +08:00

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