Browse Source

Update wizard composer

Angus McLeod 7 years ago
parent
commit
11c85270a7

+ 0 - 6
assets/javascripts/wizard/components/wizard-editor.js.es6

@@ -182,12 +182,6 @@ export default Ember.Component.extend({
   _mouseTrap: null,
   showPreview: false,
 
-  @computed('placeholder')
-  placeholderTranslated(placeholder) {
-    if (placeholder) return I18n.t(placeholder);
-    return null;
-  },
-
   _readyNow() {
     this.set('ready', true);
 

+ 2 - 1
assets/javascripts/wizard/initializers/custom.js.es6

@@ -66,7 +66,8 @@ export default {
         const src = this.get('step.banner');
         if (!src) return;
 
-        if (src.indexOf('/uploads/') > -1 || src.indexOf('/plugins/') > -1) {
+        const localPaths = ['uploads', 'plugins', 'images'];
+        if (localPaths.indexOf(src.split('/')[1]) > -1) {
           return getUrl(src);
         } else {
           return getUrl(`/images/wizard/${src}`);

+ 1 - 1
assets/javascripts/wizard/templates/components/wizard-editor.hbs

@@ -47,7 +47,7 @@
       </div>
 
       {{conditional-loading-spinner condition=loading}}
-      {{textarea tabindex=tabindex value=value class="d-editor-input" placeholder=placeholderTranslated}}
+      {{textarea tabindex=tabindex value=value class="d-editor-input" placeholder=placeholder}}
     </div>
   {{/if}}
 </div>

+ 1 - 1
assets/javascripts/wizard/templates/components/wizard-field-composer.hbs

@@ -1,2 +1,2 @@
+{{wizard-editor showPreview=showPreview value=field.value placeholder=field.placeholder}}
 {{d-button class='wizard-btn primary' action='togglePreview' label=togglePreviewLabel}}
-{{wizard-editor showPreview=showPreview value=field.value}}

+ 2 - 2
assets/stylesheets/wizard/wizard_composer.scss

@@ -46,15 +46,15 @@
 
 .d-editor-textarea-wrapper,
 .d-editor-preview-wrapper {
+  background-color: $secondary;
+  border: 1px solid #919191;
   flex: 1;
 }
 
 .d-editor-textarea-wrapper {
   display: flex;
   flex-direction: column;
-  background-color: $secondary;
   position: relative;
-  border: 1px solid #919191;
 
   textarea {
     background: transparent;

+ 4 - 1
assets/stylesheets/wizard/wizard_custom.scss

@@ -37,6 +37,10 @@
       margin-right: 7px;
     }
 
+    ul li {
+      margin: 10px 0;
+    }
+
     .image-container {
       padding: 0 20px;
       margin: 50px 0;
@@ -167,7 +171,6 @@
 
     &> .field-description {
       margin-top: 0;
-      margin-left: 10px;
       order: 2;
     }
   }

+ 2 - 2
config/locales/client.en.yml

@@ -161,8 +161,8 @@ en:
       none: "There is no wizard here."
 
     wizard_composer:
-      show_preview: "Show Post Preview"
-      hide_preview: "Hide Post Preview"
+      show_preview: "Preview Your Post"
+      hide_preview: "Hide Preview"
       quote_post_title: "Quote whole post"
       bold_label: "B"
       bold_title: "Strong"

+ 1 - 1
lib/wizard_edits.rb

@@ -118,7 +118,7 @@ end
 
   def description
     return object.description if object.description
-    I18n.t("#{object.key || i18n_key}.description", default: '', base_url: Discourse.base_url)
+    PrettyText.cook(I18n.t("#{object.key || i18n_key}.description", default: '', base_url: Discourse.base_url))
   end
 end