mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 12:33:44 +08:00
eb891778ff
Use the names as provided by discourse-fonts and remove the translated strings. It also ensures that the selected font is present in case a font will be removed in the future.
16 lines
321 B
Ruby
16 lines
321 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "enum_site_setting"
|
|
|
|
class BaseFontSetting < EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= DiscourseFonts.fonts.map do |font|
|
|
{ name: font[:name], value: font[:key] }
|
|
end
|
|
end
|
|
end
|