Added images to the first and last step of the wizard
|
@ -34,6 +34,12 @@ export default Ember.Component.extend({
|
|||
@computed('step.index')
|
||||
showBackButton: index => index > 0,
|
||||
|
||||
@computed('step.banner')
|
||||
bannerImage(src) {
|
||||
if (!src) { return; }
|
||||
return `/images/wizard/${src}`;
|
||||
},
|
||||
|
||||
@observes('step.id')
|
||||
_stepChanged() {
|
||||
this.set('saving', false);
|
||||
|
|
|
@ -3,10 +3,15 @@
|
|||
<h1 class='wizard-step-title'>{{step.title}}</h1>
|
||||
{{/if}}
|
||||
|
||||
{{#if bannerImage}}
|
||||
<img src={{bannerImage}} class="wizard-step-banner">
|
||||
{{/if}}
|
||||
|
||||
{{#if step.description}}
|
||||
<p class='wizard-step-description'>{{{step.description}}}</p>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{#wizard-step-form step=step}}
|
||||
{{#each step.fields as |field|}}
|
||||
{{wizard-field field=field step=step wizard=wizard}}
|
||||
|
|
|
@ -62,7 +62,7 @@ body.wizard {
|
|||
border: 1px solid #ccc;
|
||||
|
||||
.wizard-step-contents {
|
||||
min-height: 460px;
|
||||
min-height: 480px;
|
||||
}
|
||||
|
||||
.wizard-column-contents {
|
||||
|
@ -76,6 +76,9 @@ body.wizard {
|
|||
.wizard-step-description {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
.wizard-step-banner {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.wizard-footer {
|
||||
border-top: 1px solid #ccc;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
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
|
||||
|
||||
def id
|
||||
|
@ -47,4 +47,12 @@ class WizardStepSerializer < ApplicationSerializer
|
|||
title.present?
|
||||
end
|
||||
|
||||
def banner
|
||||
object.banner
|
||||
end
|
||||
|
||||
def include_banner?
|
||||
object.banner.present?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -3222,8 +3222,6 @@ en:
|
|||
step:
|
||||
locale:
|
||||
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:
|
||||
default_locale:
|
||||
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?)
|
||||
|
||||
@wizard.append_step('locale') do |step|
|
||||
step.banner = "welcome.png"
|
||||
|
||||
languages = step.add_field(id: 'default_locale',
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
|
@ -164,7 +166,9 @@ class Wizard
|
|||
|
||||
DiscourseEvent.trigger(:build_wizard, @wizard)
|
||||
|
||||
@wizard.append_step('finished')
|
||||
@wizard.append_step('finished') do |step|
|
||||
step.banner = "finished.png"
|
||||
end
|
||||
@wizard
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class Wizard
|
||||
class Step
|
||||
attr_reader :id, :updater
|
||||
attr_accessor :index, :fields, :next, :previous
|
||||
attr_accessor :index, :fields, :next, :previous, :banner
|
||||
|
||||
def initialize(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 |