소스 검색

solved issue: remove colon when description is empty

JanushiShastri 4 달 전
부모
커밋
27130def80
2개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 6 4
      _includes/vue-rule-script.html
  2. 3 1
      assets/js/vue.rules.js

+ 6 - 4
_includes/vue-rule-script.html

@@ -4,6 +4,7 @@
         <div class="editor" v-if="!preview && !legacy" v-cloak>
             <div class="controls">
                 <vue-button class="primary is-large" @click="clickPreview" :icon="icons.view">Preview</vue-button>
+                
             </div>
             <div class="details">
                 <div class="label-group">
@@ -193,8 +194,8 @@
             <div class="controls">
                 <vue-button class="primary is-large" @click="clickPreview" :icon="icons.edit" v-if="!view">Edit</vue-button>
             </div>
-            <h1><icon :icon="rule.icon" v-if="rule.icon"></icon> [[rule.name]]</h1>
-            <p>[[rule.summary]]</p>
+            <h1><icon :icon="rule.icon" v-if="rule.icon"></icon> [[ rule.name ]]</h1>
+            <p v-if="rule.summary">[[ rule.summary ]]</p>
             <div class="modules__grid" :data-module-id="rule.ruleID" .module="rule">
                 <module-display
                     v-for="module in rule.modules"
@@ -242,8 +243,9 @@
     </div>
 
     <div id="rule-export" v-show="false" v-if="!legacy">
-        <h1>[[rule.name]]</h1>
-        <p>[[rule.summary]]</p>
+        <h1>[[ rule.name ]]</h1>
+        <p v-if="rule.summary">[[ rule.summary ]]</p>
+
         <ul class="module-list">
             <module-list v-for="(module, index) in rule.modules" :key="index" :module="module" v-if="rule.modules" hide-icon></module-list>
         </ul>

+ 3 - 1
assets/js/vue.rules.js

@@ -955,7 +955,9 @@ app.component('moduleList', {
   },
   template: `
 <li class="module-list-item">
-  <span class="module__icon" v-if="!hideIcon"><img :src="icon"> </span><strong>[[module.name]]</strong>: [[module.summary]]
+  <span class="module__icon" v-if="!hideIcon"><img :src="icon"> </span><strong>[[module.name]]</strong>
+  <!-- Conditionally render the colon and summary -->
+  <span v-if="module.summary">: [[module.summary]]</span>
 <span class="module__config">
   <span v-for="(value, key) in module.config">
   <br />[[key]]: [[value]]