@@ -27,10 +27,10 @@ export function AppSidebar({
|
||||
items,
|
||||
footer,
|
||||
}: AppSidebarProps) {
|
||||
const portfolioItem = items.find((item) => item.href === "/root/portfolio");
|
||||
const systemOrder = ["/root", "/root/media", "/root/maintenance", "/root/ui-kit"];
|
||||
const portfolioItem = items.find((item) => item.href === "/portfolio");
|
||||
const systemOrder = ["/", "/media", "/maintenance", "/ui-kit"];
|
||||
const systemItems = items
|
||||
.filter((item) => item.href !== "/root/portfolio")
|
||||
.filter((item) => item.href !== "/portfolio")
|
||||
.sort((left, right) => systemOrder.indexOf(left.href) - systemOrder.indexOf(right.href));
|
||||
|
||||
function renderItem(item: SidebarItem, nested = false) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import Link from "next/link";
|
||||
import { useLocale, useTranslations } from "next-intl";
|
||||
|
||||
import { Container } from "@/components/layout/container";
|
||||
import { buildAdminUrl } from "@/lib/admin-routing";
|
||||
import { getLocalizedPath } from "@/lib/locale";
|
||||
|
||||
const navItems = [
|
||||
@@ -34,7 +35,7 @@ export function SiteFooter({ isAdmin = false }: SiteFooterProps) {
|
||||
</Link>
|
||||
))}
|
||||
{isAdmin ? (
|
||||
<a href="/root" className="text-muted-foreground hover:text-foreground">
|
||||
<a href={buildAdminUrl()} className="text-muted-foreground hover:text-foreground">
|
||||
{tNav("root")}
|
||||
</a>
|
||||
) : null}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { SiteLogo } from "@/components/layout/site-logo";
|
||||
import { SoundToggle } from "@/components/sound-toggle";
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { buildAdminUrl } from "@/lib/admin-routing";
|
||||
import { getLocalizedPath, stripLocalePrefix } from "@/lib/locale";
|
||||
import { toast } from "@/lib/toast";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -314,7 +315,7 @@ export function SiteHeader({
|
||||
/>
|
||||
{isAdmin ? (
|
||||
<Button asChild variant="ghost" size="icon" className={desktopControlButtonClassName}>
|
||||
<Link href="/root" aria-label={t("root")}>
|
||||
<Link href={buildAdminUrl()} aria-label={t("root")}>
|
||||
<LayoutDashboard className="h-4 w-4 transition-transform duration-300 ease-out hover:scale-110" />
|
||||
</Link>
|
||||
</Button>
|
||||
@@ -464,7 +465,7 @@ export function SiteHeader({
|
||||
/>
|
||||
{isAdmin ? (
|
||||
<Button asChild variant="ghost" size="icon" className={mobileControlButtonClassName}>
|
||||
<Link href="/root" aria-label={t("root")} onClick={() => setIsOpen(false)}>
|
||||
<Link href={buildAdminUrl()} aria-label={t("root")} onClick={() => setIsOpen(false)}>
|
||||
<LayoutDashboard className="h-4 w-4 transition-transform duration-300 ease-out hover:scale-110" />
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
@@ -159,7 +159,7 @@ function CategoryForm({
|
||||
return (
|
||||
<form id={formId} action={action} className="space-y-6">
|
||||
{categoryId ? <input type="hidden" name="id" value={categoryId} /> : null}
|
||||
<input type="hidden" name="redirectPath" value="/root/portfolio/categories" />
|
||||
<input type="hidden" name="redirectPath" value="/portfolio/categories" />
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-1">
|
||||
@@ -281,7 +281,7 @@ function EditCategoryDialog({
|
||||
<div className="flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row">
|
||||
<form action={removeCategoryAction}>
|
||||
<input type="hidden" name="id" value={category.id} />
|
||||
<input type="hidden" name="redirectPath" value="/root/portfolio/categories" />
|
||||
<input type="hidden" name="redirectPath" value="/portfolio/categories" />
|
||||
<Button type="submit" variant="destructive" disabled={category.projectCount > 0}>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
{copy.delete}
|
||||
|
||||
@@ -40,7 +40,7 @@ export function PortfolioProjectActions({ projectId }: { projectId: string }) {
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/root/portfolio/projects/${projectId}`}>
|
||||
<Link href={`/portfolio/projects/${projectId}`}>
|
||||
<FolderKanban className="mr-2 h-4 w-4" />
|
||||
{copy.editProject}
|
||||
</Link>
|
||||
|
||||
@@ -46,13 +46,13 @@ export function PortfolioProjectsOverview({
|
||||
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button asChild>
|
||||
<Link href="/root/portfolio/projects/new">
|
||||
<Link href="/portfolio/projects/new">
|
||||
<Plus className="h-4 w-4" />
|
||||
{copy.newProject}
|
||||
</Link>
|
||||
</Button>
|
||||
<Button asChild variant="outline">
|
||||
<Link href="/root/portfolio/categories">
|
||||
<Link href="/portfolio/categories">
|
||||
<Tags className="h-4 w-4" />
|
||||
{copy.newCategory}
|
||||
</Link>
|
||||
@@ -62,7 +62,7 @@ export function PortfolioProjectsOverview({
|
||||
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button asChild variant={selectedCategory === "" ? "default" : "outline"}>
|
||||
<Link href="/root/portfolio">{copy.all}</Link>
|
||||
<Link href="/portfolio">{copy.all}</Link>
|
||||
</Button>
|
||||
{categories.map((category) => (
|
||||
<Button
|
||||
@@ -70,7 +70,7 @@ export function PortfolioProjectsOverview({
|
||||
asChild
|
||||
variant={selectedCategory === category.id ? "default" : "outline"}
|
||||
>
|
||||
<Link href={`/root/portfolio?category=${category.id}`}>
|
||||
<Link href={`/portfolio?category=${category.id}`}>
|
||||
{category.name.de || category.name.en || category.name.ar}
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
@@ -12,12 +12,12 @@ const items = [
|
||||
{
|
||||
key: "projects",
|
||||
label: "Projekte",
|
||||
href: "/root/portfolio",
|
||||
href: "/portfolio",
|
||||
},
|
||||
{
|
||||
key: "categories",
|
||||
label: "Kategorien",
|
||||
href: "/root/portfolio/categories",
|
||||
href: "/portfolio/categories",
|
||||
},
|
||||
] as const;
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ import { SidebarMaintenanceControl } from "@/components/root/sidebar-maintenance
|
||||
import { SoundToggle } from "@/components/sound-toggle";
|
||||
import { ThemeToggle } from "@/components/theme-toggle";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { buildSiteUrl } from "@/lib/admin-routing";
|
||||
import { getMaintenanceMode, getSiteSettingsMediaBindings } from "@/lib/app-config";
|
||||
import { getLocalizedPath } from "@/lib/locale";
|
||||
import { getRootNavigation } from "@/lib/root-navigation";
|
||||
|
||||
import { updateMaintenanceModeAction } from "@/app/root/maintenance/actions";
|
||||
@@ -75,12 +75,12 @@ export async function RootDashboardShell({
|
||||
const sidebarItems = getRootNavigation(copy, active, smtpChild, portfolioChild);
|
||||
const normalizedSidebarItems = sidebarItems.filter(
|
||||
(item) =>
|
||||
item.href !== "/root/maintenance" &&
|
||||
item.href !== "/root/ui-kit" &&
|
||||
item.href !== "/root/smtp" &&
|
||||
item.href !== "/root/marquee",
|
||||
item.href !== "/maintenance" &&
|
||||
item.href !== "/ui-kit" &&
|
||||
item.href !== "/smtp" &&
|
||||
item.href !== "/marquee",
|
||||
);
|
||||
const footerSidebarItems = ["/root/marquee", "/root/smtp"]
|
||||
const footerSidebarItems = ["/marquee", "/smtp"]
|
||||
.map((href) => sidebarItems.find((item) => item.href === href))
|
||||
.filter((item): item is NonNullable<typeof item> => Boolean(item));
|
||||
const headerIcon =
|
||||
@@ -110,7 +110,7 @@ export async function RootDashboardShell({
|
||||
icon={headerIcon}
|
||||
items={normalizedSidebarItems}
|
||||
sidebarIconSrc={mediaBindings.favicon?.url}
|
||||
sidebarBrandHref={getLocalizedPath("de")}
|
||||
sidebarBrandHref={buildSiteUrl()}
|
||||
sidebarBrandHoverLabel={copy.backToSite}
|
||||
sidebarTop={sidebarTopContent}
|
||||
sidebarFooterItems={footerSidebarItems}
|
||||
@@ -126,7 +126,7 @@ export async function RootDashboardShell({
|
||||
variant={active === "ui-kit" ? "default" : "outline"}
|
||||
className="w-full justify-between"
|
||||
>
|
||||
<Link href="/root/ui-kit">
|
||||
<Link href="/ui-kit">
|
||||
{copy.uiKit}
|
||||
<SwatchBook className="h-4 w-4" />
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user