mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
UX: Add Styling step to wizard (#14132)
Refactors three wizard steps (colors, fonts, homepage style) into one new step called Styling.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class WizardFieldSerializer < ApplicationSerializer
|
||||
|
||||
attributes :id, :type, :required, :value, :label, :placeholder, :description, :extra_description
|
||||
attributes :id, :type, :required, :value, :label, :placeholder, :description, :extra_description, :show_in_sidebar
|
||||
has_many :choices, serializer: WizardFieldChoiceSerializer, embed: :objects
|
||||
|
||||
def id
|
||||
@@ -68,4 +68,12 @@ class WizardFieldSerializer < ApplicationSerializer
|
||||
extra_description.present?
|
||||
end
|
||||
|
||||
def show_in_sidebar
|
||||
object.show_in_sidebar
|
||||
end
|
||||
|
||||
def include_show_in_sidebar?
|
||||
object.show_in_sidebar.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -15,11 +15,6 @@ class WizardSerializer < ApplicationSerializer
|
||||
|
||||
def current_color_scheme
|
||||
color_scheme = Theme.where(id: SiteSetting.default_theme_id).first&.color_scheme
|
||||
colors = color_scheme ? color_scheme.colors : ColorScheme.base.colors
|
||||
|
||||
# The frontend expects the color hexs to start with '#'
|
||||
colors_with_hash = {}
|
||||
colors.each { |color| colors_with_hash[color.name] = color.hex_with_hash }
|
||||
colors_with_hash
|
||||
color_scheme ? color_scheme.colors_hashes : ColorScheme.base.colors_hashes
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user