From 9f40821db0f9a16a14d170ccab9d4a7a2cc66515 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 6 Oct 2017 10:59:02 +0800 Subject: [PATCH] Various --- .../components/wizard-custom-action.js.es6 | 7 +- .../components/wizard-custom-field.js.es6 | 15 ++- .../components/wizard-custom-step.js.es6 | 95 +++++++++++++-- .../discourse/controllers/admin-wizard.js.es6 | 54 ++++++++- .../discourse/models/custom-wizard.js.es6 | 8 +- .../discourse/routes/admin-wizard.js.es6 | 12 +- .../routes/admin-wizards-custom.js.es6 | 6 + .../routes/admin-wizards-submissions.js.es6 | 6 + .../templates/admin-wizard-submissions.hbs | 30 ++--- .../discourse/templates/admin-wizard.hbs | 49 +++++--- .../templates/admin-wizards-custom-index.hbs | 8 +- .../templates/admin-wizards-custom.hbs | 7 +- .../templates/admin-wizards-submissions.hbs | 2 +- .../components/wizard-custom-action.hbs | 110 ++++++++++++++---- .../components/wizard-custom-choice.hbs | 1 - .../components/wizard-custom-field.hbs | 70 +++++++---- .../components/wizard-custom-step.hbs | 66 +++++++---- .../wizard/initializers/custom.js.es6 | 11 ++ assets/stylesheets/custom_wizard.scss | 75 ++++++++++++ config/locales/client.en.yml | 51 ++++---- 20 files changed, 526 insertions(+), 157 deletions(-) delete mode 100644 assets/javascripts/discourse/templates/components/wizard-custom-choice.hbs diff --git a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 index 4ed3b225..8179def1 100644 --- a/assets/javascripts/discourse/components/wizard-custom-action.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-action.js.es6 @@ -1,11 +1,8 @@ export default Ember.Component.extend({ + classNames: 'wizard-custom-action', types: ['create_topic', 'update_profile', 'send_message'], profileFields: ['name', 'username', 'email'], createTopic: Ember.computed.equal('action.type', 'create_topic'), updateProfile: Ember.computed.equal('action.type', 'update_profile'), - sendMessage: Ember.computed.equal('action.type', 'send_message'), - - test: function() { - console.log(this.get('stepFields')); - }.observes('stepFields.[]') + sendMessage: Ember.computed.equal('action.type', 'send_message') }); diff --git a/assets/javascripts/discourse/components/wizard-custom-field.js.es6 b/assets/javascripts/discourse/components/wizard-custom-field.js.es6 index e2693e40..fc3698b1 100644 --- a/assets/javascripts/discourse/components/wizard-custom-field.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-field.js.es6 @@ -1,9 +1,11 @@ -import { observes } from 'ember-addons/ember-computed-decorators'; +import { default as computed, on, observes } from 'ember-addons/ember-computed-decorators'; export default Ember.Component.extend({ classNames: 'wizard-custom-field', isDropdown: Ember.computed.equal('field.type', 'dropdown'), + @on('init') + @observes('field.id') init() { this._super(...arguments); @@ -12,15 +14,16 @@ export default Ember.Component.extend({ } }, - @observes('field.label') - setFieldId() { - const label = this.get('field.label'); - this.set('field.id', Ember.String.underscore(label)); - }, + @computed('field.choices.[]') + dropdownChoices: choices => choices, actions: { addChoice() { this.get('field.choices').pushObject(Ember.Object.create()); + }, + + removeChoice(c) { + this.get('field.choices').removeObject(c); } } }); diff --git a/assets/javascripts/discourse/components/wizard-custom-step.js.es6 b/assets/javascripts/discourse/components/wizard-custom-step.js.es6 index 9f7139bc..7127575c 100644 --- a/assets/javascripts/discourse/components/wizard-custom-step.js.es6 +++ b/assets/javascripts/discourse/components/wizard-custom-step.js.es6 @@ -1,26 +1,103 @@ -import { default as computed } from 'ember-addons/ember-computed-decorators'; +import { default as computed, on, observes } from 'ember-addons/ember-computed-decorators'; export default Ember.Component.extend({ classNames: 'wizard-custom-step', + currentField: null, + currentAction: null, - @computed('step.fields.@each.id') - allowAddAction: stepFields => stepFields.get('firstObject.id'), + @on('init') + @observes('step.id') + setup() { + this._super(...arguments); + const fields = this.get('step.fields'); + const actions = this.get('step.actions'); + this.set('currentField', fields[0]); + this.set('currentAction', actions[0]); + }, + + @computed('step.fields.[]', 'currentField') + fieldLinks(fields, current) { + return fields.map((f) => { + if (f) { + let link = { + id: f.get('id'), + label: f.get('label') + }; + + let classes = 'btn'; + if (current && f.get('id') === current.get('id')) { + classes += ' btn-primary'; + }; + + link['classes'] = classes; + + return link; + } + }); + }, + + @computed('step.actions.[]', 'currentAction') + actionLinks(actions, current) { + return actions.map((a) => { + if (a) { + let link = { + id: a.get('id'), + label: a.get('label') + }; + + let classes = 'btn'; + if (current && a.get('id') === current.get('id')) { + classes += ' btn-primary'; + }; + + link['classes'] = classes; + + return link; + } + }); + }, actions: { addField() { - this.get('step.fields').pushObject(Ember.Object.create({ id: '', label: '' })); + const fields = this.get('step.fields'); + const newNum = fields.length + 1; + const field = Ember.Object.create({ + id: `field-${newNum}`, label: `Field ${newNum}` + }); + fields.pushObject(field); + this.set('currentField', field); }, addAction() { - this.get('step.actions').pushObject(Ember.Object.create({ id: '', label: '' })); + const actions = this.get('step.actions'); + const newNum = actions.length + 1; + const action = Ember.Object.create({ + id: `action-${newNum}`, label: `Action ${newNum}` + }); + actions.pushObject(action); + this.set('currentAction', action); }, - removeField(field) { - this.get('step.fields').removeObject(field); + removeField(fieldId) { + const fields = this.get('step.fields'); + fields.removeObject(fields.findBy('id', fieldId)); + this.set('currentField', fields[fields.length - 1]); }, - removeAction(action) { - this.get('step.actions').removeObject(action); + removeAction(actionId) { + const actions = this.get('step.actions'); + actions.removeObject(actions.findBy('id', actionId)); + this.set('currentAction', actions[actions.length - 1]); + }, + + changeField(fieldId) { + const fields = this.get('step.fields'); + this.set('currentField', fields.findBy('id', fieldId)); + }, + + changeAction(actionId) { + const actions = this.get('step.actions'); + this.set('currentAction', actions.findBy('id', actionId)); } } }); diff --git a/assets/javascripts/discourse/controllers/admin-wizard.js.es6 b/assets/javascripts/discourse/controllers/admin-wizard.js.es6 index d4652ec4..7c343bde 100644 --- a/assets/javascripts/discourse/controllers/admin-wizard.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizard.js.es6 @@ -1,8 +1,37 @@ +import { default as computed } from 'ember-addons/ember-computed-decorators'; + export default Ember.Controller.extend({ + + @computed('model.steps.[]', 'currentStep') + stepLinks(steps, currentStep) { + return steps.map((s) => { + if (s) { + let link = { + id: s.get('id'), + title: s.get('title') + }; + + let classes = 'btn'; + if (currentStep && s.get('id') === currentStep.get('id')) { + classes += ' btn-primary'; + }; + + link['classes'] = classes; + + return link; + } + }); + }, + + @computed('model.id') + wizardUrl(wizardId) { + return window.location.origin + '/wizard/custom/' + wizardId; + }, + actions: { save() { this.get('model').save().then(() => { - this.transitionToRoute('adminWizardsCustom'); + this.send("refreshRoute"); }); }, @@ -13,14 +42,27 @@ export default Ember.Controller.extend({ }, addStep() { - this.get('model.steps').pushObject(Ember.Object.create({ + const steps = this.get('model.steps'); + const newNum = steps.length + 1; + const step = Ember.Object.create({ fields: Ember.A(), - actions: Ember.A() - })); + actions: Ember.A(), + title: `Step ${newNum}`, + id: `step-${newNum}` + }); + + steps.pushObject(step); + this.set('currentStep', step); }, - removeStep(step) { - this.get('model.steps').removeObject(step); + removeStep(stepId) { + const steps = this.get('model.steps'); + steps.removeObject(steps.findBy('id', stepId)); + }, + + changeStep(stepId) { + const steps = this.get('model.steps'); + this.set('currentStep', steps.findBy('id', stepId)); } } }); diff --git a/assets/javascripts/discourse/models/custom-wizard.js.es6 b/assets/javascripts/discourse/models/custom-wizard.js.es6 index 50d7ea55..fad4b470 100644 --- a/assets/javascripts/discourse/models/custom-wizard.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard.js.es6 @@ -8,9 +8,7 @@ const CustomWizard = Discourse.Model.extend({ }, @computed('name') - id(name) { - return name ? Ember.String.dasherize(name) : null; - }, + id: (name) => name ? Ember.String.dasherize(name) : null, save() { const stepsObj = this.get('steps'); @@ -36,11 +34,12 @@ const CustomWizard = Discourse.Model.extend({ c.set('id', c.get('label')); }); } + step['fields'].push(f); }); s.actions.forEach((a) => { - a['id'] = Ember.String.dasherize(a.label); + a.set('id', Ember.String.dasherize(a.get('label'))); step['actions'].push(a); }); @@ -128,6 +127,7 @@ CustomWizard.reopenClass({ id: s.id, title: s.title, description: s.description, + banner: s.banner, fields, actions })); diff --git a/assets/javascripts/discourse/routes/admin-wizard.js.es6 b/assets/javascripts/discourse/routes/admin-wizard.js.es6 index 493aedc8..d260f253 100644 --- a/assets/javascripts/discourse/routes/admin-wizard.js.es6 +++ b/assets/javascripts/discourse/routes/admin-wizard.js.es6 @@ -21,7 +21,15 @@ export default Discourse.Route.extend({ }, setupController(controller, model) { - controller.set("new", this.get('new')); - controller.set("model", model); + let props = { new: this.get('new'), model }; + const steps = model.get('steps'); + if (steps[0]) props['currentStep'] = steps[0]; + controller.setProperties(props); + }, + + actions: { + refreshRoute() { + this.refresh(); + } } }); diff --git a/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6 b/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6 index 517375ba..10fa40b9 100644 --- a/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6 +++ b/assets/javascripts/discourse/routes/admin-wizards-custom.js.es6 @@ -5,6 +5,12 @@ export default Discourse.Route.extend({ return CustomWizard.findAll(); }, + afterModel(model, transition) { + if (transition.intent.name !== 'adminWizard' && model.length > 0) { + this.transitionTo('adminWizard', model[0].id); + } + }, + setupController(controller, model){ controller.set("model", model.toArray()); }, diff --git a/assets/javascripts/discourse/routes/admin-wizards-submissions.js.es6 b/assets/javascripts/discourse/routes/admin-wizards-submissions.js.es6 index a014e8e3..a30cdd5b 100644 --- a/assets/javascripts/discourse/routes/admin-wizards-submissions.js.es6 +++ b/assets/javascripts/discourse/routes/admin-wizards-submissions.js.es6 @@ -5,6 +5,12 @@ export default Discourse.Route.extend({ return CustomWizard.findAllSubmissions(); }, + afterModel(model, transition) { + if (transition.intent.name !== 'adminWizardSubmissions' && model.length > 0) { + this.transitionTo('adminWizardSubmissions', model[0].id); + } + }, + setupController(controller, model){ controller.set("model", model); } diff --git a/assets/javascripts/discourse/templates/admin-wizard-submissions.hbs b/assets/javascripts/discourse/templates/admin-wizard-submissions.hbs index 3c20109d..1effd84f 100644 --- a/assets/javascripts/discourse/templates/admin-wizard-submissions.hbs +++ b/assets/javascripts/discourse/templates/admin-wizard-submissions.hbs @@ -1,14 +1,16 @@ - - {{#each model.submissions as |s|}} - - {{#each-in s as |k v|}} - - {{/each-in}} - - - {{#each-in s as |k v|}} - - {{/each-in}} - - {{/each}} -
{{k}}
{{v}}
+
+ + {{#each model.submissions as |s|}} + + {{#each-in s as |k v|}} + + {{/each-in}} + + + {{#each-in s as |k v|}} + + {{/each-in}} + + {{/each}} +
{{k}}
{{v}}
+
diff --git a/assets/javascripts/discourse/templates/admin-wizard.hbs b/assets/javascripts/discourse/templates/admin-wizard.hbs index 6870852b..7a8516fc 100644 --- a/assets/javascripts/discourse/templates/admin-wizard.hbs +++ b/assets/javascripts/discourse/templates/admin-wizard.hbs @@ -1,22 +1,45 @@ -
-
- - {{text-field name="name" value=model.name placeholderKey="admin.wizard.name_placeholder"}} +
+ +
+ {{i18n 'admin.wizard.header'}}
-
- {{input type='checkbox' checked=model.save_submissions}} - {{i18n 'admin.wizard.save_submissions'}} +
+
+

{{i18n 'admin.wizard.name'}}

+
+
+ {{text-field name="name" value=model.name placeholderKey="admin.wizard.name_placeholder"}} +
- {{#if model.steps}} - {{#each model.steps as |s|}} - {{wizard-custom-step step=s fieldTypes=model.fieldTypes}} - {{d-button action='removeStep' actionParam=s label='admin.wizard.step.remove'}} +
+
+

{{i18n 'admin.wizard.save_submissions'}}

+
+
+ {{input type='checkbox' checked=model.save_submissions}} + {{i18n 'admin.wizard.save_submissions_label'}} +
+
+ +
+
+

{{i18n 'admin.wizard.url'}}

+
+ {{wizardUrl}} +
+ + - {{d-button action='addStep' label='admin.wizard.step.add'}} + {{wizard-custom-step step=currentStep fieldTypes=model.fieldTypes}}
diff --git a/assets/javascripts/discourse/templates/admin-wizards-custom-index.hbs b/assets/javascripts/discourse/templates/admin-wizards-custom-index.hbs index 5ee1e574..e9c27e0b 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-custom-index.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-custom-index.hbs @@ -1,7 +1 @@ -
-
- {{#link-to 'adminWizard' 'new' class="btn"}} - {{d-icon "plus"}} {{i18n 'admin.wizard.new'}} - {{/link-to}} -
-
+
diff --git a/assets/javascripts/discourse/templates/admin-wizards-custom.hbs b/assets/javascripts/discourse/templates/admin-wizards-custom.hbs index f5939d37..2e693ee2 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-custom.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-custom.hbs @@ -7,9 +7,14 @@ {{/each}} +
+ {{#link-to 'adminWizard' 'new' class="btn"}} + {{d-icon "plus"}} {{i18n 'admin.wizard.new'}} + {{/link-to}} +
-
+
{{outlet}}
diff --git a/assets/javascripts/discourse/templates/admin-wizards-submissions.hbs b/assets/javascripts/discourse/templates/admin-wizards-submissions.hbs index fb5e019e..5dbcabc8 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-submissions.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-submissions.hbs @@ -9,7 +9,7 @@
-
+
{{outlet}}
diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs index 2a2aec51..c7b912bb 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-action.hbs @@ -1,26 +1,96 @@ -{{combo-box value=action.type content=types}} +
+
+

{{i18n "admin.wizard.action.label"}}

+
+
+ {{input value=action.label}} +
+
+ +
+
+

{{i18n "admin.wizard.action.type"}}

+
+
+ {{combo-box value=action.type content=types}} +
+
+ + {{#if createTopic}} - - {{category-select-box value=action.category_id}} - - {{combo-box value=action.title content=stepFields nameProperty="label"}} - - {{combo-box value=action.post content=stepFields nameProperty="label"}} +
+
+

{{i18n "admin.wizard.action.create_topic.category"}}

+
+
+ {{category-select-box value=action.category_id}} +
+
+ +
+
+

{{i18n "admin.wizard.action.create_topic.title"}}

+
+
+ {{combo-box value=action.title content=stepFields nameProperty="label"}} +
+
+ +
+
+

{{i18n "admin.wizard.action.create_topic.post"}}

+
+
+ {{combo-box value=action.post content=stepFields nameProperty="label"}} +
+
{{/if}} + {{#if sendMessage}} - - {{combo-box value=action.title content=stepFields nameProperty="label"}} - - {{combo-box value=action.post content=stepFields nameProperty="label"}} - - {{user-selector single="true" - includeMentionableGroups="true" - usernames=action.username - allowedUsers="true"}} +
+
+

{{i18n "admin.wizard.action.send_message.title"}}

+
+
+ {{combo-box value=action.title content=stepFields nameProperty="label"}} +
+
+
+
+

{{i18n "admin.wizard.action.send_message.post"}}

+
+
+ {{combo-box value=action.post content=stepFields nameProperty="label"}} +
+
+
+
+

{{i18n "admin.wizard.action.send_message.recipient"}}

+
+
+ {{user-selector single="true" + includeMentionableGroups="true" + usernames=action.username + allowedUsers="true"}} +
+
{{/if}} + {{#if updateProfile}} - - {{combo-box value=action.source content=stepFields nameProperty="label"}} - - {{combo-box value=action.profile_field content=profileFields}} +
+
+

{{i18n "admin.wizard.action.source"}}

+
+
+ {{combo-box value=action.source content=stepFields nameProperty="label"}} +
+
+
+
+

{{i18n "admin.wizard.action.profile_field"}}

+
+
+ {{combo-box value=action.profile_field content=profileFields}} +
+
{{/if}} diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-choice.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-choice.hbs deleted file mode 100644 index 6926ded3..00000000 --- a/assets/javascripts/discourse/templates/components/wizard-custom-choice.hbs +++ /dev/null @@ -1 +0,0 @@ -{{input type='text' value=choice.label}} diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs index ca178c8a..2e237f70 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-field.hbs @@ -1,25 +1,51 @@ -
-
- {{i18n 'admin.wizard.field.label'}} - {{text-field name="label" value=field.label}} +
+
+

{{i18n 'admin.wizard.field.label'}}

-
- {{i18n 'admin.wizard.field.description'}} - {{text-field name="description" value=field.description}} -
-
- {{i18n 'admin.wizard.field.type'}} - {{combo-box value=field.type content=types}} -
- {{#if isDropdown}} - {{i18n 'admin.wizard.field.choices_label'}} - {{#each field.choices as |c|}} - {{wizard-custom-choice choice=c}} - {{/each}} - {{d-button action='addChoice' label='admin.wizard.field.add_choice'}} - {{/if}} -
- {{i18n 'admin.wizard.field.required'}} - {{input type='checkbox' checked=field.required}} +
+ {{input name="label" value=field.label}}
+ +
+
+

{{i18n 'admin.wizard.field.description'}}

+
+
+ {{textarea name="description" value=field.description}} +
+
+ +
+
+

{{i18n 'admin.wizard.field.type'}}

+
+
+ {{combo-box value=field.type content=types}} +
+
+ +
+
+

{{i18n 'admin.wizard.field.required'}}

+
+
+ {{input type='checkbox' checked=field.required}} + {{i18n 'admin.wizard.field.required_label'}} +
+
+ +{{#if isDropdown}} +
+
+ {{i18n 'admin.wizard.field.choices_label'}} +
+ {{#each dropdownChoices as |c|}} + + {{input type='text' value=c.label}} + + {{d-button action='removeChoice' actionParam=c icon='times'}} + {{/each}} + {{d-button action='addChoice' label='admin.wizard.add' icon='plus'}} +
+{{/if}} diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs index 641069e4..3f428c43 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs @@ -1,30 +1,52 @@ -
- - {{text-field name="title" value=step.title placeholderKey="admin.wizard.step.title_placeholder"}} +
+
+

{{i18n 'admin.wizard.step.title'}}

+
+
+ {{input name="title" value=step.title placeholderKey="admin.wizard.step.title_placeholder"}} +
-
- - {{input name="banner" value=step.banner placeholderKey="admin.wizard.step.banner_placeholder"}} +
+
+

{{i18n 'admin.wizard.step.banner'}}

+
+
+ {{input name="banner" value=step.banner placeholderKey="admin.wizard.step.banner_placeholder"}} +
-
- - {{input name="description" value=step.description placeholderKey="admin.wizard.step.description_placeholder"}} +
+
+

{{i18n 'admin.wizard.step.description'}}

+
+
+ {{textarea name="description" value=step.description placeholderKey="admin.wizard.step.description_placeholder"}} +
-{{#each step.fields as |f|}} - {{wizard-custom-field field=f types=fieldTypes}} - {{d-button action='removeField' actionParam=f label="admin.wizard.field.remove"}} -{{/each}} + -{{d-button action='addField' label='admin.wizard.field.add'}} - -{{#each step.actions as |a|}} - {{wizard-custom-action action=a stepFields=step.fields}} - {{d-button action='removeAction' actionParam=a label="admin.wizard.action.remove"}} -{{/each}} - -{{#if allowAddAction}} - {{d-button action='addAction' label='admin.wizard.action.add'}} +{{#if currentField}} + {{wizard-custom-field field=currentField types=fieldTypes removeField="removeField"}} +{{/if}} + + + +{{#if currentAction}} + {{wizard-custom-action action=currentAction stepFields=step.fields removeAction="removeAction"}} {{/if}} diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 078c9b4d..ab47a6bf 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -65,6 +65,17 @@ export default { }); WizardStep.reopen({ + bannerImage: function() { + const src = this.get('step.banner'); + if (!src) return; + + if (src.indexOf('/uploads/') > -1) { + return getUrl(src); + } else { + return getUrl(`/images/wizard/${src}`); + }; + }.property('step.banner'), + advance() { this.set('saving', true); this.get('step').save() diff --git a/assets/stylesheets/custom_wizard.scss b/assets/stylesheets/custom_wizard.scss index 47b1d901..cdae128e 100644 --- a/assets/stylesheets/custom_wizard.scss +++ b/assets/stylesheets/custom_wizard.scss @@ -1,3 +1,78 @@ .wizards-nav-button { @extend .nav-pills; + float: left; +} + +.new-wizard { + margin-top: 15px; +} + +.wizard-header { + font-size: 1.3em; + margin-bottom: 15px; + + &.medium { + font-size: 1.1em; + } + + &.small { + font-size: 0.97em; + } +} + +.content-list + .content { + overflow: hidden; +} + +.admin-wizard.settings { + margin-left: 30px; + margin-right: 30px; + + .setting { + display: inline-block; + vertical-align: top; + min-width: 49%; + + .setting-label { + width: 20%; + } + + &.full { + width: 100%; + + .setting-label { + width: 75px; + } + } + } +} + +.wizard-links { + margin-bottom: 20px; + + .remove { + margin-right: 10px; + } +} + +.wizard-custom-step { + display: inline-block; + width: 100%; + margin-bottom: 20px; + padding: 15px; + background-color: dark-light-diff($primary, $secondary, 96%, -65%); +} + +.wizard-dropdown-choices { + margin-bottom: 25px; +} + +.wizard-dropdown-choice { + display: inline-block; +} + +.wizard-submissions { + padding: 0 20px; + display: inline-block; + overflow: scroll; } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index a955b6fb..f5c97c4b 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -8,41 +8,44 @@ en: submissions_label: "Submissions" name: "Name" name_placeholder: "name of the wizard" - save_submissions: "Save wizard submissions" - save: "Save Wizard" + save_submissions: "Save" + save_submissions_label: "Save wizard submissions" + save: "Save Changes" remove: "Delete Wizard" + header: "Wizard" + add: "Add" + url: "Url" step: - title: "Step Title" + header: "Steps" + title: "Title" title_placeholder: "This will appear at the top of the step" - banner: "Step Banner" - banner_placeholder: "This image will appear under the title" - description: "Step Description" + banner: "Banner" + banner_placeholder: "Image url" + description: "Description" description_placeholder: "This will appear underneath the title and / or title" - add: "Add Step" - remove: "Remove Step" field: - add: "Add Field" - remove: "Remove Field" - label: "Field Name" - description: "Field Description" - type: "Field Type" + header: "Fields" + label: "Label" + description: "Description" + type: "Type" choices_label: "Dropdown Choices" - add_choice: "Add Choice" - required: "Field Required" + add_choice: "Add" + required: "Required" + required_label: "Field is Required" action: - add: "Add Action" - remove: "Remove Action" - source: "Source" + header: "Actions" + label: "Label" + type: "Type" send_message: label: "Send Message" - title: "Message Title" - post: "Message Post" - recipient: "Message Recipient" + title: "Title" + post: "Post" + recipient: "Recipient" create_topic: label: "Create Topic" - title: "Topic Title" - post: "Topic Post" - category: "Topic Category" + title: "Title" + post: "Post" + category: "Category" update_profile: label: "Update Profile" field: "Profile Field"