mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 04:11:33 +08:00
3126c50baa
We want to change the design of the "member experience" step of the wizard from using checkbox switches to using radio toggle groups.
30 lines
521 B
Ruby
30 lines
521 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Wizard
|
|
class Step
|
|
attr_reader :id, :updater
|
|
attr_accessor :index, :fields, :next, :previous, :disabled, :description_vars, :emoji
|
|
|
|
def initialize(id)
|
|
@id = id
|
|
@fields = []
|
|
end
|
|
|
|
def add_field(attrs)
|
|
field = Field.new(attrs)
|
|
field.step = self
|
|
@fields << field
|
|
yield field if block_given?
|
|
field
|
|
end
|
|
|
|
def has_fields?
|
|
@fields.present?
|
|
end
|
|
|
|
def on_update(&block)
|
|
@updater = block
|
|
end
|
|
end
|
|
end
|