Browse Source

Separate raw and cooked descriptions

Angus McLeod 7 years ago
parent
commit
f3588dbe89

+ 2 - 2
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,

+ 1 - 1
assets/javascripts/discourse/templates/components/wizard-custom-step.hbs

@@ -39,7 +39,7 @@
     <h3>{{i18n 'admin.wizard.step.description'}}</h3>
   </div>
   <div class="setting-value">
-    {{d-editor value=step.description placeholder="admin.wizard.custom_text_placeholder"}}
+    {{d-editor value=step.raw_description placeholder="admin.wizard.custom_text_placeholder"}}
   </div>
 </div>
 

+ 1 - 1
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']) || {}