mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 00:13:37 +08:00
43cfdb1cb9
The wizard searches for: * a topic that with the "is_welcome_topic" custom field * a topic with the correct slug for the current default locale * a topic with the correct slug for the English locale * the oldest globally pinned topic It gives up if it didn't find any of the above.
27 lines
457 B
Ruby
27 lines
457 B
Ruby
class Wizard
|
|
class Step
|
|
attr_reader :id, :updater
|
|
attr_accessor :index, :fields, :next, :previous, :banner, :disabled, :description_vars
|
|
|
|
def initialize(id)
|
|
@id = id
|
|
@fields = []
|
|
end
|
|
|
|
def add_field(attrs)
|
|
field = Field.new(attrs)
|
|
field.step = self
|
|
@fields << field
|
|
field
|
|
end
|
|
|
|
def has_fields?
|
|
@fields.present?
|
|
end
|
|
|
|
def on_update(&block)
|
|
@updater = block
|
|
end
|
|
end
|
|
end
|