Add mini-slider API and wire the homepage projects carousel.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 15:11:15 +05:00
parent 86b51059f3
commit b33fea4cd7
19 changed files with 563 additions and 28 deletions

View File

@@ -7,6 +7,7 @@
const CARDS = [
{ id: "stat-categories", endpoint: "/api/v1/admin/categories", listKey: "categories" },
{ id: "stat-banners", endpoint: "/api/v1/admin/banner", listKey: "banners" },
{ id: "stat-mini-sliders", endpoint: "/api/v1/admin/mini-slider", listKey: "miniSliders" },
{ id: "stat-static", endpoint: "/api/v1/admin/static", listKey: "statics" },
{ id: "stat-currency", endpoint: "/api/v1/admin/currency", listKey: "currencies" },
];

View File

@@ -117,6 +117,27 @@
}),
},
"mini-sliders": {
title: "Mini sliders",
endpoint: "/api/v1/admin/mini-slider",
listKey: "miniSliders",
searchable: true,
columns: [
{ key: "Id", label: "ID", type: "id", sortKey: "id" },
{ key: "imagePath", label: "Image", type: "image" },
{ key: "title", label: "Title", type: "lang" },
{ key: "createdAt", label: "Created", type: "date", sortKey: "createdAt" },
],
fields: [
{ name: "title", label: "Title", type: "lang", required: true },
{ name: "imagePath", label: "Image", type: "image", required: true },
],
buildPayload: (values) => ({
title: values.title,
imagePath: values.imagePath,
}),
},
news: {
title: "News",
endpoint: "/api/v1/admin/news",

View File

@@ -16,6 +16,13 @@
<div class="stat-desc"><a href="/M0n1t0r/banners" class="link-hover link">Manage banners</a></div>
</div>
</div>
<div id="stat-mini-sliders" class="stats bg-base-100 shadow-sm">
<div class="stat">
<div class="stat-title">Mini sliders</div>
<div class="stat-value text-primary" data-stat-value><span class="loading loading-dots loading-sm"></span></div>
<div class="stat-desc"><a href="/M0n1t0r/mini-sliders" class="link-hover link">Manage mini sliders</a></div>
</div>
</div>
<div id="stat-static" class="stats bg-base-100 shadow-sm">
<div class="stat">
<div class="stat-title">Static pages</div>

View File

@@ -35,6 +35,12 @@
Banners
</a>
</li>
<li>
<a href="/M0n1t0r/mini-sliders" class="{{if eq .Active "mini-sliders"}}active{{end}}">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="m6 12 3.157-3.157A2.25 2.25 0 0 1 10.748 8.25h8.002A1.5 1.5 0 0 1 20.25 9.75v9a1.5 1.5 0 0 1-1.5 1.5H5.25A1.5 1.5 0 0 1 3.75 18.75v-6A.75.75 0 0 1 4.5 12h1.5Zm9-3.75h.008v.008H15V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>
Mini sliders
</a>
</li>
<li>
<a href="/M0n1t0r/news" class="{{if eq .Active "news"}}active{{end}}">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.8" stroke="currentColor" class="h-5 w-5" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"/></svg>