Add privacy tab in profile settings (#26484)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
parent
3a8370e1f4
commit
fc5ab2dc83
130 changed files with 131 additions and 689 deletions
|
@ -10,6 +10,27 @@ class UserSettings::Setting
|
|||
@in = options[:in]
|
||||
end
|
||||
|
||||
def inverse_of(name)
|
||||
@inverse_of = name.to_sym
|
||||
self
|
||||
end
|
||||
|
||||
def value_for(name, original_value)
|
||||
value = begin
|
||||
if original_value.nil?
|
||||
default_value
|
||||
else
|
||||
original_value
|
||||
end
|
||||
end
|
||||
|
||||
if !@inverse_of.nil? && @inverse_of == name.to_sym
|
||||
!value
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
def default_value
|
||||
if @default_value.respond_to?(:call)
|
||||
@default_value.call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue