mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Track steps the user has completed, nag them to finish it.
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user