custom-wizard-edits.js.es6 784 B

12345678910111213141516171819202122232425
  1. import { withPluginApi } from 'discourse/lib/plugin-api';
  2. export default {
  3. name: 'custom-wizard-edits',
  4. initialize() {
  5. withPluginApi('0.8.12', api => {
  6. api.modifyClass('component:global-notice', {
  7. buildBuffer(buffer) {
  8. this._super(...arguments);
  9. const wizards = this.site.get('complete_custom_wizard');
  10. if (wizards) {
  11. wizards.forEach((w) => {
  12. const text = I18n.t('wizard.complete_custom', {
  13. wizard_url: w.url,
  14. wizard_name: w.name,
  15. site_name: this.siteSettings.title
  16. });
  17. buffer.push(`<div class='row'><div class='alert alert-info alert-wizard'>${text}</div></div>`);
  18. });
  19. }
  20. }
  21. });
  22. });
  23. }
  24. };