feat : bouton Ajouter sur les pages admin en haut à droite
Alignement sur le pattern case.vue : titre et bouton Ajouter sur la même ligne, wrapper px-[86px] commun, suppression du bouton bottom-centered Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,41 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-between">
|
<div class="px-[86px]">
|
||||||
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des types bovins</h1>
|
<div class="flex items-center justify-between">
|
||||||
</div>
|
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des types bovins</h1>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="auth.isAdmin"
|
||||||
|
to="/admin/bovin"
|
||||||
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-6 rounded hover:opacity-80 gap-2"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
|
Ajouter
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="auth.isAdmin" class="mt-7 mb-11">
|
<div v-if="auth.isAdmin" class="mt-6 mb-16">
|
||||||
<UiDataTable
|
<UiDataTable
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model:per-page="perPage"
|
v-model:per-page="perPage"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:items="items"
|
:items="items"
|
||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-clickable
|
row-clickable
|
||||||
@row-click="goToBovin"
|
@row-click="goToBovin"
|
||||||
>
|
>
|
||||||
<template #header-label>
|
<template #header-label>
|
||||||
<UiTextInput v-model="filters.label" placeholder="Nom" size="compact" />
|
<UiTextInput v-model="filters.label" placeholder="Nom" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-code>
|
<template #header-code>
|
||||||
<UiTextInput v-model="filters.code" placeholder="Code" size="compact" />
|
<UiTextInput v-model="filters.code" placeholder="Code" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
</UiDataTable>
|
</UiDataTable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-7 border border-slate-200 mb-11 px-4 py-6 text-slate-400">
|
<div v-else class="mt-6 border border-slate-200 mb-16 px-4 py-6 text-slate-400">
|
||||||
Accès réservé aux administrateurs.
|
Accès réservé aux administrateurs.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
|
||||||
<NuxtLink
|
|
||||||
to="/admin/bovin"
|
|
||||||
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
|
||||||
@click="handleAddClick"
|
|
||||||
>
|
|
||||||
<Icon name="mdi:plus" size="28" />
|
|
||||||
Ajouter
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -66,11 +64,6 @@ const goToBovin = (bovin: BovineTypeData) => {
|
|||||||
router.push(`/admin/bovin/${bovin.id}`)
|
router.push(`/admin/bovin/${bovin.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAddClick = (event: Event) => {
|
|
||||||
if (auth.isAdmin) return
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (auth.isAdmin) reload()
|
if (auth.isAdmin) reload()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,36 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-between">
|
<div class="px-[86px]">
|
||||||
<h1 class="text-4xl font-bold uppercase text-primary-500">listes des transporteurs</h1>
|
<div class="flex items-center justify-between">
|
||||||
</div>
|
<h1 class="text-4xl font-bold uppercase text-primary-500">listes des transporteurs</h1>
|
||||||
|
<NuxtLink
|
||||||
|
to="/admin/carrier"
|
||||||
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-6 rounded hover:opacity-80 gap-2"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
|
Ajouter
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mt-7 mb-11">
|
<div class="mt-6 mb-16">
|
||||||
<UiDataTable
|
<UiDataTable
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model:per-page="perPage"
|
v-model:per-page="perPage"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:items="items"
|
:items="items"
|
||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-clickable
|
row-clickable
|
||||||
@row-click="goToCarrier"
|
@row-click="goToCarrier"
|
||||||
>
|
>
|
||||||
<template #header-name>
|
<template #header-name>
|
||||||
<UiTextInput v-model="filters.name" placeholder="Label" size="compact" />
|
<UiTextInput v-model="filters.name" placeholder="Label" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-code>
|
<template #header-code>
|
||||||
<UiTextInput v-model="filters.code" placeholder="Code" size="compact" />
|
<UiTextInput v-model="filters.code" placeholder="Code" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
</UiDataTable>
|
</UiDataTable>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
|
||||||
<NuxtLink
|
|
||||||
to="/admin/carrier"
|
|
||||||
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
|
||||||
>
|
|
||||||
<Icon name="mdi:plus" size="28" />
|
|
||||||
Ajouter
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-between">
|
<div class="px-[86px]">
|
||||||
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des clients</h1>
|
<div class="flex items-center justify-between">
|
||||||
</div>
|
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des clients</h1>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="auth.isAdmin"
|
||||||
|
to="/admin/customer"
|
||||||
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-6 rounded hover:opacity-80 gap-2"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
|
Ajouter
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="auth.isAdmin" class="mt-7 mb-11">
|
<div v-if="auth.isAdmin" class="mt-6 mb-16">
|
||||||
<UiDataTable
|
<UiDataTable
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model:per-page="perPage"
|
v-model:per-page="perPage"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:items="items"
|
:items="items"
|
||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-clickable
|
row-clickable
|
||||||
@row-click="goToCustomer"
|
@row-click="goToCustomer"
|
||||||
>
|
>
|
||||||
<template #header-name>
|
<template #header-name>
|
||||||
<UiTextInput v-model="filters.name" placeholder="Nom" size="compact" />
|
<UiTextInput v-model="filters.name" placeholder="Nom" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-phone>
|
<template #header-phone>
|
||||||
<UiTextInput v-model="filters.phone" placeholder="Téléphone" size="compact" />
|
<UiTextInput v-model="filters.phone" placeholder="Téléphone" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-email>
|
<template #header-email>
|
||||||
<UiTextInput v-model="filters.email" placeholder="Mail" size="compact" />
|
<UiTextInput v-model="filters.email" placeholder="Mail" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-createdBy.username>
|
<template #header-createdBy.username>
|
||||||
<UiTextInput v-model="filters['createdBy.username']" placeholder="Créé par" size="compact" />
|
<UiTextInput v-model="filters['createdBy.username']" placeholder="Créé par" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
</UiDataTable>
|
</UiDataTable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-7 border border-slate-200 mb-11 px-4 py-6 text-slate-400">
|
<div v-else class="mt-6 border border-slate-200 mb-16 px-4 py-6 text-slate-400">
|
||||||
Accès réservé aux administrateurs.
|
Accès réservé aux administrateurs.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
|
||||||
<NuxtLink
|
|
||||||
to="/admin/customer"
|
|
||||||
class="inline-flex items-center mb-16 justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
|
||||||
@click="handleAddClick"
|
|
||||||
>
|
|
||||||
<Icon name="mdi:plus" size="28" />
|
|
||||||
Ajouter
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -76,11 +74,6 @@ const goToCustomer = (customer: CustomerData) => {
|
|||||||
router.push(`/admin/customer/${customer.id}`)
|
router.push(`/admin/customer/${customer.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAddClick = (event: Event) => {
|
|
||||||
if (auth.isAdmin) return
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (auth.isAdmin) reload()
|
if (auth.isAdmin) reload()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,47 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-between">
|
<div class="px-[86px]">
|
||||||
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des fournisseurs</h1>
|
<div class="flex items-center justify-between">
|
||||||
</div>
|
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des fournisseurs</h1>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="auth.isAdmin"
|
||||||
|
to="/admin/supplier"
|
||||||
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-6 rounded hover:opacity-80 gap-2"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
|
Ajouter
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="auth.isAdmin" class="mt-7 mb-11">
|
<div v-if="auth.isAdmin" class="mt-6 mb-16">
|
||||||
<UiDataTable
|
<UiDataTable
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model:per-page="perPage"
|
v-model:per-page="perPage"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:items="items"
|
:items="items"
|
||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-clickable
|
row-clickable
|
||||||
@row-click="goToSupplier"
|
@row-click="goToSupplier"
|
||||||
>
|
>
|
||||||
<template #header-name>
|
<template #header-name>
|
||||||
<UiTextInput v-model="filters.name" placeholder="Nom" size="compact" />
|
<UiTextInput v-model="filters.name" placeholder="Nom" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-phone>
|
<template #header-phone>
|
||||||
<UiTextInput v-model="filters.phone" placeholder="Téléphone" size="compact" />
|
<UiTextInput v-model="filters.phone" placeholder="Téléphone" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-email>
|
<template #header-email>
|
||||||
<UiTextInput v-model="filters.email" placeholder="Mail" size="compact" />
|
<UiTextInput v-model="filters.email" placeholder="Mail" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
<template #header-createdBy.username>
|
<template #header-createdBy.username>
|
||||||
<UiTextInput v-model="filters['createdBy.username']" placeholder="Créé par" size="compact" />
|
<UiTextInput v-model="filters['createdBy.username']" placeholder="Créé par" size="compact" />
|
||||||
</template>
|
</template>
|
||||||
</UiDataTable>
|
</UiDataTable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-7 border border-slate-200 mb-11 px-4 py-6 text-slate-400">
|
<div v-else class="mt-6 border border-slate-200 mb-16 px-4 py-6 text-slate-400">
|
||||||
Accès réservé aux administrateurs.
|
Accès réservé aux administrateurs.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
|
||||||
<NuxtLink
|
|
||||||
to="/admin/supplier"
|
|
||||||
class="inline-flex items-center mb-16 justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
|
||||||
@click="handleAddClick"
|
|
||||||
>
|
|
||||||
<Icon name="mdi:plus" size="28" />
|
|
||||||
Ajouter
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -76,11 +74,6 @@ const goToSupplier = (supplier: SupplierData) => {
|
|||||||
router.push(`/admin/supplier/${supplier.id}`)
|
router.push(`/admin/supplier/${supplier.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAddClick = (event: Event) => {
|
|
||||||
if (auth.isAdmin) return
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (auth.isAdmin) reload()
|
if (auth.isAdmin) reload()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,66 +1,64 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-between">
|
<div class="px-[86px]">
|
||||||
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des utilisateurs</h1>
|
<div class="flex items-center justify-between">
|
||||||
</div>
|
<h1 class="text-4xl font-bold uppercase text-primary-500">Liste des utilisateurs</h1>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="auth.isAdmin"
|
||||||
|
to="/admin/user"
|
||||||
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-6 rounded hover:opacity-80 gap-2"
|
||||||
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
|
Ajouter
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="auth.isAdmin" class="mt-7 mb-11">
|
<div v-if="auth.isAdmin" class="mt-6 mb-16">
|
||||||
<UiDataTable
|
<UiDataTable
|
||||||
v-model:page="page"
|
v-model:page="page"
|
||||||
v-model:per-page="perPage"
|
v-model:per-page="perPage"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:items="items"
|
:items="items"
|
||||||
:total-items="totalItems"
|
:total-items="totalItems"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
row-clickable
|
row-clickable
|
||||||
@row-click="goToUser"
|
@row-click="goToUser"
|
||||||
>
|
>
|
||||||
<template #header-username>
|
<template #header-username>
|
||||||
<UiTextInput
|
<UiTextInput
|
||||||
v-model="filters.username"
|
v-model="filters.username"
|
||||||
placeholder="Utilisateur"
|
placeholder="Utilisateur"
|
||||||
size="compact"
|
size="compact"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #header-roles>
|
<template #header-roles>
|
||||||
<UiTextInput :model-value="''" placeholder="Role" size="compact" disabled />
|
<UiTextInput :model-value="''" placeholder="Role" size="compact" disabled />
|
||||||
</template>
|
</template>
|
||||||
<template #header-isLocked>
|
<template #header-isLocked>
|
||||||
<UiSelect
|
<UiSelect
|
||||||
v-model="filters.isLocked"
|
v-model="filters.isLocked"
|
||||||
placeholder="Statut"
|
placeholder="Statut"
|
||||||
:options="statusOptions"
|
:options="statusOptions"
|
||||||
size="compact"
|
size="compact"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #cell-roles="{ item }">
|
<template #cell-roles="{ item }">
|
||||||
{{ getRoleLabels(item.roles) }}
|
{{ getRoleLabels(item.roles) }}
|
||||||
</template>
|
</template>
|
||||||
<template #cell-isLocked="{ item }">
|
<template #cell-isLocked="{ item }">
|
||||||
<span
|
<span
|
||||||
v-if="item.isLocked"
|
v-if="item.isLocked"
|
||||||
class="inline-block px-2 py-0.5 text-xs font-semibold rounded bg-red-100 text-red-700"
|
class="inline-block px-2 py-0.5 text-xs font-semibold rounded bg-red-100 text-red-700"
|
||||||
>Verrouillé</span>
|
>Verrouillé</span>
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
class="inline-block px-2 py-0.5 text-xs font-semibold rounded bg-green-100 text-green-700"
|
class="inline-block px-2 py-0.5 text-xs font-semibold rounded bg-green-100 text-green-700"
|
||||||
>Actif</span>
|
>Actif</span>
|
||||||
</template>
|
</template>
|
||||||
</UiDataTable>
|
</UiDataTable>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="mt-7 border border-slate-200 mb-11 px-4 py-6 text-slate-400">
|
<div v-else class="mt-6 border border-slate-200 mb-16 px-4 py-6 text-slate-400">
|
||||||
Accès réservé aux administrateurs.
|
Accès réservé aux administrateurs.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-center items-center">
|
|
||||||
<NuxtLink
|
|
||||||
to="/admin/user"
|
|
||||||
class="inline-flex items-center mb-16 justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
|
||||||
@click="handleAddClick"
|
|
||||||
>
|
|
||||||
<Icon name="mdi:plus" size="28" />
|
|
||||||
Ajouter
|
|
||||||
</NuxtLink>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -104,11 +102,6 @@ const goToUser = (user: UserData) => {
|
|||||||
router.push(`/admin/user/${user.id}`)
|
router.push(`/admin/user/${user.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAddClick = (event: Event) => {
|
|
||||||
if (auth.isAdmin) return
|
|
||||||
event.preventDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (auth.isAdmin) reload()
|
if (auth.isAdmin) reload()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user