This commit is contained in:
j3d1 2024-06-08 20:41:10 +02:00
parent e812366651
commit f1cdd00955

View file

@ -1,18 +1,20 @@
<template> <template>
<h3 class="text-center">Message Templates</h3> <h3 class="text-center">Message Templates</h3>
<ul> <ul>
<li v-for="template in messageTemplatesIntermediate" :key="template.id"> <div v-for="template in messageTemplatesIntermediate" :key="template.id" class="card bg-dark">
<b>{{ template.name }}</b><br> <div class="card-header">{{ template.name }}</div>
<FormatedText :value="template.message" :format="formatText" class="template-message" <div class="card-body">
@input="changeMessageTemplate(template.id, $event)"/> <FormatedText :value="template.message" :format="formatText" class="template-message"
<br> @input="changeMessageTemplate(template.id, $event)"/>
<button class="btn btn-primary" @click="resetMessageTemplate(template.id)" <br>
:disabled="true">Reset <button class="btn btn-primary" @click="resetMessageTemplate(template.id)"
</button> :disabled="true">Reset
<button class="btn btn-success" @click="saveMessageTemplate(template.id)" </button>
:disabled="true">Save <button class="btn btn-success" @click="saveMessageTemplate(template.id)"
</button> :disabled="true">Save
</li> </button>
</div>
</div>
</ul> </ul>
<h3 class="text-center">Message Template Variables</h3> <h3 class="text-center">Message Template Variables</h3>
<p> <p>
@ -23,7 +25,7 @@
<hr> <hr>
{{ messageTemplates }} {{ messageTemplates }}
<hr> <hr>
{{messageTemplatesIntermediate}} {{ messageTemplatesIntermediate }}
</template> </template>
<script> <script>
@ -64,7 +66,7 @@ export default {
}, },
mounted() { mounted() {
this.fetchMessageTemplates().then(() => { this.fetchMessageTemplates().then(() => {
this.messageTemplatesIntermediate = [...this.messageTemplates]; this.messageTemplatesIntermediate = JSON.parse(JSON.stringify(this.messageTemplates));
}); });
this.fetchMessageTemplateVariables(); this.fetchMessageTemplateVariables();
}, },