2025-10-25 22:04:41 +02:00
|
|
|
<script lang="ts">
|
2026-03-04 22:27:54 +01:00
|
|
|
import { _ } from "svelte-i18n";
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
import { goto } from "$app/navigation";
|
|
|
|
|
import { page } from "$app/state";
|
|
|
|
|
import { SvelteURLSearchParams } from "svelte/reactivity";
|
2026-03-04 22:27:54 +01:00
|
|
|
import { Button } from "$lib/components/ui/button";
|
|
|
|
|
import { Card, CardContent } from "$lib/components/ui/card";
|
|
|
|
|
import { Input } from "$lib/components/ui/input";
|
|
|
|
|
import { Select, SelectContent, SelectItem, SelectTrigger } from "$lib/components/ui/select";
|
2026-03-05 10:19:05 +01:00
|
|
|
import { getAssetUrl } from "$lib/api";
|
2026-03-04 22:27:54 +01:00
|
|
|
import Meta from "$lib/components/meta/meta.svelte";
|
2026-03-07 18:33:32 +01:00
|
|
|
import SexyBackground from "$lib/components/background/background.svelte";
|
|
|
|
|
import PageHero from "$lib/components/page-hero/page-hero.svelte";
|
2026-03-04 22:27:54 +01:00
|
|
|
import TimeAgo from "javascript-time-ago";
|
|
|
|
|
import { formatVideoDuration } from "$lib/utils";
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-04 22:27:54 +01:00
|
|
|
const timeAgo = new TimeAgo("en");
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
const { data } = $props();
|
2025-10-25 22:04:41 +02:00
|
|
|
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
let searchValue = $state(data.search ?? "");
|
2026-03-08 11:06:30 +01:00
|
|
|
$effect(() => {
|
|
|
|
|
searchValue = data.search ?? "";
|
|
|
|
|
});
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
let searchTimeout: ReturnType<typeof setTimeout>;
|
2025-10-25 22:04:41 +02:00
|
|
|
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
function debounceSearch(value: string) {
|
|
|
|
|
clearTimeout(searchTimeout);
|
|
|
|
|
searchTimeout = setTimeout(() => {
|
|
|
|
|
const params = new SvelteURLSearchParams(page.url.searchParams.toString());
|
|
|
|
|
if (value) params.set("search", value);
|
|
|
|
|
else params.delete("search");
|
|
|
|
|
params.delete("page");
|
|
|
|
|
goto(`?${params.toString()}`, { keepFocus: true });
|
|
|
|
|
}, 400);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setParam(key: string, value: string) {
|
|
|
|
|
const params = new SvelteURLSearchParams(page.url.searchParams.toString());
|
|
|
|
|
if (value && value !== "all" && value !== "recent") params.set(key, value);
|
|
|
|
|
else params.delete(key);
|
|
|
|
|
params.delete("page");
|
|
|
|
|
goto(`?${params.toString()}`);
|
|
|
|
|
}
|
2025-10-25 22:04:41 +02:00
|
|
|
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
function goToPage(p: number) {
|
|
|
|
|
const params = new SvelteURLSearchParams(page.url.searchParams.toString());
|
|
|
|
|
if (p > 1) params.set("page", String(p));
|
|
|
|
|
else params.delete("page");
|
|
|
|
|
goto(`?${params.toString()}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const totalPages = $derived(Math.ceil(data.total / data.limit));
|
2026-03-07 18:41:39 +01:00
|
|
|
|
|
|
|
|
const pageNumbers = $derived(() => {
|
|
|
|
|
const pages: (number | -1)[] = [];
|
|
|
|
|
if (totalPages <= 7) {
|
|
|
|
|
for (let i = 1; i <= totalPages; i++) pages.push(i);
|
|
|
|
|
} else {
|
|
|
|
|
pages.push(1);
|
|
|
|
|
if (data.page > 3) pages.push(-1);
|
|
|
|
|
for (let i = Math.max(2, data.page - 1); i <= Math.min(totalPages - 1, data.page + 1); i++)
|
|
|
|
|
pages.push(i);
|
|
|
|
|
if (data.page < totalPages - 2) pages.push(-1);
|
|
|
|
|
pages.push(totalPages);
|
|
|
|
|
}
|
|
|
|
|
return pages;
|
|
|
|
|
});
|
2025-10-25 22:04:41 +02:00
|
|
|
</script>
|
|
|
|
|
|
2026-03-04 22:27:54 +01:00
|
|
|
<Meta title={$_("videos.title")} description={$_("videos.description")} />
|
2025-10-25 22:04:41 +02:00
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="relative min-h-screen bg-gradient-to-br from-background via-primary/5 to-accent/5 overflow-hidden"
|
|
|
|
|
>
|
2026-03-07 18:33:32 +01:00
|
|
|
<SexyBackground />
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 18:33:32 +01:00
|
|
|
<PageHero title={$_("videos.title")} description={$_("videos.description")}>
|
|
|
|
|
<div class="flex flex-col lg:flex-row gap-4 max-w-6xl mx-auto">
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Search -->
|
|
|
|
|
<div class="relative flex-1">
|
|
|
|
|
<span
|
|
|
|
|
class="icon-[ri--search-line] absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"
|
|
|
|
|
></span>
|
|
|
|
|
<Input
|
|
|
|
|
placeholder={$_("videos.search_placeholder")}
|
|
|
|
|
value={searchValue}
|
|
|
|
|
oninput={(e) => {
|
|
|
|
|
searchValue = (e.target as HTMLInputElement).value;
|
|
|
|
|
debounceSearch(searchValue);
|
|
|
|
|
}}
|
|
|
|
|
class="pl-10 bg-background/50 border-primary/20 focus:border-primary"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Duration Filter -->
|
|
|
|
|
<Select
|
|
|
|
|
type="single"
|
|
|
|
|
value={data.duration}
|
|
|
|
|
onValueChange={(v) => v && setParam("duration", v)}
|
|
|
|
|
>
|
|
|
|
|
<SelectTrigger
|
|
|
|
|
class="w-full lg:w-48 bg-background/50 border-primary/20 focus:border-primary"
|
|
|
|
|
>
|
|
|
|
|
<span class="icon-[ri--timer-2-line] w-4 h-4 mr-2"></span>
|
|
|
|
|
{data.duration === "short"
|
|
|
|
|
? $_("videos.duration.short")
|
|
|
|
|
: data.duration === "medium"
|
|
|
|
|
? $_("videos.duration.medium")
|
|
|
|
|
: data.duration === "long"
|
|
|
|
|
? $_("videos.duration.long")
|
|
|
|
|
: $_("videos.duration.all")}
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="all">{$_("videos.duration.all")}</SelectItem>
|
|
|
|
|
<SelectItem value="short">{$_("videos.duration.short")}</SelectItem>
|
|
|
|
|
<SelectItem value="medium">{$_("videos.duration.medium")}</SelectItem>
|
|
|
|
|
<SelectItem value="long">{$_("videos.duration.long")}</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Sort -->
|
|
|
|
|
<Select type="single" value={data.sort} onValueChange={(v) => v && setParam("sort", v)}>
|
|
|
|
|
<SelectTrigger
|
|
|
|
|
class="w-full lg:w-48 bg-background/50 border-primary/20 focus:border-primary"
|
|
|
|
|
>
|
|
|
|
|
{data.sort === "most_liked"
|
|
|
|
|
? $_("videos.sort.most_liked")
|
|
|
|
|
: data.sort === "most_played"
|
|
|
|
|
? $_("videos.sort.most_played")
|
|
|
|
|
: data.sort === "name"
|
|
|
|
|
? $_("videos.sort.name")
|
|
|
|
|
: $_("videos.sort.recent")}
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
<SelectItem value="recent">{$_("videos.sort.recent")}</SelectItem>
|
|
|
|
|
<SelectItem value="most_liked">{$_("videos.sort.most_liked")}</SelectItem>
|
|
|
|
|
<SelectItem value="most_played">{$_("videos.sort.most_played")}</SelectItem>
|
|
|
|
|
<SelectItem value="name">{$_("videos.sort.name")}</SelectItem>
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
2025-10-25 22:04:41 +02:00
|
|
|
</div>
|
2026-03-07 18:33:32 +01:00
|
|
|
</PageHero>
|
2025-10-25 22:04:41 +02:00
|
|
|
<!-- Videos Grid -->
|
|
|
|
|
<div class="container mx-auto px-4 py-12">
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
{#each data.items as video (video.slug)}
|
2026-03-07 18:33:32 +01:00
|
|
|
<a href={`/videos/${video.slug}`} class="block group">
|
2026-03-07 19:25:04 +01:00
|
|
|
<Card
|
|
|
|
|
class="p-0 h-full hover:shadow-2xl hover:shadow-primary/25 transition-all duration-500 hover:-translate-y-3 bg-gradient-to-br from-card/90 via-card/95 to-card/85 backdrop-blur-xl shadow-lg shadow-primary/10 overflow-hidden"
|
|
|
|
|
>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<img
|
|
|
|
|
src={getAssetUrl(video.image, "preview")}
|
|
|
|
|
alt={video.title}
|
|
|
|
|
class="w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300 bg-muted"
|
|
|
|
|
/>
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Overlay Gradient -->
|
2025-10-25 22:04:41 +02:00
|
|
|
<div
|
2026-03-07 19:25:04 +01:00
|
|
|
class="absolute inset-0 group-hover:scale-105 bg-gradient-to-t from-black/60 via-transparent to-black/20 duration-300"
|
|
|
|
|
></div>
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Duration -->
|
2025-10-28 10:31:06 +01:00
|
|
|
<div
|
2026-03-07 19:25:04 +01:00
|
|
|
class="absolute bottom-3 left-3 bg-black/70 text-white text-sm px-2 py-1 rounded font-medium"
|
2025-10-28 10:31:06 +01:00
|
|
|
>
|
2026-03-07 19:25:04 +01:00
|
|
|
{#if video.movie_file?.duration}{formatVideoDuration(
|
|
|
|
|
video.movie_file.duration,
|
|
|
|
|
)}{/if}
|
2025-10-28 10:31:06 +01:00
|
|
|
</div>
|
2025-10-25 22:04:41 +02:00
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Premium Badge -->
|
|
|
|
|
{#if video.premium}
|
|
|
|
|
<div
|
|
|
|
|
class="absolute top-3 left-3 bg-gradient-to-r from-primary to-accent text-white text-xs px-2 py-1 rounded-full font-medium"
|
|
|
|
|
>
|
|
|
|
|
{$_("videos.premium")}
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<!-- Play Count -->
|
|
|
|
|
{#if video.plays_count}
|
|
|
|
|
<div
|
|
|
|
|
class="absolute top-3 right-3 bg-black/70 text-white text-xs px-2 py-1 rounded-full flex items-center gap-1"
|
|
|
|
|
>
|
|
|
|
|
<span class="icon-[ri--play-fill] w-3 h-3"></span>
|
|
|
|
|
{video.plays_count}
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<!-- Play Overlay -->
|
2025-10-25 22:04:41 +02:00
|
|
|
<div
|
2026-03-07 19:25:04 +01:00
|
|
|
class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity"
|
|
|
|
|
aria-hidden="true"
|
2025-10-25 22:04:41 +02:00
|
|
|
>
|
2026-03-07 19:25:04 +01:00
|
|
|
<div
|
|
|
|
|
class="w-16 h-16 bg-primary/90 rounded-full flex flex-col items-center justify-center shadow-2xl"
|
|
|
|
|
>
|
|
|
|
|
<span class="icon-[ri--play-large-fill] w-8 h-8 text-white"></span>
|
|
|
|
|
</div>
|
2025-10-25 22:04:41 +02:00
|
|
|
</div>
|
|
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- Model Info -->
|
|
|
|
|
<!-- <div class="absolute bottom-3 right-3 text-white text-sm">
|
2025-10-25 22:04:41 +02:00
|
|
|
<button
|
|
|
|
|
onclick={() => onNavigate("model")}
|
|
|
|
|
class="hover:text-primary transition-colors"
|
|
|
|
|
>
|
|
|
|
|
{video.model}
|
|
|
|
|
</button>
|
|
|
|
|
</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-07 19:25:04 +01:00
|
|
|
<CardContent class="p-6">
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<h3
|
|
|
|
|
class="font-semibold text-lg mb-2 group-hover:text-primary transition-colors line-clamp-2"
|
|
|
|
|
>
|
|
|
|
|
{video.title}
|
|
|
|
|
</h3>
|
|
|
|
|
<p class="text-sm text-muted-foreground">
|
|
|
|
|
{timeAgo.format(new Date(video.upload_date))}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Stats -->
|
|
|
|
|
<div class="flex items-center justify-between text-sm text-muted-foreground mb-4">
|
|
|
|
|
<!-- <div class="flex items-center gap-4">
|
2025-10-25 22:04:41 +02:00
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
|
<EyeIcon class="w-4 h-4" />
|
|
|
|
|
{video.views}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center gap-1">
|
|
|
|
|
<HeartIcon class="w-4 h-4" />
|
|
|
|
|
{video.likes}
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
2026-03-07 19:25:04 +01:00
|
|
|
<!-- <span
|
2025-10-25 22:04:41 +02:00
|
|
|
class="capitalize bg-primary/10 text-primary px-2 py-1 rounded-full text-xs"
|
|
|
|
|
>
|
|
|
|
|
{video.category}
|
|
|
|
|
</span> -->
|
2026-03-07 19:25:04 +01:00
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-03-07 18:33:32 +01:00
|
|
|
</a>
|
2025-10-25 22:04:41 +02:00
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
{#if data.items.length === 0}
|
2025-10-25 22:04:41 +02:00
|
|
|
<div class="text-center py-12">
|
|
|
|
|
<p class="text-muted-foreground text-lg mb-4">
|
2026-03-04 22:27:54 +01:00
|
|
|
{$_("videos.no_results")}
|
2025-10-25 22:04:41 +02:00
|
|
|
</p>
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
<Button variant="outline" href="/videos" class="border-primary/20 hover:bg-primary/10">
|
2026-03-04 22:27:54 +01:00
|
|
|
{$_("videos.clear_filters")}
|
2025-10-25 22:04:41 +02:00
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
|
|
|
|
|
<!-- Pagination -->
|
|
|
|
|
{#if totalPages > 1}
|
2026-03-07 18:41:39 +01:00
|
|
|
<div class="flex flex-col items-center gap-3 mt-10">
|
|
|
|
|
<div class="flex items-center gap-1">
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
disabled={data.page <= 1}
|
|
|
|
|
onclick={() => goToPage(data.page - 1)}
|
2026-03-07 19:25:04 +01:00
|
|
|
class="border-primary/20 hover:bg-primary/10">{$_("common.previous")}</Button
|
|
|
|
|
>
|
2026-03-07 19:06:57 +01:00
|
|
|
{#each pageNumbers() as p, i (i)}
|
2026-03-07 18:41:39 +01:00
|
|
|
{#if p === -1}
|
|
|
|
|
<span class="px-2 text-muted-foreground select-none">…</span>
|
|
|
|
|
{:else}
|
|
|
|
|
<Button
|
|
|
|
|
variant={p === data.page ? "default" : "outline"}
|
|
|
|
|
size="sm"
|
|
|
|
|
onclick={() => goToPage(p)}
|
|
|
|
|
class={p === data.page
|
|
|
|
|
? "bg-gradient-to-r from-primary to-accent min-w-9"
|
2026-03-07 19:25:04 +01:00
|
|
|
: "border-primary/20 hover:bg-primary/10 min-w-9"}>{p}</Button
|
|
|
|
|
>
|
2026-03-07 18:41:39 +01:00
|
|
|
{/if}
|
|
|
|
|
{/each}
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
size="sm"
|
|
|
|
|
disabled={data.page >= totalPages}
|
|
|
|
|
onclick={() => goToPage(data.page + 1)}
|
2026-03-07 19:25:04 +01:00
|
|
|
class="border-primary/20 hover:bg-primary/10">{$_("common.next")}</Button
|
|
|
|
|
>
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
</div>
|
2026-03-07 18:41:39 +01:00
|
|
|
<p class="text-sm text-muted-foreground">
|
|
|
|
|
{$_("common.total_results", { values: { total: data.total } })}
|
|
|
|
|
</p>
|
feat: add server-side pagination, search, and filtering to all collection and admin pages
- Public pages (videos, magazine, models): URL-driven search, sort, category/duration
filters, and Prev/Next pagination (page size 24)
- Admin tables (videos, articles): search input, toggle filters, and pagination (page size 50)
- Tags page: tag filtering now done server-side via DB arrayContains query instead of
fetching all items and filtering client-side
- Backend resolvers updated for videos, articles, models with paginated { items, total }
responses and filter/sort/tag args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:43:26 +01:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
2025-10-25 22:04:41 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|