Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add LostandFound page #100

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/pages/a/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
middleware: ["auth"],
});

if (!ctx.isAuthorized()) {
toast.error("User is not logged in");
navigateTo("/lostandfound");
return;
}

const route = useRoute();
const assetId = computed<string>(() => route.params.id as string);
await navigateTo("/assets/" + assetId.value, { replace: true, redirectCode: 301 });
Expand Down
79 changes: 79 additions & 0 deletions frontend/pages/lostandfound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<script setup lang="ts">
import { statCardData } from "./statistics";
import { itemsTable } from "./table";
import { useLabelStore } from "~~/stores/labels";
import { useLocationStore } from "~~/stores/locations";

definePageMeta({
middleware: ["auth"],
});
useHead({
title: "Homebox | Lost Item",
});

const api = useUserApi();
const breakpoints = useBreakpoints();

const locationStore = useLocationStore();
const locations = computed(() => locationStore.parentLocations);

const labelsStore = useLabelStore();
const labels = computed(() => labelsStore.labels);

const itemTable = itemsTable(api);
const stats = statCardData(api);
</script>

<template>
<template>
<div class="lost-and-found">
<h1>Lost and Found</h1>
<p>You have located an item that may be lost. Please contact the owner here: <a :href="'mailto:' + ownerEmail">{{ ownerEmail }}</a></p>
<div class="login-option">
<p>Do you own this item? <router-link to="/login">Login to view or edit.</router-link></p>
</div>
</div>
</template>

<script>
export default {
name: 'LostAndFound',
data() {
return {
ownerEmail: '[email protected]'
};
}
};
</script>

<style scoped>
.lost-and-found {
font-family: Arial, sans-serif;
margin: 20px;
}

.lost-and-found h1 {
font-size: 24px;
color: #333;
}

.lost-and-found p {
font-size: 16px;
margin: 10px 0;
}

.login-option p {
margin-top: 20px;
font-weight: bold;
}

.login-option a {
color: #007bff;
text-decoration: none;
}

.login-option a:hover {
text-decoration: underline;
}
</style>
</template>
Loading