replace all links and buttons involved by OnTheFly component

This commit is contained in:
2021-05-31 15:49:55 +02:00
parent 68059a9938
commit 158b572879
8 changed files with 107 additions and 77 deletions

View File

@@ -4,18 +4,21 @@
:class="classAction"
:title="$t(titleAction)"
@click="openModal">
{{ buttonText }}
</a>
<teleport to="body">
<modal v-if="modal.showModal"
:modalDialogClass="modal.modalDialogClass"
@close="modal.showModal = false">
<template v-slot:header>
<h3 class="modal-title">{{ $t(modalTitle) }}</h3>
<h3 class="modal-title">{{ $t(titleModal) }}</h3>
</template>
<template v-slot:body>
{{ action }}
{{ type }}
{{ id }}
</template>
<template v-slot:footer>
<button class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
@@ -36,7 +39,7 @@ export default {
components: {
Modal
},
props: ['type', 'id', 'action'],
props: ['type', 'id', 'action', 'buttonText'],
data() {
return {
modal: {
@@ -50,20 +53,30 @@ export default {
switch (this.action) {
case 'show':
return 'bt-show';
case 'create':
return 'bt-create';
case 'edit':
return 'bt-update';
case 'create':
return 'bt-create';
}
},
titleAction() {
switch (this.action) {
case 'show':
return 'action.show';
case 'create':
return 'action.create';
case 'edit':
return 'action.edit';
case 'create':
return 'action.create';
}
},
titleModal() {
switch (this.action) {
case 'show':
return 'onthefly.show.' + this.type;
case 'edit':
return 'onthefly.edit.' + this.type;
case 'create':
return 'onthefly.create.title';
}
},
},

View File

@@ -46,6 +46,20 @@ const messages = {
previous: "Précédent",
top: "Haut",
bottom: "Bas",
},
onthefly: {
show: {
person: "Détails de l'usager",
thirdparty: "Détails du tiers"
},
edit: {
person: "Modifier un usager",
thirdparty: "Modifier un tiers"
},
create: {
button: "Créer \"{q}\"",
title: "Saisir une nouvelle personne à la volée",
},
}
}
};