Track steps the user has completed, nag them to finish it.

This commit is contained in:
Robin Ward
2016-09-14 16:36:08 -04:00
parent ef84981e38
commit 29cf47cfb2
21 changed files with 290 additions and 19 deletions

View File

@@ -36,7 +36,10 @@ export default Ember.Component.extend({
@computed()
shouldSee() {
return Discourse.User.currentProp('admin') && this.siteSettings.show_create_topics_notice;
const user = this.currentUser;
return user && user.get('admin') &&
this.siteSettings.show_create_topics_notice &&
!this.site.get('wizard_required');
},
@computed('enabled', 'shouldSee', 'publicTopicCount', 'publicPostCount')

View File

@@ -17,6 +17,10 @@ export default Ember.Component.extend(StringBuffer, {
notices.push([I18n.t("emails_are_disabled"), 'alert-emails-disabled']);
}
if (this.site.get('wizard_required')) {
notices.push([I18n.t('wizard_required'), 'alert-wizard']);
}
if (this.currentUser && this.currentUser.get('staff') && this.siteSettings.bootstrap_mode_enabled) {
if (this.siteSettings.bootstrap_mode_min_users > 0) {
notices.push([I18n.t("bootstrap_mode_enabled", {min_users: this.siteSettings.bootstrap_mode_min_users}), 'alert-bootstrap-mode']);

View File

@@ -9,6 +9,9 @@ export default Ember.Component.extend({
this.autoFocus();
},
@computed('step.index')
showQuitButton: index => index === 0,
@computed('step.displayIndex', 'wizard.totalSteps')
showNextButton: (current, total) => current < total,
@@ -49,6 +52,10 @@ export default Ember.Component.extend({
},
actions: {
quit() {
document.location = "/";
},
backStep() {
if (this.get('saving')) { return; }
this.sendAction('goBack');

View File

@@ -21,6 +21,13 @@
</div>
<div class='wizard-buttons'>
{{#if showQuitButton}}
<button class='wizard-btn danger' {{action "quit"}} disabled={{saving}}>
{{fa-icon "chevron-left"}}
{{i18n "wizard.quit"}}
</button>
{{/if}}
{{#if showBackButton}}
<button class='wizard-btn back' {{action "backStep"}} disabled={{saving}}>
{{fa-icon "chevron-left"}}
@@ -36,7 +43,7 @@
{{/if}}
{{#if showDoneButton}}
<button class='wizard-btn done' {{action "finished"}} disabled={{saving}}>
<button class='wizard-btn done' {{action "quit"}} disabled={{saving}}>
{{fa-icon "check"}}
{{i18n "wizard.done"}}
</button>