Added images to the first and last step of the wizard

This commit is contained in:
Robin Ward 2016-09-20 13:25:56 -04:00
parent b0ee7930e8
commit 9938f9bd67
13 changed files with 30 additions and 6 deletions

View file

@ -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);

View file

@ -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}}

View file

@ -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;

View file

@ -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

View file

@ -3222,8 +3222,6 @@ en:
step:
locale:
title: "Welcome to your Discourse!"
description: "Before you launch your new Discourse community, well need to configure a few things together first. You can come back and change these settings any time."
fields:
default_locale:
description: "Whats the default language for your community?"

View file

@ -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

View file

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB