89ce523019
- badge « Archivé » et libellé barré dans la liste admin - popup de confirmation avant archivage (rappelle que c'est réversible) - bouton de restauration (PATCH archived:false) pour les archivés - case « Afficher les utilisateurs archivés » (filtre ?archived=true) - masque l'action d'archivage sur son propre compte (évite le 403) - service users : getArchived/restore, toast remove -> users.archived - i18n FR : clés archived/restored/badge/confirmation
58 lines
1.7 KiB
Vue
58 lines
1.7 KiB
Vue
<template>
|
|
<Teleport v-if="modelValue" to="body">
|
|
<Transition name="modal" appear>
|
|
<div class="fixed inset-0 z-50 flex items-center justify-center">
|
|
<div class="absolute inset-0 bg-black/30" @click="cancel" />
|
|
<div class="relative z-10 w-full max-w-md rounded-lg bg-white p-6 shadow-xl">
|
|
<h3 class="text-lg font-bold text-neutral-900">{{ $t('users.archiveConfirmTitle') }}</h3>
|
|
<p class="mt-3 text-sm text-neutral-600">
|
|
{{ $t('users.archiveConfirmMessage', { username }) }}
|
|
</p>
|
|
<div class="mt-6 flex justify-end gap-3">
|
|
<MalioButton
|
|
variant="tertiary"
|
|
label="Annuler"
|
|
button-class="w-auto px-4"
|
|
@click="cancel"
|
|
/>
|
|
<MalioButton
|
|
variant="danger"
|
|
:label="$t('users.archive')"
|
|
button-class="w-auto px-4"
|
|
@click="$emit('confirm')"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Transition>
|
|
</Teleport>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineProps<{
|
|
modelValue: boolean
|
|
username: string
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
(e: 'update:modelValue', value: boolean): void
|
|
(e: 'confirm'): void
|
|
}>()
|
|
|
|
function cancel() {
|
|
emit('update:modelValue', false)
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.modal-enter-active,
|
|
.modal-leave-active {
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
.modal-enter-from,
|
|
.modal-leave-to {
|
|
opacity: 0;
|
|
}
|
|
</style>
|