|
@@ -35,115 +35,170 @@ import { Button } from "@/components/ui/button"
|
|
|
import { signOut } from "next-auth/react"
|
|
import { signOut } from "next-auth/react"
|
|
|
import Link from "next/link"
|
|
import Link from "next/link"
|
|
|
|
|
|
|
|
-// Menú para Administrador
|
|
|
|
|
-const adminMenuItems = [
|
|
|
|
|
|
|
+// Menú para Administrador - Agrupado por secciones
|
|
|
|
|
+const adminMenuSections = [
|
|
|
{
|
|
{
|
|
|
- title: "Dashboard",
|
|
|
|
|
- url: "/admin/dashboard",
|
|
|
|
|
- icon: Home,
|
|
|
|
|
|
|
+ label: "Principal",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Dashboard",
|
|
|
|
|
+ url: "/admin/dashboard",
|
|
|
|
|
+ icon: Home,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Profesores",
|
|
|
|
|
- url: "/admin/teachers",
|
|
|
|
|
- icon: Users,
|
|
|
|
|
|
|
+ label: "Gestión de Usuarios",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Profesores",
|
|
|
|
|
+ url: "/admin/teachers",
|
|
|
|
|
+ icon: Users,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Estudiantes",
|
|
|
|
|
+ url: "/admin/students",
|
|
|
|
|
+ icon: GraduationCap,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Estudiantes",
|
|
|
|
|
- url: "/admin/students",
|
|
|
|
|
- icon: GraduationCap,
|
|
|
|
|
|
|
+ label: "Gestión Académica",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Períodos Académicos",
|
|
|
|
|
+ url: "/admin/periods",
|
|
|
|
|
+ icon: Calendar,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Clases",
|
|
|
|
|
+ url: "/admin/classes",
|
|
|
|
|
+ icon: BookOpen,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Secciones",
|
|
|
|
|
+ url: "/admin/sections",
|
|
|
|
|
+ icon: School,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Períodos Académicos",
|
|
|
|
|
- url: "/admin/periods",
|
|
|
|
|
- icon: Calendar,
|
|
|
|
|
|
|
+ label: "Asignaciones e Inscripciones",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Asignaciones de Profesores",
|
|
|
|
|
+ url: "/admin/teacher-assignments",
|
|
|
|
|
+ icon: UserCheck,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Inscripciones de Estudiantes",
|
|
|
|
|
+ url: "/admin/student-enrollments",
|
|
|
|
|
+ icon: UserPlus,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Historial de Inscripciones",
|
|
|
|
|
+ url: "/admin/enrollment-history",
|
|
|
|
|
+ icon: BarChart3,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Clases",
|
|
|
|
|
- url: "/admin/classes",
|
|
|
|
|
- icon: BookOpen,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Secciones",
|
|
|
|
|
- url: "/admin/sections",
|
|
|
|
|
- icon: School,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Asignaciones de Profesores",
|
|
|
|
|
- url: "/admin/teacher-assignments",
|
|
|
|
|
- icon: UserCheck,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Inscripciones de Estudiantes",
|
|
|
|
|
- url: "/admin/student-enrollments",
|
|
|
|
|
- icon: UserPlus,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Historial de Inscripciones",
|
|
|
|
|
- url: "/admin/enrollment-history",
|
|
|
|
|
- icon: BarChart3,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Parciales",
|
|
|
|
|
- url: "/admin/partials",
|
|
|
|
|
- icon: Settings,
|
|
|
|
|
|
|
+ label: "Configuración",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Parciales",
|
|
|
|
|
+ url: "/admin/partials",
|
|
|
|
|
+ icon: Settings,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
-// Menú para Profesor
|
|
|
|
|
-const teacherMenuItems = [
|
|
|
|
|
- {
|
|
|
|
|
- title: "Dashboard",
|
|
|
|
|
- url: "/teacher",
|
|
|
|
|
- icon: Home,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Estudiantes",
|
|
|
|
|
- url: "/teacher/students",
|
|
|
|
|
- icon: GraduationCap,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+// Menú para Profesor - Agrupado por secciones
|
|
|
|
|
+const teacherMenuSections = [
|
|
|
{
|
|
{
|
|
|
- title: "Tomar Asistencia",
|
|
|
|
|
- url: "/teacher/attendance",
|
|
|
|
|
- icon: UserCheck,
|
|
|
|
|
|
|
+ label: "Principal",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Dashboard",
|
|
|
|
|
+ url: "/teacher",
|
|
|
|
|
+ icon: Home,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Estudiantes",
|
|
|
|
|
+ url: "/teacher/students",
|
|
|
|
|
+ icon: GraduationCap,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Historial de Asistencia",
|
|
|
|
|
- url: "/teacher/attendance-history",
|
|
|
|
|
- icon: ClipboardList,
|
|
|
|
|
|
|
+ label: "Gestión de Asistencia",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Tomar Asistencia",
|
|
|
|
|
+ url: "/teacher/attendance",
|
|
|
|
|
+ icon: UserCheck,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Historial de Asistencia",
|
|
|
|
|
+ url: "/teacher/attendance-history",
|
|
|
|
|
+ icon: ClipboardList,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Asistencia por Estudiante",
|
|
|
|
|
+ url: "/teacher/student-attendance",
|
|
|
|
|
+ icon: Users,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Asistencia por Estudiante",
|
|
|
|
|
- url: "/teacher/student-attendance",
|
|
|
|
|
- icon: Users,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- title: "Exportar Reportes",
|
|
|
|
|
- url: "/teacher/export-reports",
|
|
|
|
|
- icon: Download,
|
|
|
|
|
|
|
+ label: "Reportes",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Exportar Reportes",
|
|
|
|
|
+ url: "/teacher/export-reports",
|
|
|
|
|
+ icon: Download,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
-// Menú para Estudiante
|
|
|
|
|
-const studentMenuItems = [
|
|
|
|
|
- {
|
|
|
|
|
- title: "Dashboard",
|
|
|
|
|
- url: "/student/dashboard",
|
|
|
|
|
- icon: Home,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+// Menú para Estudiante - Agrupado por secciones
|
|
|
|
|
+const studentMenuSections = [
|
|
|
{
|
|
{
|
|
|
- title: "Mis Clases",
|
|
|
|
|
- url: "/student/classes",
|
|
|
|
|
- icon: BookOpen,
|
|
|
|
|
|
|
+ label: "Principal",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Dashboard",
|
|
|
|
|
+ url: "/student/dashboard",
|
|
|
|
|
+ icon: Home,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Mi Asistencia",
|
|
|
|
|
- url: "/student/attendance",
|
|
|
|
|
- icon: ClipboardList,
|
|
|
|
|
|
|
+ label: "Académico",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Mis Clases",
|
|
|
|
|
+ url: "/student/classes",
|
|
|
|
|
+ icon: BookOpen,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Horarios",
|
|
|
|
|
+ url: "/student/schedule",
|
|
|
|
|
+ icon: Calendar,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- title: "Horarios",
|
|
|
|
|
- url: "/student/schedule",
|
|
|
|
|
- icon: Calendar,
|
|
|
|
|
|
|
+ label: "Asistencia",
|
|
|
|
|
+ items: [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "Mi Asistencia",
|
|
|
|
|
+ url: "/student/attendance",
|
|
|
|
|
+ icon: ClipboardList,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
]
|
|
]
|
|
|
|
|
|
|
@@ -161,7 +216,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
|
const isAdmin = session.user.role === "admin"
|
|
const isAdmin = session.user.role === "admin"
|
|
|
const isTeacher = session.user.role === "teacher"
|
|
const isTeacher = session.user.role === "teacher"
|
|
|
const isStudent = session.user.role === "student"
|
|
const isStudent = session.user.role === "student"
|
|
|
- const menuItems = isAdmin ? adminMenuItems : isTeacher ? teacherMenuItems : studentMenuItems
|
|
|
|
|
|
|
+ const menuSections = isAdmin ? adminMenuSections : isTeacher ? teacherMenuSections : studentMenuSections
|
|
|
const userInitials = session.user.firstName?.[0] + (session.user.lastName?.[0] || "")
|
|
const userInitials = session.user.firstName?.[0] + (session.user.lastName?.[0] || "")
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
@@ -170,7 +225,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
|
<SidebarMenu>
|
|
<SidebarMenu>
|
|
|
<SidebarMenuItem>
|
|
<SidebarMenuItem>
|
|
|
<SidebarMenuButton size="lg" asChild>
|
|
<SidebarMenuButton size="lg" asChild>
|
|
|
- <Link href={isAdmin ? "/admin" : isTeacher ? "/teacher" : "/student"}>
|
|
|
|
|
|
|
+ <Link href={isAdmin ? "/admin/dashboard" : isTeacher ? "/teacher/dashboard" : "/student/dashboard"}>
|
|
|
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
|
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
|
|
<School className="size-4" />
|
|
<School className="size-4" />
|
|
|
</div>
|
|
</div>
|
|
@@ -187,23 +242,25 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
|
</SidebarHeader>
|
|
</SidebarHeader>
|
|
|
|
|
|
|
|
<SidebarContent>
|
|
<SidebarContent>
|
|
|
- <SidebarGroup>
|
|
|
|
|
- <SidebarGroupLabel>Navegación</SidebarGroupLabel>
|
|
|
|
|
- <SidebarGroupContent>
|
|
|
|
|
- <SidebarMenu>
|
|
|
|
|
- {menuItems.map((item) => (
|
|
|
|
|
- <SidebarMenuItem key={item.title}>
|
|
|
|
|
- <SidebarMenuButton asChild>
|
|
|
|
|
- <Link href={item.url}>
|
|
|
|
|
- <item.icon />
|
|
|
|
|
- <span>{item.title}</span>
|
|
|
|
|
- </Link>
|
|
|
|
|
- </SidebarMenuButton>
|
|
|
|
|
- </SidebarMenuItem>
|
|
|
|
|
- ))}
|
|
|
|
|
- </SidebarMenu>
|
|
|
|
|
- </SidebarGroupContent>
|
|
|
|
|
- </SidebarGroup>
|
|
|
|
|
|
|
+ {menuSections.map((section) => (
|
|
|
|
|
+ <SidebarGroup key={section.label}>
|
|
|
|
|
+ <SidebarGroupLabel>{section.label}</SidebarGroupLabel>
|
|
|
|
|
+ <SidebarGroupContent>
|
|
|
|
|
+ <SidebarMenu>
|
|
|
|
|
+ {section.items.map((item) => (
|
|
|
|
|
+ <SidebarMenuItem key={item.title}>
|
|
|
|
|
+ <SidebarMenuButton asChild>
|
|
|
|
|
+ <Link href={item.url}>
|
|
|
|
|
+ <item.icon />
|
|
|
|
|
+ <span>{item.title}</span>
|
|
|
|
|
+ </Link>
|
|
|
|
|
+ </SidebarMenuButton>
|
|
|
|
|
+ </SidebarMenuItem>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </SidebarMenu>
|
|
|
|
|
+ </SidebarGroupContent>
|
|
|
|
|
+ </SidebarGroup>
|
|
|
|
|
+ ))}
|
|
|
</SidebarContent>
|
|
</SidebarContent>
|
|
|
|
|
|
|
|
<SidebarFooter>
|
|
<SidebarFooter>
|