2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-07-31 11:18:50 -04:00
|
|
|
class AuthProviderSerializer < ApplicationSerializer
|
|
|
|
|
|
|
|
attributes :name, :custom_url, :pretty_name_override, :title_override, :message_override,
|
2019-03-27 09:25:04 -04:00
|
|
|
:frame_width, :frame_height, :full_screen_login, :can_connect, :can_revoke,
|
|
|
|
:icon
|
2018-07-31 11:18:50 -04:00
|
|
|
|
|
|
|
def title_override
|
2019-05-06 21:00:09 -04:00
|
|
|
return SiteSetting.get(object.title_setting) if object.title_setting
|
2018-07-31 11:18:50 -04:00
|
|
|
object.title
|
|
|
|
end
|
|
|
|
|
|
|
|
def pretty_name_override
|
2019-05-06 21:00:09 -04:00
|
|
|
return SiteSetting.get(object.pretty_name_setting) if object.pretty_name_setting
|
2018-07-31 11:18:50 -04:00
|
|
|
object.pretty_name
|
|
|
|
end
|
|
|
|
|
|
|
|
def full_screen_login
|
2019-05-06 21:00:09 -04:00
|
|
|
return SiteSetting.get(object.full_screen_login_setting) if object.full_screen_login_setting
|
2018-08-06 05:24:39 -04:00
|
|
|
return object.full_screen_login if object.full_screen_login
|
2018-07-31 11:18:50 -04:00
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def message_override
|
|
|
|
object.message
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|