Skip to content

Commit

Permalink
added page titles, resolves #84
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Kaggl committed Mar 18, 2024
1 parent 2daa555 commit 806db42
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 3 deletions.
12 changes: 11 additions & 1 deletion pages/detail/courts/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ const relCols = ["relation_type", "target.name", "start_date", "end_date"];
definePageMeta({
title: "pages.searchviews.courts.title",
});
const title = computed(() => {
if (data.value.entity.data?.name)
return `${data.value.entity.data.name} - ${t("pages.searchviews.courts.sing")}`;
return t("pages.searchviews.courts.sing");
});
useHead({
title,
});
</script>

<template>
Expand All @@ -65,7 +75,7 @@ definePageMeta({
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.details.data?.ampel" />
<HierarchyLinkButton
:id="data.entity.data?.object_id"
:id="String(data.entity.data?.object_id)"
model="Institution"
:label="data.entity.data?.name"
/>
Expand Down
12 changes: 12 additions & 0 deletions pages/detail/events/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { useRoute } from "vue-router";
import type { Event } from "@/types/schema";
import { definePageMeta, ref } from "#imports";
const t = useTranslations();
const route = useRoute();
const id = String(route.params.id);
Expand All @@ -18,6 +20,16 @@ const data = ref({
definePageMeta({
title: "pages.searchviews.events.title",
});
const title = computed(() => {
if (data.value.entity.data?.name)
return `${data.value.entity.data.name} - ${t("pages.searchviews.events.sing")}`;
return t("pages.searchviews.events.sing");
});
useHead({
title,
});
</script>

<template>
Expand Down
11 changes: 10 additions & 1 deletion pages/detail/institutions/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ const loading = computed(() => ({
definePageMeta({
title: "pages.searchviews.institutions.title",
});
const title = computed(() => {
if (data.value.entity.data?.name) return `${data.value.entity.data.name} - Institution`;
return "Institution";
});
useHead({
title,
});
</script>

<template>
Expand All @@ -62,7 +71,7 @@ definePageMeta({
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.entity.data?.ampel" />
<HierarchyLinkButton
:id="data.entity.data?.object_id"
:id="String(data.entity.data?.object_id)"
model="Institution"
:label="data.entity.data?.name"
/>
Expand Down
11 changes: 10 additions & 1 deletion pages/detail/persons/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ const relCols = ["relation_type", "target.name", "start_date", "end_date"];
definePageMeta({
title: "pages.searchviews.people.title",
});
const title = computed(() => {
if (data.value.entity.data?.name) return `${data.value.entity.data.fullname} - Person`;
return "Person";
});
useHead({
title,
});
</script>

<template>
Expand Down Expand Up @@ -92,7 +101,7 @@ definePageMeta({
<div class="flex items-center gap-2">
<Indicator class="w-24" :status="data.entity.data?.ampel" />
<HierarchyLinkButton
:id="data.entity.data?.object_id"
:id="String(data.entity.data?.object_id)"
model="Person"
:label="data.entity.data?.fullname"
/>
Expand Down
10 changes: 10 additions & 0 deletions pages/detail/places/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ const relCols = ["relation_type", "target.name", "start_date", "end_date"];
definePageMeta({
title: "pages.searchviews.places.title",
});
const title = computed(() => {
if (data.value.entity.data?.name)
return `${data.value.entity.data.name} - ${t("pages.searchviews.places.sing")}`;
return t("pages.searchviews.places.sing");
});
useHead({
title,
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/documentation/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const currentDoc = computed(() => {
return route.params.slug[0];
}
});
useHead({
title: t("pages.documentation.title"),
});
console.log(route.params.slug, locale.value);
</script>

Expand Down
3 changes: 3 additions & 0 deletions pages/hierarchy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ const query = ref(
definePageMeta({
title: "pages.hierarchy.title",
});
useHead({
title: t("pages.hierarchy.label"),
});
</script>

<template>
Expand Down
4 changes: 4 additions & 0 deletions pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ watch(
definePageMeta({
title: "pages.search.title",
});
useHead({
title: t("pages.search.title"),
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/courts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_courts";
const queryBy = ["name", "main_owner.name", "kategorie"];
Expand All @@ -30,6 +32,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.courts.title",
});
useHead({
title: `${t("pages.searchviews.courts.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_events";
const queryBy = ["name", "alternativenames"];
Expand All @@ -30,6 +32,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.events.title",
});
useHead({
title: `${t("pages.searchviews.events.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
10 changes: 10 additions & 0 deletions pages/search/institutions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_institutions";
const queryBy = ["name", "alternativenames"];
const koi = ["name", "start", "end", "label:Auflösung", "label:Kategorie", "ampel"];
Expand All @@ -28,6 +30,14 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.institutions.title",
});
useHead({
title: `${t("pages.searchviews.institutions.title")} ${t("pages.search.title")}`,
});
useHead({
title: `${t("pages.searchviews.institutions.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/persons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_persons";
const queryBy = ["name", "first_name", "alternativenames", "functions", "institutions"];
Expand All @@ -29,6 +31,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.people.title",
});
useHead({
title: `${t("pages.searchviews.people.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/places.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_places";
const queryBy = ["name", "alternativenames"];
const koi = ["name", "kind", "ampel"];
Expand All @@ -28,6 +30,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.places.title",
});
useHead({
title: `${t("pages.searchviews.places.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/references.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_references";
const queryBy = "folio";
const koi = ["id", "folio", "shortTitle", "related_doc.name"];
Expand All @@ -28,6 +30,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.courts.title",
});
useHead({
title: `${t("pages.searchviews.references.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down
6 changes: 6 additions & 0 deletions pages/search/relations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SearchTable from "@/components/search-table.vue";
import { getSchema } from "@/composables/use-ts-data";
import { definePageMeta } from "#imports";
const t = useTranslations();
const collectionName = "viecpro_relations";
const queryBy = ["target.name", "source.name", "relation_type"];
const koi = ["source_kind", "source.name", "relation_type", "target.name", "target_kind"];
Expand All @@ -28,6 +30,10 @@ const sortable = computed(
definePageMeta({
title: "pages.searchviews.relations.title",
});
useHead({
title: `${t("pages.searchviews.relations.title")} ${t("pages.search.title")}`,
});
</script>

<template>
Expand Down

0 comments on commit 806db42

Please sign in to comment.