Added images to the first and last step of the wizard
|
@ -34,6 +34,12 @@ export default Ember.Component.extend({
|
||||||
@computed('step.index')
|
@computed('step.index')
|
||||||
showBackButton: index => index > 0,
|
showBackButton: index => index > 0,
|
||||||
|
|
||||||
|
@computed('step.banner')
|
||||||
|
bannerImage(src) {
|
||||||
|
if (!src) { return; }
|
||||||
|
return `/images/wizard/${src}`;
|
||||||
|
},
|
||||||
|
|
||||||
@observes('step.id')
|
@observes('step.id')
|
||||||
_stepChanged() {
|
_stepChanged() {
|
||||||
this.set('saving', false);
|
this.set('saving', false);
|
||||||
|
|
|
@ -3,10 +3,15 @@
|
||||||
<h1 class='wizard-step-title'>{{step.title}}</h1>
|
<h1 class='wizard-step-title'>{{step.title}}</h1>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if bannerImage}}
|
||||||
|
<img src={{bannerImage}} class="wizard-step-banner">
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if step.description}}
|
{{#if step.description}}
|
||||||
<p class='wizard-step-description'>{{{step.description}}}</p>
|
<p class='wizard-step-description'>{{{step.description}}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{#wizard-step-form step=step}}
|
{{#wizard-step-form step=step}}
|
||||||
{{#each step.fields as |field|}}
|
{{#each step.fields as |field|}}
|
||||||
{{wizard-field field=field step=step wizard=wizard}}
|
{{wizard-field field=field step=step wizard=wizard}}
|
||||||
|
|
|
@ -62,7 +62,7 @@ body.wizard {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
|
||||||
.wizard-step-contents {
|
.wizard-step-contents {
|
||||||
min-height: 460px;
|
min-height: 480px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wizard-column-contents {
|
.wizard-column-contents {
|
||||||
|
@ -76,6 +76,9 @@ body.wizard {
|
||||||
.wizard-step-description {
|
.wizard-step-description {
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
.wizard-step-banner {
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
.wizard-footer {
|
.wizard-footer {
|
||||||
border-top: 1px solid #ccc;
|
border-top: 1px solid #ccc;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class WizardStepSerializer < ApplicationSerializer
|
class WizardStepSerializer < ApplicationSerializer
|
||||||
|
|
||||||
attributes :id, :next, :previous, :description, :title, :index
|
attributes :id, :next, :previous, :description, :title, :index, :banner
|
||||||
has_many :fields, serializer: WizardFieldSerializer, embed: :objects
|
has_many :fields, serializer: WizardFieldSerializer, embed: :objects
|
||||||
|
|
||||||
def id
|
def id
|
||||||
|
@ -47,4 +47,12 @@ class WizardStepSerializer < ApplicationSerializer
|
||||||
title.present?
|
title.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def banner
|
||||||
|
object.banner
|
||||||
|
end
|
||||||
|
|
||||||
|
def include_banner?
|
||||||
|
object.banner.present?
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3222,8 +3222,6 @@ en:
|
||||||
step:
|
step:
|
||||||
locale:
|
locale:
|
||||||
title: "Welcome to your Discourse!"
|
title: "Welcome to your Discourse!"
|
||||||
description: "Before you launch your new Discourse community, we’ll need to configure a few things together first. You can come back and change these settings any time."
|
|
||||||
|
|
||||||
fields:
|
fields:
|
||||||
default_locale:
|
default_locale:
|
||||||
description: "What’s the default language for your community?"
|
description: "What’s the default language for your community?"
|
||||||
|
|
|
@ -9,6 +9,8 @@ class Wizard
|
||||||
return @wizard unless SiteSetting.wizard_enabled? && @wizard.user.try(:staff?)
|
return @wizard unless SiteSetting.wizard_enabled? && @wizard.user.try(:staff?)
|
||||||
|
|
||||||
@wizard.append_step('locale') do |step|
|
@wizard.append_step('locale') do |step|
|
||||||
|
step.banner = "welcome.png"
|
||||||
|
|
||||||
languages = step.add_field(id: 'default_locale',
|
languages = step.add_field(id: 'default_locale',
|
||||||
type: 'dropdown',
|
type: 'dropdown',
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -164,7 +166,9 @@ class Wizard
|
||||||
|
|
||||||
DiscourseEvent.trigger(:build_wizard, @wizard)
|
DiscourseEvent.trigger(:build_wizard, @wizard)
|
||||||
|
|
||||||
@wizard.append_step('finished')
|
@wizard.append_step('finished') do |step|
|
||||||
|
step.banner = "finished.png"
|
||||||
|
end
|
||||||
@wizard
|
@wizard
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Wizard
|
class Wizard
|
||||||
class Step
|
class Step
|
||||||
attr_reader :id, :updater
|
attr_reader :id, :updater
|
||||||
attr_accessor :index, :fields, :next, :previous
|
attr_accessor :index, :fields, :next, :previous, :banner
|
||||||
|
|
||||||
def initialize(id)
|
def initialize(id)
|
||||||
@id = id
|
@id = id
|
||||||
|
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
BIN
public/images/wizard/finished.png
Normal file
After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 5.9 KiB |
BIN
public/images/wizard/welcome.png
Normal file
After Width: | Height: | Size: 36 KiB |