2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-02-17 12:46:19 +08:00
|
|
|
class UserOptionSerializer < ApplicationSerializer
|
|
|
|
attributes :user_id,
|
|
|
|
:mailing_list_mode,
|
2016-05-21 21:17:54 +08:00
|
|
|
:mailing_list_mode_frequency,
|
2016-02-17 12:46:19 +08:00
|
|
|
:email_digests,
|
2019-03-15 22:55:11 +08:00
|
|
|
:email_level,
|
|
|
|
:email_messages_level,
|
2016-02-17 12:46:19 +08:00
|
|
|
:external_links_in_new_tab,
|
2020-08-28 22:36:52 +08:00
|
|
|
:color_scheme_id,
|
2020-08-06 21:45:37 +08:00
|
|
|
:dark_scheme_id,
|
2016-02-17 12:46:19 +08:00
|
|
|
:dynamic_favicon,
|
|
|
|
:enable_quoting,
|
2019-05-31 13:43:17 +08:00
|
|
|
:enable_defer,
|
2016-03-03 04:26:27 +08:00
|
|
|
:digest_after_minutes,
|
2016-02-17 12:46:19 +08:00
|
|
|
:automatically_unpin_topics,
|
2016-02-18 13:57:22 +08:00
|
|
|
:auto_track_topics_after_msecs,
|
2016-10-01 00:36:43 +08:00
|
|
|
:notification_level_when_replying,
|
2016-02-19 10:56:52 +08:00
|
|
|
:new_topic_duration_minutes,
|
2016-02-25 21:05:40 +08:00
|
|
|
:email_previous_replies,
|
2016-03-02 20:16:52 +08:00
|
|
|
:email_in_reply_to,
|
2016-03-18 05:35:23 +08:00
|
|
|
:like_notification_frequency,
|
2017-05-13 00:41:26 +08:00
|
|
|
:include_tl0_in_digests,
|
2018-07-12 12:18:21 +08:00
|
|
|
:theme_ids,
|
2017-10-06 15:56:58 +08:00
|
|
|
:theme_key_seq,
|
|
|
|
:allow_private_messages,
|
2020-07-21 05:23:49 +08:00
|
|
|
:enable_allowed_pm_users,
|
2017-11-10 03:45:19 +08:00
|
|
|
:homepage_id,
|
2019-01-14 21:21:46 +08:00
|
|
|
:hide_profile_and_presence,
|
2019-01-28 19:19:50 +08:00
|
|
|
:text_size,
|
2019-04-12 07:02:18 +08:00
|
|
|
:text_size_seq,
|
2019-11-25 08:49:27 +08:00
|
|
|
:title_count_mode,
|
2020-08-14 21:40:56 +08:00
|
|
|
:timezone,
|
|
|
|
:skip_new_user_tips
|
2016-02-17 12:46:19 +08:00
|
|
|
|
2016-02-18 13:57:22 +08:00
|
|
|
def auto_track_topics_after_msecs
|
|
|
|
object.auto_track_topics_after_msecs || SiteSetting.default_other_auto_track_topics_after_msecs
|
|
|
|
end
|
|
|
|
|
2016-10-01 00:36:43 +08:00
|
|
|
def notification_level_when_replying
|
|
|
|
object.notification_level_when_replying || SiteSetting.default_other_notification_level_when_replying
|
|
|
|
end
|
|
|
|
|
2016-02-18 13:57:22 +08:00
|
|
|
def new_topic_duration_minutes
|
|
|
|
object.new_topic_duration_minutes || SiteSetting.default_other_new_topic_duration_minutes
|
|
|
|
end
|
|
|
|
|
2018-07-12 12:18:21 +08:00
|
|
|
def theme_ids
|
|
|
|
object.theme_ids.presence || [SiteSetting.default_theme_id]
|
2017-05-13 00:41:26 +08:00
|
|
|
end
|
|
|
|
|
2016-02-17 12:46:19 +08:00
|
|
|
end
|