Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
26 Zeilen
784 B
Text
26 Zeilen
784 B
Text
|
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||
|
|
||
|
export default {
|
||
|
name: 'custom-wizard-edits',
|
||
|
initialize() {
|
||
|
withPluginApi('0.8.12', api => {
|
||
|
api.modifyClass('component:global-notice', {
|
||
|
buildBuffer(buffer) {
|
||
|
this._super(...arguments);
|
||
|
const wizards = this.site.get('complete_custom_wizard');
|
||
|
if (wizards) {
|
||
|
wizards.forEach((w) => {
|
||
|
const text = I18n.t('wizard.complete_custom', {
|
||
|
wizard_url: w.url,
|
||
|
wizard_name: w.name,
|
||
|
site_name: this.siteSettings.title
|
||
|
});
|
||
|
buffer.push(`<div class='row'><div class='alert alert-info alert-wizard'>${text}</div></div>`);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
};
|