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