diff --git a/backend/core/models/permissions_to_roles.go b/backend/core/models/permissions_to_roles.go index c5660fb..32e1b15 100644 --- a/backend/core/models/permissions_to_roles.go +++ b/backend/core/models/permissions_to_roles.go @@ -12,6 +12,6 @@ type PermissionToRole struct { PermissionResource string `bun:"resource,pk"` RoleID uuid.UUID `bun:"type:uuid,pk"` - Permission *Permission `bun:"rel:belongs-to,join:resource=resource,action=action"` + Permission *Permission `bun:"rel:belongs-to"` Role *Role `bun:"rel:belongs-to,join:role_id=id"` } diff --git a/frontend/app/(auth)/dashboard/settings/roles/page.tsx b/frontend/app/(auth)/dashboard/settings/roles/page.tsx index 47bf858..6e3702f 100644 --- a/frontend/app/(auth)/dashboard/settings/roles/page.tsx +++ b/frontend/app/(auth)/dashboard/settings/roles/page.tsx @@ -136,7 +136,6 @@ function RoleCard({ role, onDelete, permissions }: RoleCardProps) { {Object.entries(permissions).map(([res, actions]) => { - console.log(role.permissions); return ( -
-
-
- +
+
+
+ - - Entraîneur depuis 60 ans + + Nicolas GORUK - - Robert Louis Jean Jacke - + + Président l'association française de Latosa + Escrima +
@@ -47,74 +43,30 @@ export default async function About() {

Lorem ipsum dolor sit amet consectetur - adipisicing elit. Debitis accusamus illum, - nam nemo quod delectus velit repellat odio - dolorum sapiente soluta, aliquam atque - praesentium ea placeat ad, neque eveniet - adipisci? + adipisicing elit. Debitis accusamus + illum, nam nemo quod delectus velit + repellat odio dolorum sapiente soluta, + aliquam atque praesentium ea placeat ad, + neque eveniet adipisci?

Lorem ipsum, dolor sit amet

Lorem ipsum dolor sit amet consectetur - adipisicing elit. Debitis accusamus illum, - nam nemo quod delectus velit repellat odio - dolorum sapiente soluta, aliquam atque - praesentium ea placeat ad, neque eveniet - adipisci? + adipisicing elit. Debitis accusamus + illum, nam nemo quod delectus velit + repellat odio dolorum sapiente soluta, + aliquam atque praesentium ea placeat ad, + neque eveniet adipisci?

-
-

- Mes associés -

-
- - - -
- Richard Vagneur -
- - CN -
- - -
- Robert Lewis -
- CN -
- - -
- Marria Caré -
- CN -
-
-
-
+
president profile image @@ -129,7 +81,8 @@ export default async function About() { l'état" possible.

- equipement (gants, casque) pris en compte. Prévoir une tenue sportive adaptée. + equipement (gants, casque) pris en compte. Prévoir une + tenue sportive adaptée.

diff --git a/frontend/app/(main)/page.tsx b/frontend/app/(main)/page.tsx index 18f0266..d584290 100644 --- a/frontend/app/(main)/page.tsx +++ b/frontend/app/(main)/page.tsx @@ -5,6 +5,7 @@ import Gallery from "@/components/gallery"; import Hero from "@/components/hero"; import Testimonial from "@/components/testimonial"; import { CarouselItem } from "@/components/ui/carousel"; +import YouTubeEmbed from "@/components/youtube-embed"; import { IYoutube } from "@/interfaces/youtube"; export default async function Home() { @@ -17,6 +18,15 @@ export default async function Home() { return (
+
+ +
- + ); })} diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index 53a8187..d7c8acf 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -36,7 +36,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + diff --git a/frontend/components/hero.tsx b/frontend/components/hero.tsx index 31c4026..f9e3cb4 100644 --- a/frontend/components/hero.tsx +++ b/frontend/components/hero.tsx @@ -1,9 +1,6 @@ import { ExternalLink } from "lucide-react"; -import { cn } from "@/lib/utils"; - -import { Badge } from "@/components/ui/badge"; -import { Button, buttonVariants } from "@/components/ui/button"; +import { Button } from "@/components/ui/button"; import Link from "next/link"; const Hero = () => { @@ -20,7 +17,9 @@ const Hero = () => { />

- Trouvez votre équilibre avec Latosa-Escrima + Trouvez votre équilibre +
+ avec Latosa-Escrima

Une évolution des arts martiaux Philippins diff --git a/frontend/components/nav-bar.tsx b/frontend/components/nav-bar.tsx index 6fee23e..d3fab0b 100644 --- a/frontend/components/nav-bar.tsx +++ b/frontend/components/nav-bar.tsx @@ -21,6 +21,7 @@ import { import Link from "next/link"; import { deleteCookie, getCookie } from "cookies-next"; import { useEffect, useState } from "react"; +import { ThemeSwitcher } from "./theme-switcher"; const subMenuItemsOne = [ { @@ -142,6 +143,7 @@ const Navbar = () => {

+
- - - - - - - -
- logo - - Latosa-Escrima - +
+ + + + + + + + +
+ logo + + Latosa-Escrima + +
+
+
+
+ + Accueil + + + Planning + + + À propos + + + Blog + +
+
+ +
+ +
- - -
- - Accueil - - - - - Products - - - {subMenuItemsOne.map( - (item, idx) => ( - - {item.icon} -
-
- {item.title} -
-

- { - item.description - } -

-
-
- ), - )} -
-
- - - Resources - - - {subMenuItemsTwo.map( - (item, idx) => ( - - {item.icon} -
-
- {item.title} -
-

- { - item.description - } -

-
-
- ), - )} -
-
-
- - Pricing - - - Blog - -
- - - + + +
diff --git a/frontend/components/planning.tsx b/frontend/components/planning.tsx index f00ee10..772aca8 100644 --- a/frontend/components/planning.tsx +++ b/frontend/components/planning.tsx @@ -1,6 +1,6 @@ "use client"; -import { ApiResponse, request, useApi } from "@/hooks/use-api"; +import { ApiResponse, request } from "@/hooks/use-api"; import "@schedule-x/theme-shadcn/dist/index.css"; import { useNextCalendarApp, ScheduleXCalendar } from "@schedule-x/react"; import { createEventsServicePlugin } from "@schedule-x/events-service"; @@ -26,17 +26,24 @@ import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { KeyedMutator } from "swr"; +import { getCookie } from "cookies-next"; +import { useTheme } from "next-themes"; const Planning: React.FC<{ events: CalendarEventExternal[]; mutate?: KeyedMutator>; }> = ({ events, mutate }) => { - const plugins = [ - createEventsServicePlugin(), - createDragAndDropPlugin(), - createResizePlugin(), - createEventRecurrencePlugin(), - ]; + const { resolvedTheme } = useTheme(); + console.log(resolvedTheme); + const isConnected = getCookie("auth_token"); + const plugins = isConnected + ? [ + createEventsServicePlugin(), + createDragAndDropPlugin(), + createResizePlugin(), + createEventRecurrencePlugin(), + ] + : []; const [eventSelected, setEventSelected] = useState(null); const [newEvent, setNewEvent] = useState { + calendar?.setTheme(resolvedTheme === "dark" ? "dark" : "light"); + }, [resolvedTheme]); + const AddButton: React.FC = () => ( + + + setTheme("light")}> + Clair + + setTheme("dark")}> + Sombre + + setTheme("system")}> + Système + + + + ); +} diff --git a/frontend/components/ui/calendar.tsx b/frontend/components/ui/calendar.tsx deleted file mode 100644 index 5c0a682..0000000 --- a/frontend/components/ui/calendar.tsx +++ /dev/null @@ -1,82 +0,0 @@ -"use client"; - -import * as React from "react"; -import { ChevronLeft, ChevronRight } from "lucide-react"; -import { DayPicker } from "react-day-picker"; - -import { cn } from "@/lib/utils"; -import { buttonVariants } from "@/components/ui/button"; - -export type CalendarProps = React.ComponentProps; - -function Calendar({ - className, - classNames, - showOutsideDays = true, - ...props -}: CalendarProps) { - return ( - .day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" - : "[&:has([aria-selected])]:rounded-md", - ), - day: cn( - buttonVariants({ variant: "ghost" }), - "h-8 w-8 p-0 font-normal aria-selected:opacity-100", - ), - day_range_start: "day-range-start", - day_range_end: "day-range-end", - day_selected: - "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground", - day_today: "bg-accent text-accent-foreground", - day_outside: - "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground", - day_disabled: "text-muted-foreground opacity-50", - day_range_middle: - "aria-selected:bg-accent aria-selected:text-accent-foreground", - day_hidden: "invisible", - ...classNames, - }} - components={{ - IconLeft: ({ className, ...props }) => ( - - ), - IconRight: ({ className, ...props }) => ( - - ), - }} - {...props} - /> - ); -} -Calendar.displayName = "Calendar"; - -export { Calendar }; diff --git a/frontend/components/youtube-embed.tsx b/frontend/components/youtube-embed.tsx new file mode 100644 index 0000000..5ad0121 --- /dev/null +++ b/frontend/components/youtube-embed.tsx @@ -0,0 +1,81 @@ +"use client"; +import { IYoutubeItem } from "@/interfaces/youtube"; +import Image from "next/image"; +import { useState } from "react"; + +export default function YouTubeEmbed({ + video, + width = 424, + height = 238, + loadIframe = false, + autoPlay = true, +}: { + video: IYoutubeItem | string; + width?: number | "full"; + height?: number | "full"; + loadIframe?: boolean; + autoPlay?: boolean; +}) { + const [isIframeLoaded, setIframeLoaded] = useState(loadIframe); + + const isString = typeof video === "string"; + + const _loadIframe = () => setIframeLoaded(true); + + return ( +
+ {isIframeLoaded ? ( +