This commit is contained in:
j3d1 2024-06-09 18:26:14 +02:00
parent d49aec5a82
commit 42e1e6e8c7

View file

@ -1,12 +1,20 @@
<template> <template>
<h3 class="text-center">Available Message Template Variables</h3>
<p>
<span v-for="(variable, key) in messageTemplateVariables" :key="key" class="badge badge-primary"
style="margin: 5px;">
{{ variable }}
</span>
</p>
<h3 class="text-center">Message Templates</h3> <h3 class="text-center">Message Templates</h3>
<ul> <div v-for="template in messageTemplatesIntermediate" :key="template.id" class="card bg-dark"
<div v-for="template in messageTemplatesIntermediate" :key="template.id" class="card bg-dark"> style="margin-bottom: 10px;">
<div class="card-header">{{ template.name }}</div> <div class="card-header">{{ template.name }}</div>
<div class="card-body"> <div class="card-body">
<FormatedText :value="template.message" :format="formatText" <FormatedText :value="template.message" :format="formatText"
@input="changeMessageTemplate(template.id, $event)"/> @input="changeMessageTemplate(template.id, $event)"/>
<br> </div>
<div class="card-footer">
<button class="btn btn-primary" @click="resetMessageTemplate(template.id)" <button class="btn btn-primary" @click="resetMessageTemplate(template.id)"
:disabled="messageTemplates.find(t => t.id === template.id).message === template.message">Reset :disabled="messageTemplates.find(t => t.id === template.id).message === template.message">Reset
</button> </button>
@ -19,19 +27,12 @@
<div class="card-body"> <div class="card-body">
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" v-model="newTemplateName" placeholder="New Template Name"> <input type="text" class="form-control" v-model="newTemplateName" placeholder="New Template Name">
<button class="btn btn-success input-group-btn" @click="createMessageTemplateAndReset()" ref="createButton">Create <button class="btn btn-success input-group-btn" @click="createMessageTemplateAndReset()"
ref="createButton">Create
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</ul>
<h3 class="text-center">Message Template Variables</h3>
<p>
<span v-for="(variable, key) in messageTemplateVariables" :key="key" class="badge badge-primary"
style="margin: 5px;">
{{ variable }}
</span>
</p>
</template> </template>
<script> <script>