Reinitialized commit. Update and actors overview with some filters.

This commit is contained in:
2023-12-30 06:29:53 +01:00
commit 3f099b5e95
1208 changed files with 134732 additions and 0 deletions

16
pages/updates/+Page.vue Normal file
View File

@@ -0,0 +1,16 @@
<template>
<div>
<Scenes
:scenes="scenes"
/>
</div>
</template>
<script setup>
import { inject } from 'vue';
import Scenes from '../../components/scenes/scenes.vue';
const { pageProps } = inject('pageContext');
const { scenes } = pageProps;
</script>

View File

@@ -0,0 +1,30 @@
import { fetchLatest, fetchUpcoming, fetchNew } from '../../src/scenes';
async function fetchScenes(scope, page, limit) {
if (scope === 'new') {
return fetchNew(page, { limit });
}
if (scope === 'upcoming') {
return fetchUpcoming(page, { limit });
}
return fetchLatest(page, { limit });
}
export async function onBeforeRender(pageContext) {
const { scenes, limit, total } = await fetchScenes(pageContext.routeParams.scope, Number(pageContext.routeParams.page) || 1, Number(pageContext.urlParsed.search.limit) || 30);
// console.log(scenes);
return {
pageContext: {
title: pageContext.routeParams.scope,
pageProps: {
scenes,
limit,
total,
},
},
};
}

34
pages/updates/+route.js Normal file
View File

@@ -0,0 +1,34 @@
import { resolveRoute } from 'vike/routing';
export default (pageContext) => {
{
const result = resolveRoute('/updates/@scope/@page', pageContext.urlPathname);
if (result.match) {
return result;
}
}
{
const result = resolveRoute('/updates/@scope', pageContext.urlPathname);
if (result.match) {
result.routeParams.page = '1';
return result;
}
}
{
const result = resolveRoute('/updates', pageContext.urlPathname);
if (result.match) {
result.routeParams.scope = 'latest';
result.routeParams.page = '1';
return result;
}
}
return false;
};