stash
This commit is contained in:
parent
b3ff77a1fa
commit
0d231b0e65
2 changed files with 9 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<div contenteditable>
|
||||
<pre>{{ value }}</pre>
|
||||
<span v-html="rawhtml(value)"></span>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
<h3 class="text-center">Message Templates</h3>
|
||||
<ul>
|
||||
<li v-for="template in messageTemplates" :key="template.id">
|
||||
{{ template.name }}<br>
|
||||
<pre>{{ template.message }}</pre>
|
||||
<FormatedText :value="template.message"/>
|
||||
<FormatedText :value="template.message" :format="formatText"/>
|
||||
</li>
|
||||
</ul>
|
||||
<h3 class="text-center">Message Template Variables</h3>
|
||||
|
@ -24,7 +23,14 @@ export default {
|
|||
name: 'Settings',
|
||||
components: {FormatedText, Table},
|
||||
computed: mapState(['messageTemplates', 'messageTemplateVariables']),
|
||||
methods: mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']),
|
||||
methods: {
|
||||
...mapActions(['fetchMessageTemplates', 'fetchMessageTemplateVariables']),
|
||||
formatText(value) {
|
||||
return value.replace(/{{(.*?)}}/g, (match, key) => {
|
||||
return `<span class="text-primary">{{ ${key} }}</span>`;
|
||||
}).replace(/\n/g, '<br>').replace(/\t/g, ' ');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchMessageTemplates();
|
||||
this.fetchMessageTemplateVariables();
|
||||
|
|
Loading…
Reference in a new issue