otf: replace button by link in show modale

This commit is contained in:
Mathieu Jaumotte 2021-09-30 13:44:04 +02:00
parent 1eb8d04a32
commit decc3c7463

View File

@ -42,16 +42,16 @@
</template>
<template v-slot:footer>
<button v-if="action === 'show'"
@click="goToLocation(id, type)"
<a v-if="action === 'show'"
:href="buildLocation(id, type)"
:title="$t(titleMessage)"
class="btn btn-show">{{ $t(buttonMessage) }}
</button>
<button v-else
</a>
<a v-else
class="btn btn-save"
@click="saveAction">
{{ $t('action.save')}}
</button>
</a>
</template>
</modal>
@ -174,11 +174,12 @@ export default {
this.modal.showModal = false;
},
goToLocation(id, type) {
buildLocation(id, type) {
if (type == 'person') {
window.location = `../../person/${id}/general`;
// TODO i18n
return `/fr/person/${id}/general`;
} else if (type == 'thirdparty') {
window.location = `../../thirdparty/thirdparty/${id}/show`;
return `/fr/thirdparty/thirdparty/${id}/show`;
}
}
}