2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-26 01:14:56 +08:00
|
|
|
class WizardSerializer < ApplicationSerializer
|
2020-05-27 01:56:36 +08:00
|
|
|
attributes :start, :completed, :current_color_scheme
|
2016-08-26 01:14:56 +08:00
|
|
|
|
|
|
|
has_many :steps, serializer: WizardStepSerializer, embed: :objects
|
|
|
|
|
|
|
|
def start
|
|
|
|
object.start.id
|
|
|
|
end
|
2018-11-16 03:44:19 +08:00
|
|
|
|
|
|
|
def completed
|
|
|
|
object.completed?
|
|
|
|
end
|
2020-05-27 01:56:36 +08:00
|
|
|
|
|
|
|
def current_color_scheme
|
2020-05-27 04:08:35 +08:00
|
|
|
color_scheme = Theme.where(id: SiteSetting.default_theme_id).first&.color_scheme
|
2021-08-26 05:10:12 +08:00
|
|
|
color_scheme ? color_scheme.colors_hashes : ColorScheme.base.colors_hashes
|
2020-05-27 01:56:36 +08:00
|
|
|
end
|
2016-08-26 01:14:56 +08:00
|
|
|
end
|