1
0
Fork 0

Use wizard name in no access messages

Dieser Commit ist enthalten in:
Angus McLeod 2019-06-19 13:39:39 +08:00
Ursprung aa7dd16827
Commit 20f605b899
5 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -10,4 +10,4 @@ export default Ember.Component.extend({
CustomWizard.skip(this.get('wizardId')); CustomWizard.skip(this.get('wizardId'));
} }
} }
}) });

Datei anzeigen

@ -17,10 +17,12 @@ export default Ember.Route.extend({
const minTrust = model.get('min_trust'); const minTrust = model.get('min_trust');
const wizardId = model.get('id'); const wizardId = model.get('id');
const user = model.get('user'); const user = model.get('user');
const name = model.get('name');
controller.setProperties({ controller.setProperties({
requiresLogin: !user, requiresLogin: !user,
user, user,
name,
completed, completed,
notPermitted: !permitted, notPermitted: !permitted,
minTrust, minTrust,

Datei anzeigen

@ -2,13 +2,13 @@
{{wizard-no-access text=(i18n 'wizard.none') wizardId=wizardId}} {{wizard-no-access text=(i18n 'wizard.none') wizardId=wizardId}}
{{else}} {{else}}
{{#if requiresLogin}} {{#if requiresLogin}}
{{wizard-no-access text=(i18n 'wizard.requires_login' level=minTrust) wizardId=wizardId}} {{wizard-no-access text=(i18n 'wizard.requires_login' name=name) wizardId=wizardId}}
{{else}} {{else}}
{{#if notPermitted}} {{#if notPermitted}}
{{wizard-no-access text=(i18n 'wizard.not_permitted' level=minTrust) wizardId=wizardId}} {{wizard-no-access text=(i18n 'wizard.not_permitted' name=name level=minTrust) wizardId=wizardId}}
{{else}} {{else}}
{{#if completed}} {{#if completed}}
{{wizard-no-access text=(i18n 'wizard.completed') wizardId=wizardId}} {{wizard-no-access text=(i18n 'wizard.completed' name=name) wizardId=wizardId}}
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}

Datei anzeigen

@ -177,11 +177,11 @@ en:
filter_placeholder: "Search..." filter_placeholder: "Search..."
wizard: wizard:
completed: "You have completed this wizard." completed: "You have completed the {{name}} wizard."
not_permitted: "You need to be trust level {{level}} or higher to access this wizard." not_permitted: "You need to be trust level {{level}} or higher to access the {{name}} wizard."
none: "There is no wizard here." none: "There is no wizard here."
return_to_site: "Return to {{siteName}}" return_to_site: "Return to {{siteName}}"
requires_login: "You need to be logged in to access this wizard." requires_login: "You need to be logged in to access the {{name}} wizard."
wizard_composer: wizard_composer:
show_preview: "Preview Post" show_preview: "Preview Post"

Datei anzeigen

@ -64,7 +64,7 @@ class ::Wizard::Step
end end
::WizardSerializer.class_eval do ::WizardSerializer.class_eval do
attributes :id, :background, :completed, :required, :min_trust, :permitted, :user attributes :id, :name, :background, :completed, :required, :min_trust, :permitted, :user
def id def id
object.id object.id
@ -74,6 +74,10 @@ end
object.respond_to?(:id) object.respond_to?(:id)
end end
def name
object.name
end
def background def background
object.background object.background
end end