From f3588dbe8918973ade32cfed6b5a939535c2e588 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 3 Nov 2017 16:22:50 +0800 Subject: [PATCH] Separate raw and cooked descriptions --- assets/javascripts/discourse/models/custom-wizard.js.es6 | 4 ++-- .../discourse/templates/components/wizard-custom-step.hbs | 2 +- controllers/admin.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/discourse/models/custom-wizard.js.es6 b/assets/javascripts/discourse/models/custom-wizard.js.es6 index 29fc3847..1b49360e 100644 --- a/assets/javascripts/discourse/models/custom-wizard.js.es6 +++ b/assets/javascripts/discourse/models/custom-wizard.js.es6 @@ -72,7 +72,7 @@ const CustomWizard = Discourse.Model.extend({ if (s.title) step['title'] = s.title; if (s.key) step['key'] = s.key; if (s.banner) step['banner'] = s.banner; - if (s.description) step['description'] = s.description; + if (s.raw_description) step['raw_description'] = s.raw_description; const fields = s.get('fields'); if (fields.length) { @@ -218,7 +218,7 @@ CustomWizard.reopenClass({ id: s.id, key: s.key, title: s.title, - description: s.description, + raw_description: s.raw_description, banner: s.banner, fields, actions, diff --git a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs index 3842621e..0722cb6d 100644 --- a/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-custom-step.hbs @@ -39,7 +39,7 @@

{{i18n 'admin.wizard.step.description'}}

- {{d-editor value=step.description placeholder="admin.wizard.custom_text_placeholder"}} + {{d-editor value=step.raw_description placeholder="admin.wizard.custom_text_placeholder"}}
diff --git a/controllers/admin.rb b/controllers/admin.rb index 057faa54..9ae19603 100644 --- a/controllers/admin.rb +++ b/controllers/admin.rb @@ -78,7 +78,7 @@ class CustomWizard::AdminController < ::ApplicationController ## end of error checks wizard['steps'].each do |s| - s['description'] = PrettyText.cook(s['description']) if s['description'] + s['description'] = PrettyText.cook(s['raw_description']) if s['raw_description'] end existing = PluginStore.get('custom_wizard', wizard['id']) || {}