mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Remove unusued site_settings, show checkbox in UI for boolean values, remove restrict_access
boolean to avoid locking yourself out by setting access_password to empty string. Minor UI tweaks.
This commit is contained in:
@ -51,10 +51,12 @@ module SiteSettingExtension
|
||||
# Retrieve all settings
|
||||
def all_settings
|
||||
@defaults.map do |s, v|
|
||||
value = send(s)
|
||||
{setting: s,
|
||||
description: description(s),
|
||||
default: v,
|
||||
value: send(s).to_s}
|
||||
type: get_data_type_string(value),
|
||||
value: value.to_s}
|
||||
end
|
||||
end
|
||||
|
||||
@ -169,6 +171,16 @@ module SiteSettingExtension
|
||||
|
||||
protected
|
||||
|
||||
# We're currently in the process of refactoring our Enums. When that's
|
||||
# done we should pop back and fix this to something better.
|
||||
def get_data_type_string(val)
|
||||
case get_data_type(val)
|
||||
when Types::String then 'string'
|
||||
when Types::Fixnum then 'number'
|
||||
when Types::Bool then 'bool'
|
||||
end
|
||||
end
|
||||
|
||||
def get_data_type(val)
|
||||
return Types::Null if val.nil?
|
||||
|
||||
|
Reference in New Issue
Block a user