Added achievement data

This commit is contained in:
2026-05-10 02:28:30 +10:00
parent f2b2eaaabe
commit 217a971360
23 changed files with 479 additions and 470 deletions
@@ -2,7 +2,7 @@
import FlightClassBadge from "@/Components/FlightsGoneBy/FlightClassBadge.vue";
import AirlineLogo from "@/Components/FlightsGoneBy/AirlineLogo.vue";
import {Flight} from "@/Types/types";
import {Flight, User} from "@/Types/types";
import { computed, ref, watch, nextTick } from "vue";
import type { DataTableSortItem } from 'vuetify';
import InlineBadge from "@/Components/FlightsGoneBy/InlineBadge.vue";
@@ -21,11 +21,17 @@ const props = defineProps<{
flightId?: number | null
}>()
console.log(props.user)
function editRoute(id: number) {
return route('flights.edit', { flight: id })
}
const showDeleteDialog = ref(false)
const flightToDelete = ref<Flight | null>(null)
const showDeleteDialog = computed({
get: () => flightToDelete.value !== null,
set: (val) => { if (!val) flightToDelete.value = null }
})
const ITEMS_PER_PAGE = 25
@@ -263,7 +269,6 @@ watch(
</td>
<td class="v-data-table__td actions-cell">
<template>
<v-menu>
<template #activator="{ props: menuProps }">
<v-btn
@@ -275,8 +280,8 @@ watch(
/>
</template>
<v-list density="compact" bg-color="#1a1e2e">
<v-list-item v-if="canEdit"
prepend-icon="mdi-pencil-outline"
<v-list-item
prepend-icon="mdi-magnify"
title="View Details"
:href="`/u/${user.name}/flight/${(item as Flight).id}`"
/>
@@ -286,30 +291,32 @@ watch(
:href="editRoute((item as Flight).id)"
/>
<v-list-item v-if="canEdit"
prepend-icon="mdi-trash-can-outline"
title="Delete"
@click="showDeleteDialog = true"
prepend-icon="mdi-trash-can-outline"
title="Delete"
@click="flightToDelete = (item as Flight)"
/>
</v-list>
</v-menu>
<v-dialog v-model="showDeleteDialog" max-width="400">
<v-dialog v-if="canEdit" v-model="showDeleteDialog" max-width="400">
<v-card title="Delete Flight">
<v-card-text>Are you sure you want to delete this flight?</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn v-if="!deleting" @click="showDeleteDialog = false">Cancel</v-btn>
<v-btn v-if="!deleting" @click="flightToDelete = null">Cancel</v-btn>
<v-btn
color="error"
:loading="deleting"
@click="deleting = true; router.delete(route('flights.delete', { flight: (item as Flight).id }), { onFinish: () => deleting = false })"
@click="deleting = true; router.delete(
route('flights.delete', { flight: flightToDelete!.id }),
{ onFinish: () => { deleting = false; flightToDelete = null } }
)"
>
Delete
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
</td>
</tr>