mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 07:53:42 +08:00
85b8fea262
Refactors three wizard steps (colors, fonts, homepage style) into one new step called Styling.
21 lines
489 B
Ruby
21 lines
489 B
Ruby
# frozen_string_literal: true
|
|
|
|
class WizardSerializer < ApplicationSerializer
|
|
attributes :start, :completed, :current_color_scheme
|
|
|
|
has_many :steps, serializer: WizardStepSerializer, embed: :objects
|
|
|
|
def start
|
|
object.start.id
|
|
end
|
|
|
|
def completed
|
|
object.completed?
|
|
end
|
|
|
|
def current_color_scheme
|
|
color_scheme = Theme.where(id: SiteSetting.default_theme_id).first&.color_scheme
|
|
color_scheme ? color_scheme.colors_hashes : ColorScheme.base.colors_hashes
|
|
end
|
|
end
|