Compare commits

..

2 commits

Author SHA1 Message Date
5e2fd6f682 change: full path urls 2025-04-21 13:34:46 +02:00
900203c845 fix: ref_only_access was inverted 2025-04-21 13:34:38 +02:00
2 changed files with 7 additions and 6 deletions

View file

@ -54,7 +54,7 @@
v-for="sublink in navbar_sub_items"
:key="sublink.id"
:to="`/${params?.[0]}/${sublink.URL}`"
:class="sublink.URL == params?.[1] && !params[2] ? 'active' : ''"
:class="sublink.URL == params?.[1] ? 'active' : ''"
class="w-fit"
>
{{ sublink.name }}

View file

@ -1,4 +1,5 @@
<template>
{{ collectionDetail }}
<NuxtLayout name="default">
<NotFound v-if="notFound" />
<ContentBuilder v-else-if="showContentBuilder" :hero="page?.hero" :content="page?.content" />
@ -48,7 +49,7 @@ const { data: pages } = await useAsyncData("pages", () =>
},
},
filters: {
...(active_page_id.value == "" ? { slug: params[0], ref_only_access: true } : {}),
...(active_page_id.value == "" ? { slug: params.join("_"), ref_only_access: false } : {}),
},
})
);
@ -57,11 +58,11 @@ const page = computed(() => {
});
let detail = ref<Article | Operation | Event | Vehicle | undefined>(undefined);
const searchDetail = computed(() => {
const collectionDetail = computed(() => {
if (!active_sub_item.value) return params[1];
return params[2];
});
if (searchDetail.value) {
if (collectionDetail.value) {
let collectionOfDetail = [
...new Set(
page.value?.content
@ -88,12 +89,12 @@ if (searchDetail.value) {
}
const notFound = computed(() => {
if (searchDetail.value) return !detail.value;
if (collectionDetail.value && detail.value) return !detail.value;
else return active_page_id.value == "" && !page.value?.content && !page.value?.hero;
});
const showContentBuilder = computed(() => {
if (searchDetail.value) return !detail.value;
if (collectionDetail.value && detail.value) return !detail.value;
else return !!page.value?.content || !!page.value?.hero;
});
</script>